clutz icon indicating copy to clipboard operation
clutz copied to clipboard

Gents adds fields to subclass when the fields exist in superclass.

Open bowenni opened this issue 7 years ago • 0 comments

class B {
  constructor() {
    /** @type {number} */
    this.foo = 1;
  }
}

class C extends B {
  constructor() {
    super();
  }

  f() {
    this.foo = 2;
  }
}

is migrated to

class B {
  foo: number = 1;
}

class C extends B {
  foo: any; // Wrong

  constructor() {
    super();
  }

  f() {
    this.foo = 2;
  }
}

bowenni avatar Jan 03 '18 06:01 bowenni