Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
saulecabrera opened this issue Feb 8, 2021 · 0 comments · Fixed by #1678
Closed

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

saulecabrera opened this issue Feb 8, 2021 · 0 comments · Fixed by #1678
Labels

Comments

@saulecabrera
Copy link
Contributor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants