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
interfaceFoo{prop: string;}functionnullableFooPromise(): Promise<Foo|null>{returnPromise.resolve(null);}nullableFooPromise().then(nullableFoo=>nullableFoo ? nullableFoo : {prop: 'foo'}).then(foo=>console.log(foo.prop));// this line raises an error
Expected behavior:
I expect this to compile (it does actually when I use typescript@2.0.8).
Actual behavior:
I get an error, index.ts(11,28): error TS2531: Object is possibly 'null'.