You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classTestStrictNullChecks{publictest(){varx=0;vary=this.notNullable+x;// notNullable is undefinedconsole.log(y);}privatenotNullable: number;// ERROR: with strictNullChecks, should be required initialized on construction (inline or in ctor)}consttestObject=newTestStrictNullChecks();testObject.test();
Expected behavior:
tsc should error, either on class definition or on object construction; _notNullable cannot be undefined or null.
Actual behavior:
tsc succeeds; NaN is output in console.
The text was updated successfully, but these errors were encountered:
Honestly, I spent 20 minutes searching for a duplicate issue before posting. The trouble is that the default search criteria restricts to open bugs. It didn't occur to me to search for closed bugs, because to us it's not closed. I tested in both the 2.1 RC and the 2.2@next daily. Next time I will expand my search to include closed bugs.
TypeScript Version: 2.1.1 & nightly (2.2.0-dev.20161115)
Code
Expected behavior:
tsc should error, either on class definition or on object construction; _notNullable cannot be undefined or null.
Actual behavior:
tsc succeeds; NaN is output in console.
The text was updated successfully, but these errors were encountered: