TypeScript
TypeScript copied to clipboard
Compiler does not enforce read only properties
Our team hit an issue when turning on strict in our code. Consider the following code:
class bug { public get id() { return 5; } } var b = new bug(); b.id = 10;
In this example, the id property only declares a getter, however, it is still possible to assign a value to it in TS. This is neither a syntax or compile time error in TS (1.4.0). Is there a workaround? Or Is this something that is already being fixed?
Diego
see #12