Forbid duplicate static class and/or namespace members · AssemblyScript/assemblyscript@8a76750 · GitHub
Skip to content

Commit 8a76750

Browse files
committed
Forbid duplicate static class and/or namespace members
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.
1 parent 89b49f0 commit 8a76750

3 files changed

Lines changed: 43 additions & 2 deletions

File tree

‎src/program.ts‎

Lines changed: 18 additions & 2 deletions

‎tests/compiler/issues/2793.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"stderr": [
3+
"Duplicate identifier 'bar'.",
4+
"in issues/2793.ts(8,14)",
5+
"in issues/2793.ts(2,10)",
6+
"Duplicate identifier 'baz'.",
7+
"in issues/2793.ts(9,7)",
8+
"in issues/2793.ts(3,10)",
9+
"Duplicate identifier 'qux'.",
10+
"in issues/2793.ts(10,14)",
11+
"in issues/2793.ts(4,18)"
12+
]
13+
}

‎tests/compiler/issues/2793.ts‎

Lines changed: 12 additions & 0 deletions

0 commit comments

Comments
 (0)