-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
typeToTypeNode behavior changed for boolean literals #40203
Comments
When we shipped the new NodeFactory API in 4.0, we tried to clean up some confusing API designs and unsoundness. In general, it is bad for keyword tokens in "type"-space and "value"-space to overlap, as it makes it much more difficult for emit transformers to know whether they're working with the value Another thing we changed was that the Regarding TypeScript/src/services/services.ts Lines 480 to 482 in 9dfbf07
I would expect the output to be the following:
The only thing that might change is if we decide to change @RyanCavanaugh, @DanielRosenwasser any thoughts on whether |
This makes sense to me - I'd be happy to close this if the API breaking changes page on the wiki was updated to make a note of this. |
I've updated the API Breaking Changes page in the wiki to reflect that |
Thanks! |
TypeScript Version: 4.1.0-dev.20200823, 4.0.2
Search Terms:
TypeLiteral, TypeLiteralNode, boolean literal type
Code
Expected behavior:
TS 3:
Actual behavior:
TS 4:
Playground Link: N/A
Related Issues: #26075 also discusses whether the intrinsic boolean types should be considered literals, the consensus there seemed to be that
true
andfalse
ought to be literals... and TS 4 seems to be halfway there, which results in a confusing mismatch.The text was updated successfully, but these errors were encountered: