Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we give better error messages on invoked accessors? #24554

Closed
DanielRosenwasser opened this issue Jun 1, 2018 · 7 comments · Fixed by #37800
Closed

Can we give better error messages on invoked accessors? #24554

DanielRosenwasser opened this issue Jun 1, 2018 · 7 comments · Fixed by #37800
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this

Comments

@DanielRosenwasser
Copy link
Member

Context https://twitter.com/basarat/status/1002410514704547840?s=19

@donaldpipowitch
Copy link
Contributor

Man I like the passion to immediately convert some feedback on Twitter into a GitHub issue. What I really like in cases like this is "Did you mean...?" types of error feedback (showing the same surrounding code from the user, but modified). I personally also like "Read more" links in cases like this, which potentially contain unfamiliar terms.

It could look like this.

You can't invoke `locations()`, because it has the type `string[]` which has no compatible call signature.

Did you mean to just use `locations` like this? 

  3 | // other code for context...
  4 | this.signUpService.locations;
  5 | // other code for context

Visit https://www.typescriptlang.org/e/missing-call-signature for more details about this error.

And a page like https://www.typescriptlang.org/e/missing-call-signature could list some examples which throw this error and explain terms like "invoke" , "call signature" and so on.

But just some ideas 👋😊

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Help Wanted You can do this Good First Issue Well scoped, documented and has the green light Domain: Error Messages The issue relates to error messaging labels Jun 1, 2018
@mhegazy mhegazy added this to the Community milestone Jun 4, 2018
@maccoda
Copy link

maccoda commented Oct 3, 2018

I would like to start having a look into this one. It is my contribution so may need some assistance navigating 😄

@jtbandes
Copy link
Contributor

jtbandes commented Apr 9, 2020

Hi @DanielRosenwasser, I've submitted a PR to improve this (#37800) — is there any procedure I should follow to get it reviewed?

@orta
Copy link
Contributor

orta commented Apr 9, 2020

Thanks @jtbandes!

During the beta period the TypeScript team end up particularly busy with bugs, as your PR is a feature we're likely to come around to it post 3.9 launch (unless someone can quickly get through the PR) - so for now, this is great and it's on us to do the next step 👍

@jtbandes
Copy link
Contributor

jtbandes commented Apr 9, 2020

Thanks!

@DanielRosenwasser
Copy link
Member Author

Small nit: the issue isn't exactly considered a feature, but @orta's right - most of the team is heads down trying to get work done in time for 3.9. I did leave some feedback on the PR.

@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label May 21, 2020
@DanielRosenwasser
Copy link
Member Author

Thanks @jtbandes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Fixed A PR has been merged for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
7 participants