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{prop1: {value: number}[];prop2: string[];}functiongetFoo<TextendskeyofFoo>(key: T): Foo[T]|undefined{if(key==="prop1"){return[{value: 1}];// Error here}}constbar=getFoo("prop1");// has correct type
Expected behavior:
No error. This used to work in 3.4.5
Actual behavior:
Type '{ value: number; }[]' is not assignable to type 'Foo[T]'.
Type '{ value: number; }[]' is not assignable to type '{ value: number; }[] & string[]'.
Type '{ value: number; }[]' is not assignable to type 'string[]'.
Type '{ value: number; }' is not assignable to type 'string'.