Closed
Description
TypeScript Version: 3.3.0-dev.201xxxxx
Search Terms:
'this' cannot be referenced in constructor arguments.
Code
class Test {
constructor() {
const func = (a = this) => 1
}
}
Expected behavior:
Typescript shouldn't produce any errors, as this
is not referenced inside the constructors parameters.
Actual behavior:
Typescript misinterprets the default parameter of the inline arrow function as a default parameter of the constructor (which is not allowed, and should produce an error).
Playground Link: here
Related Issues: None