Closed
Description
TypeScript Version: 3.1.0-dev.20180919
Search Terms:
Cannot read property 'kind' of undefined
Code
enum Color {
RED,
BLUE
}
class Thing {
public color: Color;
public constructor() {
this.color = Color.RED;
}
}
Expected behavior:
Compiles fine in 3.0.3
Actual behavior:
tsc --strict bug.ts -> crashes compiler
Only with --strict (specifically --strictNullChecks AND --strictPropertyInitialization)
TypeError: Cannot read property 'kind' of undefined
at isConstraintPosition
at getConstraintForLocation
at getInitialOrAssignedType
at getTypeAtFlowAssignment
...
Playground Link:
https://bit.ly/2MJaboV
Does not crash though. Compiles fine with TS 3.0.3