Skip to content

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

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

Activity

  1. CountBleck commented on Nov 14, 2023

    @CountBleck
    Member

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

  2. self-assigned this
    on Nov 14, 2023
  3. added 2 commits that reference this issue on Nov 20, 2023
    11cb13b
    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

    Development

    No branches or pull requests

    Issue actions