2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/arrayAugment.ts ===
|
|
|
|
interface Array<T> {
|
2015-04-13 23:01:57 +02:00
|
|
|
>Array : T[], Symbol(Array, Decl(lib.d.ts, 1000, 23), Decl(lib.d.ts, 1171, 11), Decl(arrayAugment.ts, 0, 0))
|
|
|
|
>T : T, Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(arrayAugment.ts, 0, 16))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
split: (parts: number) => T[][];
|
2015-04-13 23:01:57 +02:00
|
|
|
>split : (parts: number) => T[][], Symbol(split, Decl(arrayAugment.ts, 0, 20))
|
|
|
|
>parts : number, Symbol(parts, Decl(arrayAugment.ts, 1, 12))
|
|
|
|
>T : T, Symbol(T, Decl(lib.d.ts, 1007, 16), Decl(arrayAugment.ts, 0, 16))
|
2014-08-15 23:33:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var x = [''];
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : string[], Symbol(x, Decl(arrayAugment.ts, 4, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>[''] : string[]
|
2015-04-13 21:36:11 +02:00
|
|
|
>'' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var y = x.split(4);
|
2015-04-13 23:01:57 +02:00
|
|
|
>y : string[][], Symbol(y, Decl(arrayAugment.ts, 5, 3), Decl(arrayAugment.ts, 6, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>x.split(4) : string[][]
|
2015-04-13 23:01:57 +02:00
|
|
|
>x.split : (parts: number) => string[][], Symbol(Array.split, Decl(arrayAugment.ts, 0, 20))
|
|
|
|
>x : string[], Symbol(x, Decl(arrayAugment.ts, 4, 3))
|
|
|
|
>split : (parts: number) => string[][], Symbol(Array.split, Decl(arrayAugment.ts, 0, 20))
|
2015-04-13 21:36:11 +02:00
|
|
|
>4 : number
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var y: string[][]; // Expect no error here
|
2015-04-13 23:01:57 +02:00
|
|
|
>y : string[][], Symbol(y, Decl(arrayAugment.ts, 5, 3), Decl(arrayAugment.ts, 6, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|