8 lines
297 B
Plaintext
8 lines
297 B
Plaintext
==== 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 TS2323: Type 'string' is not assignable to type 'number'.
|
|
|