Skip to content

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

@HerrCai0907

Description

@HerrCai0907

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions