Skip to content

Compiler should throw error when constructor called without super() #461

@MaxGraey

Description

@MaxGraey

Basically this works correctly even in runtime. But this should produce error during compilation:

class A {
  a: i32;
  constructor() {
    this.a = 1;
  }
}

export class B extends A {
  constructor(b: i32) {
    // super();
    this.a = b;
  }
}

export function test(): i32 {
  var b = new B(2);
  return b.a;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions