Closed
Description
In the code below, removing the quotes from the instance field name triggers the expected compile-time error. I thought that maybe quoted fields are not checked, but apparently strictNullChecks works on quoted fields, so i think strictPropertyInitialization should work too.
TypeScript Version: 2.7.2
Search Terms: strictPropertyInitialization
Code
class Example
{
public "field": string;
}
console.log(new Example()["field"].toLowerCase());
Expected behavior: error: Property 'field' has no initializer and is not definitely assigned in the constructor.
Actual behavior: compiles fine, crashes at runtime due to undefined field
Related Issues: