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
Expected behavior:
This should compile with strictNullChecks on. I expect {bar: Foo["bar"]} to be the same thing as Foo in this case. Actual behavior:
running tsc --strictNullChecks .\bug.ts result in:
bug.ts:4:7 - error TS2322: Type '{ bar: string | undefined; }' is not assignable
to type 'Foo'.
Type '{ bar: string | undefined; }' is not assignable to type '{ bar: string;
}'.
Types of property 'bar' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
4 const b2: Foo = b1;
~~
Found 1 error.