Closed
Description
TypeScript Version: 3.7.0-dev.20190927 (works on 3.7.0-dev.20190926)
Search Terms:
TS2424, member function
Code
class BaseClass {
foo() {
return null;
}
}
class ChildClass extends BaseClass {
foo = () => null;
}
Expected behavior:
In 3.6.3 and <=3.7.0-dev.20190926, this code would compile without error
Actual behavior:
error TS2424: Class 'BaseClass' defines instance member function 'foo', but extended class 'ChildClass' defines it as instance member property.
8 foo = () => null;
~~~
Since our code has to compile down to ES5 (to support IE11), we need to perform some sort of method binding on methods that reference this
. With this change, it means we would need to make all possibly-overridable member functions arrow functions
Related Issues: