Skip to content

Typo in return before class construction crashes compiler #2082

Closed
@endercrest

Description

@endercrest

Ran into a scenario where I had a typo in a return statement that caused the compiler to crash. Expected the code below to provide a useful error instead of crashing the compiler.

Code:

class Test {}

export function test() {
  retun new Test();
}

WebAssembly Studio: https://webassembly.studio/?f=8qsn9gum0sr

Error:

[info]: Task build is running...
[error]: Task build failed: assertion failed

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