-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 2.2.1
Code
interface Foo {
bar: {
baz: number;
} | null;
}
type Baz = Foo["bar"]["baz"]; // This doesn't compile with the error: "Property 'baz' does not exist on type '{ baz: number; } | null'."
let x: Baz = 0;
Expected behavior:
I would expect there to be a way to specify bar
is non-null, such as Foo["bar!"]
.
Actual behavior:
The code doesn't compile with the following error message:
"Property 'baz' does not exist on type '{ baz: number; } | null'."
AdamWillden, itajaja, StokeMasterJack, niieani, aaronbeall and 3 more
Metadata
Metadata
Assignees
Labels
DeclinedThe issue was declined as something which matches the TypeScript visionThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScriptAn idea for TypeScript