8 lines
No EOL
283 B
Text
8 lines
No EOL
283 B
Text
==== 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
|
|
~~
|
|
!!! Type 'string' is not assignable to type 'number'.
|
|
|