11 lines
No EOL
408 B
Text
11 lines
No EOL
408 B
Text
tests/cases/compiler/widenToAny2.ts(4,5): error TS2322: Type 'string' is not assignable to type 'number'.
|
|
|
|
|
|
==== tests/cases/compiler/widenToAny2.ts (1 errors) ====
|
|
function foo3<T>(x: T[]): T {
|
|
return undefined;
|
|
}
|
|
var z3:number = foo3([undefined, "def"]); // Type is any, but should be string
|
|
~~
|
|
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
|
|