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
Code
More a suggestion than a bug. I found out that there are a few situations where enabling strictNullChecks results in unnecessary complexity in the code. For example :
if ( myArray.length > 0 ) {
let o: Object = myArray.pop();
o.method();
}
Expected behavior:
should compile
Actual behavior:
requires a Object | undefined type and an additional safety test
if ( myArray.length > 0) {
let o: Object | undefined = myArray.pop();
if (o) {
o.method();
}
}