Skip to content

Use of super in a non-derived class results in an assertion #1677

Closed
@saulecabrera

Description

@saulecabrera

The following snippet should emit a diagnostic instead of an assertion

export class B {
  constructor(a: i32) {
    super(x);
  }
}

export function add(a: i32, b: i32): i32 {
  new B(a);
  return a + b;
}

I believe that the diagnostic should be something like:

'super' can only be referenced in a derived class.

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