Skip to content
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

Distinguish missing and undefined #16524

Closed
sandersn opened this issue Jun 14, 2017 · 2 comments
Closed

Distinguish missing and undefined #16524

sandersn opened this issue Jun 14, 2017 · 2 comments
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@sandersn
Copy link
Member

Typescript should distinguish missing and undefined at the type level in order to distinguish the following two statements:

// @strictNullChecks: true
type A = { x?: string }
let x: A = {}
let y: A = { x: undefined } // should not be allowed, but currently is
@dgoldstein0
Copy link

I believe this is a dupe of #13195

@mhegazy
Copy link
Contributor

mhegazy commented Jun 14, 2017

you are right. closing.

@mhegazy mhegazy closed this as completed Jun 14, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants