2014-07-13 01:04:16 +02:00
|
|
|
//// [couldNotSelectGenericOverload.ts]
|
|
|
|
function makeArray<T>(items: T[]): T[] { return items; }
|
|
|
|
var b = [1, ""];
|
|
|
|
var b1G = makeArray(1, ""); // any, no error
|
|
|
|
var b2G = makeArray(b); // any[]
|
|
|
|
|
|
|
|
function makeArray2(items: any[]): any[] { return items; }
|
|
|
|
var b3G = makeArray2(1, ""); // error
|
|
|
|
|
|
|
|
|
|
|
|
//// [couldNotSelectGenericOverload.js]
|
|
|
|
function makeArray(items) {
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
var b = [1, ""];
|
2014-08-15 01:36:33 +02:00
|
|
|
var b1G = makeArray(1, ""); // any, no error
|
|
|
|
var b2G = makeArray(b); // any[]
|
2014-07-13 01:04:16 +02:00
|
|
|
function makeArray2(items) {
|
|
|
|
return items;
|
|
|
|
}
|
2014-08-15 01:36:33 +02:00
|
|
|
var b3G = makeArray2(1, ""); // error
|