-
Notifications
You must be signed in to change notification settings - Fork 237
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
Cannot compile when Typescript namespaces contain keywords #135
Comments
Thanks for reporting this. I think invalid namespace identifiers are first two groups from Reserved Words ( What do you think we should do about this? Prefix these keywords with underscore ( |
Aha, your list of invalid namespace identifiers is not just example but it is the first group of reserved words minus Java reserved words. |
Regarding solutions, both prefixes and case changes could conflict with other packages. I feel like the best option would be to add a prefix that is underscore by default ( |
Yes they can conflict but it is not much probable that single project contains two packages that differ only in one I preferred uppercase namespace (it is common in TypeScript and C#) but since you prefer underscore prefix I used this prefix 😄 |
Fix released: v1.24.317. |
It works. I can compile without errors. Thanks! |
Closing old issues after release. |
Typescript keywords in Java packages create errors (error TS1003: Identifier expected.)
The following are invalid in Typescript namespaces but can appear in java package names:
[ 'debugger',
'delete',
'export',
'function',
'in',
'typeof',
'var',
'with' ]
E.g. here is a valid java package.
package debugger.delete.export.function.in.typeof.var.with;
Here are some invalid namespaces:
namespace a.debugger.c { }
namespace a.delete.c { }
namespace a.export.c { }
namespace a.function.c { }
namespace a.import.c { }
namespace a.in.c { }
namespace a.instanceof.c { }
namespace a.typeof.c { }
namespace a.var.c { }
namespace a.with.c { }
The text was updated successfully, but these errors were encountered: