TypeScript/tests/baselines/reference/widenToAny2.errors.txt
2014-11-05 12:26:03 -08:00

11 lines
408 B
Plaintext

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'.