51 lines
1.1 KiB
Text
51 lines
1.1 KiB
Text
|
=== tests/cases/compiler/concatError.ts ===
|
||
|
|
||
|
var n1: number[];
|
||
|
>n1 : number[]
|
||
|
|
||
|
/*
|
||
|
interface Array<T> {
|
||
|
concat(...items: T[][]): T[]; // Note: This overload needs to be picked for arrays of arrays, even though both are applicable
|
||
|
concat(...items: T[]): T[];
|
||
|
}
|
||
|
*/
|
||
|
var fa: number[];
|
||
|
>fa : number[]
|
||
|
|
||
|
fa = fa.concat([0]);
|
||
|
>fa = fa.concat([0]) : number[]
|
||
|
>fa : number[]
|
||
|
>fa.concat([0]) : number[]
|
||
|
>fa.concat : { <U extends number[]>(...items: U[]): number[]; (...items: number[]): number[]; }
|
||
|
>fa : number[]
|
||
|
>concat : { <U extends number[]>(...items: U[]): number[]; (...items: number[]): number[]; }
|
||
|
>[0] : number[]
|
||
|
|
||
|
fa = fa.concat(0);
|
||
|
>fa = fa.concat(0) : number[]
|
||
|
>fa : number[]
|
||
|
>fa.concat(0) : number[]
|
||
|
>fa.concat : { <U extends number[]>(...items: U[]): number[]; (...items: number[]): number[]; }
|
||
|
>fa : number[]
|
||
|
>concat : { <U extends number[]>(...items: U[]): number[]; (...items: number[]): number[]; }
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/*
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
declare class C<T> {
|
||
|
public m(p1: C<C<T>>): C<T>;
|
||
|
//public p: T;
|
||
|
}
|
||
|
|
||
|
var c: C<number>;
|
||
|
var cc: C<C<number>>;
|
||
|
|
||
|
c = c.m(cc);
|
||
|
*/
|