TypeScript Version: 2.8.0-dev.20180209
Code
declare const x: number | undefined;
x!++;
Expected behavior:
src/a.ts(2,2): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
Actual behavior:
No error.
But you said it was a constant?
The expected behavior is an error. The actual behavior is no error. For x: number and x++ there is correctly an error.
Sorry. It's been a long week.
thanks @jack-williams!
No problem!
Most helpful comment
Sorry. It's been a long week.