Forbid duplicate namespace/static class members#2805
Draft
CountBleck wants to merge 2 commits intoAssemblyScript:mainfrom
Draft
Forbid duplicate namespace/static class members#2805CountBleck wants to merge 2 commits intoAssemblyScript:mainfrom
CountBleck wants to merge 2 commits intoAssemblyScript:mainfrom
Conversation
This is unfortunately necessary for the next commit. This is overall bad for 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. For instance, if namespace members had unique separators in internal names, then a non-exported namespace member would override a static class member, assuming the names are the same. Note that this change doesn't prevent the compiler from attempting to compile the duplicate global, and hence the previous commit is needed for this to work fully. Barely fixes AssemblyScript#2793.
8a76750 to
4b4d68c
Compare
HerrCai0907
reviewed
Nov 21, 2023
Member
HerrCai0907
left a comment
There was a problem hiding this comment.
I wonder why do we need to split lots of test.
Member
Author
Yeah, checking diagnostics after initialize is VERY BAD. |
Member
|
Cannot detect this case namespace A { class A { export function _start(): void { |
Member
Author
That's not good at all. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(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).