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
@aluanhaddad , but the following code is not working:
letx: {y?: number}={a : null};
{y?:number} should be same as {}, but I get the following compile error:
message: 'Type '{ a: null; }' is not assignable to type '{ y?: number | undefined; }'.
Object literal may only specify known properties, and 'a' does not exist in type '{ y?: number | undefined; }'.'
source: 'ts'
TypeScript Version: 2.0.10 / nightly (2.2.0-dev.201xxxxx)
Code
Expected behavior:
Compile error raised when "strictNullChecks" is set to true.
Actual behavior:
No compile error. Please note compile error will be raised when union type is not used.
The text was updated successfully, but these errors were encountered: