Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork669
Forbid duplicate namespace/static class members#2805
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
This is unfortunately necessary for the next commit. This is overall badfor DX, since fewer errors are shown to the user at once.
This isn't fully TS compatible, but refactors targeting internal names,scoping, merging, etc. are needed to become more compatible. Forinstance, if namespace members had unique separators in internal names,then a non-exported namespace member would override a static classmember, assuming the names are the same.Note that this change doesn't prevent the compiler from attempting tocompile the duplicate global, and hence the previous commit is neededfor this to work fully.BarelyfixesAssemblyScript#2793.
8a76750
to4b4d68c
CompareThere 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.
I wonder why do we need to split lots of test.
Yeah, checking diagnostics after initialize is VERY BAD. |
Cannot detect this case namespace A { class A { export function _start(): void { |
That's not good at all. |
(Barely)fixes#2793.
Changes proposed in this pull request:
⯈ Check diagnostics after initialize (VERY BAD)
⯈ Forbid duplicate namespace/static class members
Requiring the compiler to check diagnostics after initialize is VERY BAD, and ideally someone should find a way to prevent the compiler from attempting to compile the duplicate global (which it shouldn't see to begin with).