Skip to content

asc crash when use same name in class and namespace #2793

Open
@HerrCai0907

Description

@HerrCai0907
Member

Bug description

class NS {
  static v: i32 = 2;
}

namespace NS {
  let v: i32 = 1;
}
Fatal: Module::addGlobal: assembly/index/NS.v already exists

▌ Whoops, the AssemblyScript compiler has crashed during compile :-(
▌ 
▌ There is no stack trace. Perhaps a Binaryen exception above / in console?
▌ 
▌ > undefined
▌ 
▌ If you see where the error is, feel free to send us a pull request. If not,
▌ please let us know: https://github.com/AssemblyScript/assemblyscript/issues
▌ 
▌ Thank you!

Steps to reproduce

npm run asbuild

AssemblyScript version

latest

Activity

CountBleck

CountBleck commented on Nov 14, 2023

@CountBleck
Member

That looks like a bug from how internal names are generated.

self-assigned this
on Nov 14, 2023
added a commit that references this issue on Nov 20, 2023
11cb13b
added a commit that references this issue on Nov 21, 2023
4b4d68c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @HerrCai0907@CountBleck

    Issue actions

      asc crash when use same name in class and namespace · Issue #2793 · AssemblyScript/assemblyscript