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
With strictNullChecks: true, nullable values are not emitted as a result of an array destructure. Any array destructure can potentially emit undefined values.
TypeScript Version: 2.2.1
Code
constx:number[]=[]const[y]=xy.toString()
Expected behavior:
Compile error on line 3: [ts] Object is possibly 'undefined'
Actual behavior:
Runtime error on line 3: Cannot read property 'toString' of undefined
The text was updated successfully, but these errors were encountered:
sberan
changed the title
Array destructuring emits nullable types
Array destructuring emits non-nullable types
Mar 19, 2017
With
strictNullChecks
:true
, nullable values are not emitted as a result of an array destructure. Any array destructure can potentially emit undefined values.TypeScript Version: 2.2.1
Code
Expected behavior:
Compile error on line 3:
[ts] Object is possibly 'undefined'
Actual behavior:
Runtime error on line 3:
Cannot read property 'toString' of undefined
The text was updated successfully, but these errors were encountered: