2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/chainedSpecializationToObjectTypeLiteral.ts ===
|
|
|
|
interface Sequence<T> {
|
|
|
|
>Sequence : Sequence<T>
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
each(iterator: (value: T) => void): void;
|
|
|
|
>each : (iterator: (value: T) => void) => void
|
|
|
|
>iterator : (value: T) => void
|
|
|
|
>value : T
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
map<U>(iterator: (value: T) => U): Sequence<U>;
|
|
|
|
>map : <U>(iterator: (value: T) => U) => Sequence<U>
|
|
|
|
>U : U
|
|
|
|
>iterator : (value: T) => U
|
|
|
|
>value : T
|
|
|
|
>T : T
|
|
|
|
>U : U
|
2014-08-19 04:56:03 +02:00
|
|
|
>Sequence : Sequence<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>U : U
|
|
|
|
|
|
|
|
filter(iterator: (value: T) => boolean): Sequence<T>;
|
|
|
|
>filter : (iterator: (value: T) => boolean) => Sequence<T>
|
|
|
|
>iterator : (value: T) => boolean
|
|
|
|
>value : T
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>Sequence : Sequence<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
|
|
|
|
groupBy<K>(keySelector: (value: T) => K): Sequence<{ key: K; items: T[]; }>;
|
|
|
|
>groupBy : <K>(keySelector: (value: T) => K) => Sequence<{ key: K; items: T[]; }>
|
|
|
|
>K : K
|
|
|
|
>keySelector : (value: T) => K
|
|
|
|
>value : T
|
|
|
|
>T : T
|
|
|
|
>K : K
|
2014-08-19 04:56:03 +02:00
|
|
|
>Sequence : Sequence<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>key : K
|
|
|
|
>K : K
|
|
|
|
>items : T[]
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
|
|
|
|
var s: Sequence<string>;
|
|
|
|
>s : Sequence<string>
|
2014-08-19 04:56:03 +02:00
|
|
|
>Sequence : Sequence<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var s2 = s.groupBy(s => s.length);
|
|
|
|
>s2 : Sequence<{ key: number; items: string[]; }>
|
|
|
|
>s.groupBy(s => s.length) : Sequence<{ key: number; items: string[]; }>
|
|
|
|
>s.groupBy : <K>(keySelector: (value: string) => K) => Sequence<{ key: K; items: string[]; }>
|
|
|
|
>s : Sequence<string>
|
|
|
|
>groupBy : <K>(keySelector: (value: string) => K) => Sequence<{ key: K; items: string[]; }>
|
|
|
|
>s => s.length : (s: string) => number
|
|
|
|
>s : string
|
|
|
|
>s.length : number
|
|
|
|
>s : string
|
|
|
|
>length : number
|
|
|
|
|
|
|
|
var s3 = s2.each(x => { x.key /* Type is K, should be number */ });
|
|
|
|
>s3 : void
|
|
|
|
>s2.each(x => { x.key /* Type is K, should be number */ }) : void
|
|
|
|
>s2.each : (iterator: (value: { key: number; items: string[]; }) => void) => void
|
|
|
|
>s2 : Sequence<{ key: number; items: string[]; }>
|
|
|
|
>each : (iterator: (value: { key: number; items: string[]; }) => void) => void
|
|
|
|
>x => { x.key /* Type is K, should be number */ } : (x: { key: number; items: string[]; }) => void
|
|
|
|
>x : { key: number; items: string[]; }
|
|
|
|
>x.key : number
|
|
|
|
>x : { key: number; items: string[]; }
|
|
|
|
>key : number
|
|
|
|
|