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
constfoo=Object.assign({},{f(){return1;}});// next line does not give error because foo is typed as any :-(foo.g();constbar={f(){return1;}}constzoo=Object.assign({},bar);// but next line does give error :-)zoo.h();
Expected behavior:
foo.ts(5,5): error TS2339: Property 'g' does not exist on type '{} & { f(): number; }'.
foo.ts(12,5): error TS2339: Property 'h' does not exist on type '{} & { f(): number; }'.
Actual behavior:
foo.ts(12,5): error TS2339: Property 'h' does not exist on type '{} & { f(): number; }'.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 2.1.5
Code
Expected behavior:
foo.ts(5,5): error TS2339: Property 'g' does not exist on type '{} & { f(): number; }'.
foo.ts(12,5): error TS2339: Property 'h' does not exist on type '{} & { f(): number; }'.
Actual behavior:
foo.ts(12,5): error TS2339: Property 'h' does not exist on type '{} & { f(): number; }'.
The text was updated successfully, but these errors were encountered: