assemblyscript icon indicating copy to clipboard operation
assemblyscript copied to clipboard

Forbid duplicate namespace/static class members

Open CountBleck opened this issue 2 years ago • 3 comments

(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).

  • [x] I've read the contributing guidelines
  • [x] I've added my name and email to the NOTICE file

CountBleck avatar Nov 21 '23 03:11 CountBleck

I wonder why do we need to split lots of test.

Yeah, checking diagnostics after initialize is VERY BAD.

CountBleck avatar Nov 21 '23 18:11 CountBleck

Cannot detect this case

namespace A { export function foo(): i32 { return 1; } }

class A { static foo(): i32 { return 2; } }

export function _start(): void { trace("", 1, A.foo()); }

HerrCai0907 avatar Nov 22 '23 09:11 HerrCai0907

Cannot detect this case

That's not good at all.

CountBleck avatar Nov 22 '23 18:11 CountBleck