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
[ts] Add support for the "intrinsic" keyword #12147
[ts] Add support for the "intrinsic" keyword #12147
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/29511/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 5f47c84:
|
node.typeAnnotation = this.tsInType(() => { | ||
this.expect(tt.eq); | ||
|
||
if (this.isContextual("intrinsic")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a dot token is after contextual "intrinsic"
, then "intrinsic"
is not considered as an TSIntrinsicKeyword
:
https://github.com/microsoft/TypeScript/pull/40580/files#diff-ead24f0f0f59c0ea9c1c511052e8884bR6745
namespace intrinsic {
export class Foo {}
}
type Foo = intrinsic.Foo;
From what I understood from the TS PR,
intrinsic
is a keyword only when it's immediately after=
in a type declaration.Hopefully TS will have a spec one day 😛