-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object spread not checking for strictNullChecks #14799
Comments
Similar, but might be a different bug: const x: {a: number}|null = null;
const y = {...x}; With |
The semantics of object spread allows for skipping The |
@mhegazy sorry, incorrect example, and I found that the usage site I ran into actually used |
Fix is up at #15938 |
TypeScript Version: 2.2.1
Code
Expected behavior:
When strictNullChecks = true it should not allow for title = undefined
Actual behavior:
It does not raise an error and I can have an object with a required property undefined.
It does work if I try to set null to title, the compiler will raise an error
The text was updated successfully, but these errors were encountered: