2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/indexerReturningTypeParameter1.ts ===
|
|
|
|
interface f {
|
|
|
|
>f : f
|
|
|
|
|
|
|
|
groupBy<T>(): { [key: string]: T[]; };
|
2014-12-06 01:58:49 +01:00
|
|
|
>groupBy : <T>() => { [key: string]: T[]; }
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
>key : string
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
var a: f;
|
|
|
|
>a : f
|
|
|
|
>f : f
|
|
|
|
|
|
|
|
var r = a.groupBy();
|
2014-12-06 01:58:49 +01:00
|
|
|
>r : { [key: string]: {}[]; }
|
|
|
|
>a.groupBy() : { [key: string]: {}[]; }
|
|
|
|
>a.groupBy : <T>() => { [key: string]: T[]; }
|
2014-08-15 23:33:16 +02:00
|
|
|
>a : f
|
2014-12-06 01:58:49 +01:00
|
|
|
>groupBy : <T>() => { [key: string]: T[]; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
class c {
|
|
|
|
>c : c
|
|
|
|
|
|
|
|
groupBy<T>(): { [key: string]: T[]; } {
|
2014-12-06 01:58:49 +01:00
|
|
|
>groupBy : <T>() => { [key: string]: T[]; }
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
>key : string
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var a2: c;
|
|
|
|
>a2 : c
|
|
|
|
>c : c
|
|
|
|
|
|
|
|
var r2 = a2.groupBy();
|
2014-12-06 01:58:49 +01:00
|
|
|
>r2 : { [key: string]: {}[]; }
|
|
|
|
>a2.groupBy() : { [key: string]: {}[]; }
|
|
|
|
>a2.groupBy : <T>() => { [key: string]: T[]; }
|
2014-08-15 23:33:16 +02:00
|
|
|
>a2 : c
|
2014-12-06 01:58:49 +01:00
|
|
|
>groupBy : <T>() => { [key: string]: T[]; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|