39 lines
1.2 KiB
Text
39 lines
1.2 KiB
Text
=== tests/cases/conformance/types/thisType/thisTypeInTuples.ts ===
|
|
interface Array<T> {
|
|
>Array : T[]
|
|
>T : T
|
|
|
|
slice(): this;
|
|
>slice : { (start?: number, end?: number): T[]; (): this; }
|
|
}
|
|
|
|
let t: [number, string] = [42, "hello"];
|
|
>t : [number, string]
|
|
>[42, "hello"] : [number, string]
|
|
>42 : number
|
|
>"hello" : string
|
|
|
|
let a = t.slice();
|
|
>a : [number, string]
|
|
>t.slice() : [number, string]
|
|
>t.slice : { (start?: number, end?: number): (number | string)[]; (): [number, string]; }
|
|
>t : [number, string]
|
|
>slice : { (start?: number, end?: number): (number | string)[]; (): [number, string]; }
|
|
|
|
let b = t.slice(1);
|
|
>b : (number | string)[]
|
|
>t.slice(1) : (number | string)[]
|
|
>t.slice : { (start?: number, end?: number): (number | string)[]; (): [number, string]; }
|
|
>t : [number, string]
|
|
>slice : { (start?: number, end?: number): (number | string)[]; (): [number, string]; }
|
|
>1 : number
|
|
|
|
let c = t.slice(0, 1);
|
|
>c : (number | string)[]
|
|
>t.slice(0, 1) : (number | string)[]
|
|
>t.slice : { (start?: number, end?: number): (number | string)[]; (): [number, string]; }
|
|
>t : [number, string]
|
|
>slice : { (start?: number, end?: number): (number | string)[]; (): [number, string]; }
|
|
>0 : number
|
|
>1 : number
|
|
|