-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Decorator metadata breaking change between TS 2.3.4 -> 2.4.0 #18509
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
Comments
Running |
Hmmm. Using the current TS 2.8.3 and still see this issue. Can someone confirm this? |
Do you have |
Yes. BTW, this works: The following doesn't work:
or
|
Yeah, if you read the linked fix PR - #19089 - this is the expected behavior under |
Okay, this was a misunderstanding. I thought this also concerns strict checking. Thanks for clarification. |
Regarding the general union "issue" of reflecting to Is there really no possibility to get this information? Are there no plans to fully support this scenario? |
We have no plans to implement a full run-time type serialization system akin to reflection C# or Java (more in #3628). The meta-data emit, continues to be an experimental feature tied to decorators, and has a very limited scope (i.e. classes and primitives). we have no plans to expand that scope either. |
@mhegazy Thanks for clarification. |
I couldn't find any documentation on this breaking change between TS 2.3.4 and TS 2.4.0.
I'm not sure whether this is a bug or simply an undocumented change. I suspect the latter--in which case my suggestion is to add documentation regarding that change.
TypeScript Version: >= 2.4.0
Ran tsc with flags --experimentalDecorators --emitDecoratorMetadata.
Using reflect-metadata v0.1.10
Code
Expected behavior:
output in 2.3.4:
Actual behavior:
output in 2.4.0:
The text was updated successfully, but these errors were encountered: