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
Actual behavior:
test.ts(7,5): error TS2322: Type 'string | { a: string; }' is not assignable to type 'string'.
Type '{ a: string; }' is not assignable to type 'string'.
test.ts(9,13): error TS2339: Property 'a' does not exist on type 'string | { a: string; }'.
Pulling x.m out into a separate variable causes the type guard to work as expected.
The text was updated successfully, but these errors were encountered:
TypeScript Version:
1.8.9
Code
Expected behavior:
no compile errors
Actual behavior:
test.ts(7,5): error TS2322: Type 'string | { a: string; }' is not assignable to type 'string'.
Type '{ a: string; }' is not assignable to type 'string'.
test.ts(9,13): error TS2339: Property 'a' does not exist on type 'string | { a: string; }'.
Pulling x.m out into a separate variable causes the type guard to work as expected.
The text was updated successfully, but these errors were encountered: