google/closure-compiler

es6 classes should copy parent class constructor signature

Open

#2 583 ouverte le 28 juil. 2017

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)Java (7 176 stars) (1 197 forks)batch import
P3help wanted

Description

class Parent {
  /** @param {string} value */
  constructor(value) {}
}

class Child1 extends Parent {}
class Child2 extends Parent {
  /** @override */
  constructor(...args) {
    super(...args);
  }
}
class Child3 extends Parent {
  /** @param {string} value */
  constructor(value) {
    super(value);
  }
}

new Parent(1); // OK
new Child1(1); // NO WARNING
new Child2(2); // NO WARNING
new Child3(2); // OK

Guide contributeur