-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Improve error message for decorator type mismatches #4534
Comments
Looks like a fair proposal. feel free to send a PR if you like. |
Something similar for |
Hello! Whats status of this issue? |
it is marked as "Accepting PRs", so PRs are welcomed :) |
As of the date of this post this still seems to be an issue. The following:
Produces the error: When used as below:
The decorator does work as expected and will compile but gives the error above. If you have thoughts on how this might be resolved happy to dig into it if someone would like to point to the right direction. |
This may be tangential, but I had a tough time finding a solution. I was able to create a class factory by casting the return function. Not sure if this is a valid design pattern, but I am using it for dependency injection similar to what is seen in Angular2.
|
Could I take this one? |
Looks like there hasn't been any activity on this, could I take a crack at it? |
In TS 1.5 this:
Compiles without error. In TS 1.6, it reports the error:
On the decorator call in
Foo.ts
. This is a very cryptic message. What it wants you to do is changeRelation.ts
to read like this:or this:
It would be very useful for the error message to indicate what exactly is wrong and how it could be fixed. Something akin to
would be more useful in actually understanding what's wrong and why you need to change your code.
The text was updated successfully, but these errors were encountered: