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
constfunc1=<Textends(string|number)>(key: string,data: T|T[]): void=>{};constfunc2=<Textends(string|number|boolean)>(key: string,data: T|T[]): void=>{};func1("data",["value"]);// OKfunc2("data",[123,345]);// OKfunc2("data",[false,true]);// OKfunc2("data",["123",true]);// OKfunc2("data",["123"]);// Argument of type 'string[]' is not assignable to parameter of type '"value" | "value"[]'.// Type 'string[]' is not assignable to type '"value"[]'.// Type 'string' is not assignable to type '"value"'.
Expected behavior:
Code compiles without errors.
Actual behavior:
Code compiles with error.
BUT: with typescript@2.6.1 there is no error.
The text was updated successfully, but these errors were encountered:
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.7.0-dev.20171116
Code
Expected behavior:
Code compiles without errors.
Actual behavior:
Code compiles with error.
BUT: with typescript@2.6.1 there is no error.
The text was updated successfully, but these errors were encountered: