Open ExE-Boss opened 4 years ago
3.7.0-dev.2019-10-10
Code like this is also generated by webidl2js:
webidl2js
class Foo extends Object { constructor () { throw new TypeError("Illegal constructor"); } }
Same with
class Foo extends Object { constructor () { return Object.create(new.target.prototype); } }
No error
error TS2377: Constructors for derived classes must contain a 'super' call. 2 constructor() { ~~~~~~~~~~~~~~~ 3 throw new TypeError(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 } ~~~~~
and
error TS2377: Constructors for derived classes must contain a 'super' call. 2 constructor() { ~~~~~~~~~~~~~~~ 3 return Object.create(new.target.prototype); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 } ~~~~~
🔗
This also occurs with class constructors that use the return override trick.
TypeScript Version:
3.7.0-dev.2019-10-10
Search Terms:
Code
Code like this is also generated by
webidl2js
:Same with
Expected behavior:
No error
Actual behavior:
and
Playground Link:
🔗
Related Issues:
3696