Skip to content

The compiler crashes when it encounters a class with a static function and an instance field that share the same name. #2006

Closed
@DogWhich

Description

@DogWhich
class BuggedClass {
   snacks:string[]=[];
   static snacks(v:BuggedClass):void {}
}
let inst = new BuggedClass()
BuggedClass.snacks(inst);

When this code is compiled, the compiler misses an assertion at assemblyscript/src/program.ts:4624:3, for compiler version 0.19.8.
If the static function is never called, no error is thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions