2014-07-13 01:04:16 +02:00
|
|
|
//// [widenToAny2.ts]
|
|
|
|
function foo3<T>(x: T[]): T {
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
var z3:number = foo3([undefined, "def"]); // Type is any, but should be string
|
|
|
|
|
|
|
|
|
|
|
|
//// [widenToAny2.js]
|
|
|
|
function foo3(x) {
|
|
|
|
return undefined;
|
|
|
|
}
|
2015-03-26 21:46:35 +01:00
|
|
|
var z3 = foo3([undefined, "def"]); // Type is any, but should be string
|