2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/undefinedInferentialTyping.ts ===
|
|
|
|
function f<T>(arr: T[], elemnt: T): T {
|
|
|
|
>f : <T>(arr: T[], elemnt: T) => T
|
|
|
|
>T : T
|
|
|
|
>arr : T[]
|
|
|
|
>T : T
|
|
|
|
>elemnt : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
var a = f([], 3); // should be number
|
|
|
|
>a : number
|
|
|
|
>f([], 3) : number
|
|
|
|
>f : <T>(arr: T[], elemnt: T) => T
|
2014-10-13 15:56:58 +02:00
|
|
|
>[] : undefined[]
|
2014-08-15 23:33:16 +02:00
|
|
|
|