diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index 356512ecf5848..a1b45fc6d45a6 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -10,7 +10,7 @@ interface Array { * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T | undefined; + find(predicate: (value: T, index: number, obj: this) => boolean, thisArg?: any): T | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -21,7 +21,7 @@ interface Array { * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ - findIndex(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: T, index: number, obj: this) => boolean, thisArg?: any): number; /** * Returns the this object after filling the section identified by start and end with value diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index e5eabe950a273..c23a6c45ba116 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1012,6 +1012,10 @@ interface ReadonlyArray { */ toString(): string; toLocaleString(): string; + /** + * Clone oneself. + */ + concat(): this; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. @@ -1032,12 +1036,16 @@ interface ReadonlyArray { * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. */ join(separator?: string): string; + /** + * Clone oneself. + */ + slice(start?: 0): this; /** * Returns a section of an array. * @param start The beginning of the specified portion of the array. * @param end The end of the specified portion of the array. */ - slice(start?: number, end?: number): T[]; + slice(start: number, end?: number): T[]; /** * Returns the index of the first occurrence of a value in an array. * @param searchElement The value to locate in the array. @@ -1056,61 +1064,61 @@ interface ReadonlyArray { * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; + every(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; /** * Determines whether the specified callback function returns true for any element of an array. * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; /** * Performs the specified action for each element in an array. * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void; + forEach(callbackfn: (value: T, index: number, array: this) => void, thisArg?: any): void; /** * Calls a defined callback function on each element of an array, and returns an array that contains the results. * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[]; + map(callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): U[]; /** * Returns the elements of an array that meet the condition specified in a callback function. * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[]; + filter(callbackfn: (value: T, index: number, array: this) => value is S, thisArg?: any): S[]; /** * Returns the elements of an array that meet the condition specified in a callback function. * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[]; + filter(callbackfn: (value: T, index: number, array: this) => any, thisArg?: any): this; /** * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; /** * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; readonly [n: number]: T; } @@ -1134,6 +1142,10 @@ interface Array { * Removes the last element from an array and returns it. */ pop(): T | undefined; + /** + * Clone oneself. + */ + concat(): this; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. @@ -1152,17 +1164,21 @@ interface Array { /** * Reverses the elements in an Array. */ - reverse(): T[]; + reverse(): this; /** * Removes the first element from an array and returns it. */ shift(): T | undefined; + /** + * Clone oneself. + */ + slice(start?: 0): this; /** * Returns a section of an array. * @param start The beginning of the specified portion of the array. * @param end The end of the specified portion of the array. */ - slice(start?: number, end?: number): T[]; + slice(start: number, end?: number): T[]; /** * Sorts an array. * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. @@ -1203,79 +1219,79 @@ interface Array { * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + every(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; /** * Determines whether the specified callback function returns true for any element of an array. * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; /** * Performs the specified action for each element in an array. * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + forEach(callbackfn: (value: T, index: number, array: this) => void, thisArg?: any): void; /** * Calls a defined callback function on each element of an array, and returns an array that contains the results. * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - map(this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; + map(this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U, U, U, U]; /** * Calls a defined callback function on each element of an array, and returns an array that contains the results. * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - map(this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; + map(this: [T, T, T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U, U, U]; /** * Calls a defined callback function on each element of an array, and returns an array that contains the results. * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - map(this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; + map(this: [T, T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U, U]; /** * Calls a defined callback function on each element of an array, and returns an array that contains the results. * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - map(this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; + map(this: [T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U]; /** * Calls a defined callback function on each element of an array, and returns an array that contains the results. * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + map(callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): U[]; /** * Returns the elements of an array that meet the condition specified in a callback function. * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ - filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; + filter(callbackfn: (value: T, index: number, array: this) => any, thisArg?: any): this; /** * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; /** * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; [n: number]: T; } diff --git a/tests/baselines/reference/arrayConcat2.symbols b/tests/baselines/reference/arrayConcat2.symbols index daedee6e9c831..43098d29f8937 100644 --- a/tests/baselines/reference/arrayConcat2.symbols +++ b/tests/baselines/reference/arrayConcat2.symbols @@ -3,21 +3,21 @@ var a: string[] = []; >a : Symbol(a, Decl(arrayConcat2.ts, 0, 3)) a.concat("hello", 'world'); ->a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(arrayConcat2.ts, 0, 3)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) a.concat('Hello'); ->a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(arrayConcat2.ts, 0, 3)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var b = new Array(); >b : Symbol(b, Decl(arrayConcat2.ts, 5, 3)) >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) b.concat('hello'); ->b.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(arrayConcat2.ts, 5, 3)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/arrayConcat2.types b/tests/baselines/reference/arrayConcat2.types index 7687c5ed8fe7b..80baf2a28033a 100644 --- a/tests/baselines/reference/arrayConcat2.types +++ b/tests/baselines/reference/arrayConcat2.types @@ -5,17 +5,17 @@ var a: string[] = []; a.concat("hello", 'world'); >a.concat("hello", 'world') : string[] ->a.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>a.concat : { (): string[]; (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >a : string[] ->concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>concat : { (): string[]; (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >"hello" : "hello" >'world' : "world" a.concat('Hello'); >a.concat('Hello') : string[] ->a.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>a.concat : { (): string[]; (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >a : string[] ->concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>concat : { (): string[]; (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >'Hello' : "Hello" var b = new Array(); @@ -25,8 +25,8 @@ var b = new Array(); b.concat('hello'); >b.concat('hello') : string[] ->b.concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>b.concat : { (): string[]; (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >b : string[] ->concat : { (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } +>concat : { (): string[]; (...items: string[][]): string[]; (...items: (string | string[])[]): string[]; } >'hello' : "hello" diff --git a/tests/baselines/reference/arrayConcatMap.symbols b/tests/baselines/reference/arrayConcatMap.symbols index c3df6bed5336c..011f28296d895 100644 --- a/tests/baselines/reference/arrayConcatMap.symbols +++ b/tests/baselines/reference/arrayConcatMap.symbols @@ -2,8 +2,8 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) >x : Symbol(x, Decl(arrayConcatMap.ts, 0, 3)) >[].concat([{ a: 1 }], [{ a: 2 }]) .map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->[].concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>[].concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(arrayConcatMap.ts, 0, 20)) >a : Symbol(a, Decl(arrayConcatMap.ts, 0, 32)) diff --git a/tests/baselines/reference/arrayConcatMap.types b/tests/baselines/reference/arrayConcatMap.types index 10e0a74c16db3..73257ec600647 100644 --- a/tests/baselines/reference/arrayConcatMap.types +++ b/tests/baselines/reference/arrayConcatMap.types @@ -4,9 +4,9 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }]) >[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[] >[].concat([{ a: 1 }], [{ a: 2 }]) .map : { (this: [any, any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [any, any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U, U]; (this: [any, any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U, U]; (this: [any, any], callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; } >[].concat([{ a: 1 }], [{ a: 2 }]) : any[] ->[].concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>[].concat : { (): any[]; (...items: any[][]): any[]; (...items: any[]): any[]; } >[] : undefined[] ->concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>concat : { (): any[]; (...items: any[][]): any[]; (...items: any[]): any[]; } >[{ a: 1 }] : { a: number; }[] >{ a: 1 } : { a: number; } >a : number diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt index 6f4a0ef9d6df7..c3e0858ea490c 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt @@ -1,14 +1,16 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(13,1): error TS2322: Type 'A[]' is not assignable to type 'ReadonlyArray'. Types of property 'concat' are incompatible. - Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ >(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. + Type '{ (): A[]; (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (): ReadonlyArray; >(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. Type 'A[]' is not assignable to type 'B[]'. Type 'A' is not assignable to type 'B'. Property 'b' is missing in type 'A'. tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error TS2322: Type 'C' is not assignable to type 'ReadonlyArray'. Types of property 'concat' are incompatible. - Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ >(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. - Type 'A[]' is not assignable to type 'B[]'. - Type 'A' is not assignable to type 'B'. + Type '{ (): C; (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (): ReadonlyArray; >(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. + Type 'C' is not assignable to type 'B[]'. + Types of property 'pop' are incompatible. + Type '() => A' is not assignable to type '() => B'. + Type 'A' is not assignable to type 'B'. ==== tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts (2 errors) ==== @@ -28,7 +30,7 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error T ~~~ !!! error TS2322: Type 'A[]' is not assignable to type 'ReadonlyArray'. !!! error TS2322: Types of property 'concat' are incompatible. -!!! error TS2322: Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ >(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. +!!! error TS2322: Type '{ (): A[]; (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (): ReadonlyArray; >(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. !!! error TS2322: Type 'A[]' is not assignable to type 'B[]'. !!! error TS2322: Type 'A' is not assignable to type 'B'. !!! error TS2322: Property 'b' is missing in type 'A'. @@ -40,7 +42,9 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error T ~~~ !!! error TS2322: Type 'C' is not assignable to type 'ReadonlyArray'. !!! error TS2322: Types of property 'concat' are incompatible. -!!! error TS2322: Type '{ (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ >(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. -!!! error TS2322: Type 'A[]' is not assignable to type 'B[]'. -!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Type '{ (): C; (...items: A[][]): A[]; (...items: (A | A[])[]): A[]; }' is not assignable to type '{ (): ReadonlyArray; >(...items: U[]): B[]; (...items: B[][]): B[]; (...items: (B | B[])[]): B[]; }'. +!!! error TS2322: Type 'C' is not assignable to type 'B[]'. +!!! error TS2322: Types of property 'pop' are incompatible. +!!! error TS2322: Type '() => A' is not assignable to type '() => B'. +!!! error TS2322: Type 'A' is not assignable to type 'B'. \ No newline at end of file diff --git a/tests/baselines/reference/bestChoiceType.types b/tests/baselines/reference/bestChoiceType.types index 07b61fc9f840c..27cd8ad397f2d 100644 --- a/tests/baselines/reference/bestChoiceType.types +++ b/tests/baselines/reference/bestChoiceType.types @@ -4,7 +4,7 @@ (''.match(/ /) || []).map(s => s.toLowerCase()); >(''.match(/ /) || []).map(s => s.toLowerCase()) : string[] ->(''.match(/ /) || []).map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } +>(''.match(/ /) || []).map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): U[]; } >(''.match(/ /) || []) : RegExpMatchArray >''.match(/ /) || [] : RegExpMatchArray >''.match(/ /) : RegExpMatchArray | null @@ -13,7 +13,7 @@ >match : { (regexp: string): RegExpMatchArray | null; (regexp: RegExp): RegExpMatchArray | null; } >/ / : RegExp >[] : never[] ->map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): U[]; } >s => s.toLowerCase() : (s: string) => string >s : string >s.toLowerCase() : string @@ -43,9 +43,9 @@ function f1() { let z = y.map(s => s.toLowerCase()); >z : string[] >y.map(s => s.toLowerCase()) : string[] ->y.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } +>y.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): U[]; } >y : RegExpMatchArray ->map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): U[]; } >s => s.toLowerCase() : (s: string) => string >s : string >s.toLowerCase() : string @@ -75,9 +75,9 @@ function f2() { let z = y.map(s => s.toLowerCase()); >z : string[] >y.map(s => s.toLowerCase()) : string[] ->y.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } +>y.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): U[]; } >y : RegExpMatchArray ->map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: RegExpMatchArray) => U, thisArg?: any): U[]; } >s => s.toLowerCase() : (s: string) => string >s : string >s.toLowerCase() : string diff --git a/tests/baselines/reference/concatError.symbols b/tests/baselines/reference/concatError.symbols index d4f04531fc7e2..798ae956ea597 100644 --- a/tests/baselines/reference/concatError.symbols +++ b/tests/baselines/reference/concatError.symbols @@ -14,15 +14,15 @@ var fa: number[]; fa = fa.concat([0]); >fa : Symbol(fa, Decl(concatError.ts, 8, 3)) ->fa.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >fa : Symbol(fa, Decl(concatError.ts, 8, 3)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) fa = fa.concat(0); >fa : Symbol(fa, Decl(concatError.ts, 8, 3)) ->fa.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>fa.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >fa : Symbol(fa, Decl(concatError.ts, 8, 3)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/concatError.types b/tests/baselines/reference/concatError.types index bb9a85a91b4c6..ec5043deb8541 100644 --- a/tests/baselines/reference/concatError.types +++ b/tests/baselines/reference/concatError.types @@ -16,9 +16,9 @@ fa = fa.concat([0]); >fa = fa.concat([0]) : number[] >fa : number[] >fa.concat([0]) : number[] ->fa.concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>fa.concat : { (): number[]; (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >fa : number[] ->concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>concat : { (): number[]; (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >[0] : number[] >0 : 0 @@ -26,9 +26,9 @@ fa = fa.concat(0); >fa = fa.concat(0) : number[] >fa : number[] >fa.concat(0) : number[] ->fa.concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>fa.concat : { (): number[]; (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >fa : number[] ->concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>concat : { (): number[]; (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >0 : 0 diff --git a/tests/baselines/reference/concatTuples.symbols b/tests/baselines/reference/concatTuples.symbols index a6524f3e1ff2f..aa546db74e264 100644 --- a/tests/baselines/reference/concatTuples.symbols +++ b/tests/baselines/reference/concatTuples.symbols @@ -4,7 +4,7 @@ let ijs: [number, number][] = [[1, 2]]; ijs = ijs.concat([[3, 4], [5, 6]]); >ijs : Symbol(ijs, Decl(concatTuples.ts, 0, 3)) ->ijs.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>ijs.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >ijs : Symbol(ijs, Decl(concatTuples.ts, 0, 3)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/concatTuples.types b/tests/baselines/reference/concatTuples.types index fbb3ce96a5743..98a942c85ed2d 100644 --- a/tests/baselines/reference/concatTuples.types +++ b/tests/baselines/reference/concatTuples.types @@ -10,9 +10,9 @@ ijs = ijs.concat([[3, 4], [5, 6]]); >ijs = ijs.concat([[3, 4], [5, 6]]) : [number, number][] >ijs : [number, number][] >ijs.concat([[3, 4], [5, 6]]) : [number, number][] ->ijs.concat : { (...items: [number, number][][]): [number, number][]; (...items: ([number, number] | [number, number][])[]): [number, number][]; } +>ijs.concat : { (): [number, number][]; (...items: [number, number][][]): [number, number][]; (...items: ([number, number] | [number, number][])[]): [number, number][]; } >ijs : [number, number][] ->concat : { (...items: [number, number][][]): [number, number][]; (...items: ([number, number] | [number, number][])[]): [number, number][]; } +>concat : { (): [number, number][]; (...items: [number, number][][]): [number, number][]; (...items: ([number, number] | [number, number][])[]): [number, number][]; } >[[3, 4], [5, 6]] : [number, number][] >[3, 4] : [number, number] >3 : 3 diff --git a/tests/baselines/reference/controlFlowOuterVariable.symbols b/tests/baselines/reference/controlFlowOuterVariable.symbols index 35974f28a8634..55caebed3664c 100644 --- a/tests/baselines/reference/controlFlowOuterVariable.symbols +++ b/tests/baselines/reference/controlFlowOuterVariable.symbols @@ -28,7 +28,7 @@ const helper = function(t: T[]) { helper(t.slice(1)); >helper : Symbol(helper, Decl(controlFlowOuterVariable.ts, 10, 5)) ->t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >t : Symbol(t, Decl(controlFlowOuterVariable.ts, 10, 27)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } diff --git a/tests/baselines/reference/controlFlowOuterVariable.types b/tests/baselines/reference/controlFlowOuterVariable.types index 859542e70e197..732b09a959de6 100644 --- a/tests/baselines/reference/controlFlowOuterVariable.types +++ b/tests/baselines/reference/controlFlowOuterVariable.types @@ -35,8 +35,8 @@ const helper = function(t: T[]) { >helper(t.slice(1)) : void >helper : (t: T[]) => void >t.slice(1) : T[] ->t.slice : (start?: number | undefined, end?: number | undefined) => T[] +>t.slice : { (start?: 0 | undefined): T[]; (start: number, end?: number | undefined): T[]; } >t : T[] ->slice : (start?: number | undefined, end?: number | undefined) => T[] +>slice : { (start?: 0 | undefined): T[]; (start: number, end?: number | undefined): T[]; } >1 : 1 } diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js index 5f55a8b1d22c5..86742fa520cb4 100644 --- a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.js @@ -1,8 +1,8 @@ //// [duplicateOverloadInTypeAugmentation1.ts] interface Array { - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; } var a: Array; diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols index 02589e011c4d6..b0af4ce1167e9 100644 --- a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols @@ -3,7 +3,7 @@ interface Array { >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 0)) >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, >reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) >callbackfn : Symbol(callbackfn, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 11)) >previousValue : Symbol(previousValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 24)) @@ -12,15 +12,14 @@ interface Array { >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) >currentIndex : Symbol(currentIndex, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 58)) >array : Symbol(array, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 80)) ->T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) initialValue?: T): T; ->initialValue : Symbol(initialValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 98)) +>initialValue : Symbol(initialValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 99)) >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, >reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) >U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) >callbackfn : Symbol(callbackfn, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 14)) @@ -30,11 +29,10 @@ interface Array { >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) >currentIndex : Symbol(currentIndex, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 61)) >array : Symbol(array, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 83)) ->T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) >U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) initialValue: U): U; ->initialValue : Symbol(initialValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 101)) +>initialValue : Symbol(initialValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 102)) >U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) >U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) } diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types index bc7214eb6b941..23f3e49a41cda 100644 --- a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types @@ -3,16 +3,15 @@ interface Array { >Array : T[] >T : T - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, ->reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } ->callbackfn : (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, +>reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; } +>callbackfn : (previousValue: T, currentValue: T, currentIndex: number, array: this) => T >previousValue : T >T : T >currentValue : T >T : T >currentIndex : number ->array : T[] ->T : T +>array : this >T : T initialValue?: T): T; @@ -20,17 +19,16 @@ interface Array { >T : T >T : T - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, ->reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, +>reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; } >U : U ->callbackfn : (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U +>callbackfn : (previousValue: U, currentValue: T, currentIndex: number, array: this) => U >previousValue : U >U : U >currentValue : T >T : T >currentIndex : number ->array : T[] ->T : T +>array : this >U : U initialValue: U): U; diff --git a/tests/baselines/reference/emitSkipsThisWithRestParameter.symbols b/tests/baselines/reference/emitSkipsThisWithRestParameter.symbols index 04a699a322d2c..3b54d201143e8 100644 --- a/tests/baselines/reference/emitSkipsThisWithRestParameter.symbols +++ b/tests/baselines/reference/emitSkipsThisWithRestParameter.symbols @@ -15,9 +15,9 @@ function rebase(fn: (base: any, ...args: any[]) => any): (...args: any[]) => any >fn : Symbol(fn, Decl(emitSkipsThisWithRestParameter.ts, 0, 16)) >apply : Symbol(Function.apply, Decl(lib.d.ts, --, --)) >this : Symbol(this, Decl(emitSkipsThisWithRestParameter.ts, 1, 20)) ->[ this ].concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>[ this ].concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >this : Symbol(this, Decl(emitSkipsThisWithRestParameter.ts, 1, 20)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >args : Symbol(args, Decl(emitSkipsThisWithRestParameter.ts, 1, 30)) }; diff --git a/tests/baselines/reference/emitSkipsThisWithRestParameter.types b/tests/baselines/reference/emitSkipsThisWithRestParameter.types index ff6f1e6f73a9a..9454668e1971e 100644 --- a/tests/baselines/reference/emitSkipsThisWithRestParameter.types +++ b/tests/baselines/reference/emitSkipsThisWithRestParameter.types @@ -18,10 +18,10 @@ function rebase(fn: (base: any, ...args: any[]) => any): (...args: any[]) => any >apply : (this: Function, thisArg: any, argArray?: any) => any >this : any >[ this ].concat(args) : any[] ->[ this ].concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>[ this ].concat : { (): any[]; (...items: any[][]): any[]; (...items: any[]): any[]; } >[ this ] : any[] >this : any ->concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>concat : { (): any[]; (...items: any[][]): any[]; (...items: any[]): any[]; } >args : any[] }; diff --git a/tests/baselines/reference/implementArrayInterface.errors.txt b/tests/baselines/reference/implementArrayInterface.errors.txt index 08c438ebaf362..ef19acae65ad9 100644 --- a/tests/baselines/reference/implementArrayInterface.errors.txt +++ b/tests/baselines/reference/implementArrayInterface.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/implementArrayInterface.ts(1,15): error TS2420: Class 'MyArray' incorrectly implements interface 'T[]'. Types of property 'map' are incompatible. - Type '(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]' is not assignable to type '{ (this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; (this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; (this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; }'. + Type '(callbackfn: (value: T, index: number, array: this) => U, thisArg?: any) => U[]' is not assignable to type '{ (this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U, U, U, U]; (this: [T, T, T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U, U, U]; (this: [T, T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U, U]; (this: [T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U]; (callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): U[]; }'. Type 'any[]' is not assignable to type '[any, any, any, any, any]'. - Property '0' is missing in type 'any[]'. ==== tests/cases/compiler/implementArrayInterface.ts (1 errors) ==== @@ -10,19 +9,20 @@ tests/cases/compiler/implementArrayInterface.ts(1,15): error TS2420: Class 'MyAr ~~~~~~~ !!! error TS2420: Class 'MyArray' incorrectly implements interface 'T[]'. !!! error TS2420: Types of property 'map' are incompatible. -!!! error TS2420: Type '(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[]' is not assignable to type '{ (this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [T, T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U, U]; (this: [T, T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U, U]; (this: [T, T], callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; }'. +!!! error TS2420: Type '(callbackfn: (value: T, index: number, array: this) => U, thisArg?: any) => U[]' is not assignable to type '{ (this: [T, T, T, T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U, U, U, U]; (this: [T, T, T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U, U, U]; (this: [T, T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U, U]; (this: [T, T], callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): [U, U]; (callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): U[]; }'. !!! error TS2420: Type 'any[]' is not assignable to type '[any, any, any, any, any]'. -!!! error TS2420: Property '0' is missing in type 'any[]'. toString(): string; toLocaleString(): string; + concat(): this; concat(...items: U[]): T[]; concat(...items: T[]): T[]; join(separator?: string): string; pop(): T; push(...items: T[]): number; - reverse(): T[]; + reverse(): this; shift(): T; - slice(start?: number, end?: number): T[]; + slice(start?: 0): this; + slice(start: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): this; splice(start: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; @@ -30,15 +30,15 @@ tests/cases/compiler/implementArrayInterface.ts(1,15): error TS2420: Class 'MyAr indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + every(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: T, index: number, array: this) => void, thisArg?: any): void; + map(callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): U[]; + filter(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): this; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; length: number; diff --git a/tests/baselines/reference/implementArrayInterface.js b/tests/baselines/reference/implementArrayInterface.js index 733a861071bae..552b2940e7af9 100644 --- a/tests/baselines/reference/implementArrayInterface.js +++ b/tests/baselines/reference/implementArrayInterface.js @@ -2,14 +2,16 @@ declare class MyArray implements Array { toString(): string; toLocaleString(): string; + concat(): this; concat(...items: U[]): T[]; concat(...items: T[]): T[]; join(separator?: string): string; pop(): T; push(...items: T[]): number; - reverse(): T[]; + reverse(): this; shift(): T; - slice(start?: number, end?: number): T[]; + slice(start?: 0): this; + slice(start: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): this; splice(start: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; @@ -17,15 +19,15 @@ declare class MyArray implements Array { indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + every(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: T, index: number, array: this) => void, thisArg?: any): void; + map(callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): U[]; + filter(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): this; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; length: number; diff --git a/tests/baselines/reference/iteratorSpreadInArray7.symbols b/tests/baselines/reference/iteratorSpreadInArray7.symbols index 57774bcd7ee69..971093bf8f37c 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray7.symbols @@ -3,9 +3,9 @@ var array: symbol[]; >array : Symbol(array, Decl(iteratorSpreadInArray7.ts, 0, 3)) array.concat([...new SymbolIterator]); ->array.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>array.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >array : Symbol(array, Decl(iteratorSpreadInArray7.ts, 0, 3)) ->concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray7.ts, 1, 38)) class SymbolIterator { diff --git a/tests/baselines/reference/iteratorSpreadInArray7.types b/tests/baselines/reference/iteratorSpreadInArray7.types index ef0e3898e0fa6..f9d128ea720b3 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.types +++ b/tests/baselines/reference/iteratorSpreadInArray7.types @@ -4,9 +4,9 @@ var array: symbol[]; array.concat([...new SymbolIterator]); >array.concat([...new SymbolIterator]) : symbol[] ->array.concat : { (...items: symbol[][]): symbol[]; (...items: (symbol | symbol[])[]): symbol[]; } +>array.concat : { (): symbol[]; (...items: symbol[][]): symbol[]; (...items: (symbol | symbol[])[]): symbol[]; } >array : symbol[] ->concat : { (...items: symbol[][]): symbol[]; (...items: (symbol | symbol[])[]): symbol[]; } +>concat : { (): symbol[]; (...items: symbol[][]): symbol[]; (...items: (symbol | symbol[])[]): symbol[]; } >[...new SymbolIterator] : symbol[] >...new SymbolIterator : symbol >new SymbolIterator : SymbolIterator diff --git a/tests/baselines/reference/library_ArraySlice.symbols b/tests/baselines/reference/library_ArraySlice.symbols index f29defbc3f959..de0fcec2ac617 100644 --- a/tests/baselines/reference/library_ArraySlice.symbols +++ b/tests/baselines/reference/library_ArraySlice.symbols @@ -1,23 +1,23 @@ === tests/cases/compiler/library_ArraySlice.ts === // Array.prototype.slice can have zero, one, or two arguments Array.prototype.slice(); ->Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) Array.prototype.slice(0); ->Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) Array.prototype.slice(0, 1); ->Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>Array.prototype.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/library_ArraySlice.types b/tests/baselines/reference/library_ArraySlice.types index 5fe3858628acb..d8f87b1fa460a 100644 --- a/tests/baselines/reference/library_ArraySlice.types +++ b/tests/baselines/reference/library_ArraySlice.types @@ -2,28 +2,28 @@ // Array.prototype.slice can have zero, one, or two arguments Array.prototype.slice(); >Array.prototype.slice() : any[] ->Array.prototype.slice : (start?: number, end?: number) => any[] +>Array.prototype.slice : { (start?: 0): any[]; (start: number, end?: number): any[]; } >Array.prototype : any[] >Array : ArrayConstructor >prototype : any[] ->slice : (start?: number, end?: number) => any[] +>slice : { (start?: 0): any[]; (start: number, end?: number): any[]; } Array.prototype.slice(0); >Array.prototype.slice(0) : any[] ->Array.prototype.slice : (start?: number, end?: number) => any[] +>Array.prototype.slice : { (start?: 0): any[]; (start: number, end?: number): any[]; } >Array.prototype : any[] >Array : ArrayConstructor >prototype : any[] ->slice : (start?: number, end?: number) => any[] +>slice : { (start?: 0): any[]; (start: number, end?: number): any[]; } >0 : 0 Array.prototype.slice(0, 1); >Array.prototype.slice(0, 1) : any[] ->Array.prototype.slice : (start?: number, end?: number) => any[] +>Array.prototype.slice : { (start?: 0): any[]; (start: number, end?: number): any[]; } >Array.prototype : any[] >Array : ArrayConstructor >prototype : any[] ->slice : (start?: number, end?: number) => any[] +>slice : { (start?: 0): any[]; (start: number, end?: number): any[]; } >0 : 0 >1 : 1 diff --git a/tests/baselines/reference/library_RegExpExecArraySlice.symbols b/tests/baselines/reference/library_RegExpExecArraySlice.symbols index d1ad57ff1d566..374b15723b34f 100644 --- a/tests/baselines/reference/library_RegExpExecArraySlice.symbols +++ b/tests/baselines/reference/library_RegExpExecArraySlice.symbols @@ -5,17 +5,17 @@ var regExpExecArrayValue: RegExpExecArray; >RegExpExecArray : Symbol(RegExpExecArray, Decl(lib.d.ts, --, --)) regExpExecArrayValue.slice(); ->regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) regExpExecArrayValue.slice(0); ->regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) regExpExecArrayValue.slice(0,1); ->regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>regExpExecArrayValue.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >regExpExecArrayValue : Symbol(regExpExecArrayValue, Decl(library_RegExpExecArraySlice.ts, 1, 3)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/library_RegExpExecArraySlice.types b/tests/baselines/reference/library_RegExpExecArraySlice.types index 0fd2a319833af..7d1481d420ed0 100644 --- a/tests/baselines/reference/library_RegExpExecArraySlice.types +++ b/tests/baselines/reference/library_RegExpExecArraySlice.types @@ -5,23 +5,23 @@ var regExpExecArrayValue: RegExpExecArray; >RegExpExecArray : RegExpExecArray regExpExecArrayValue.slice(); ->regExpExecArrayValue.slice() : string[] ->regExpExecArrayValue.slice : (start?: number, end?: number) => string[] +>regExpExecArrayValue.slice() : RegExpExecArray +>regExpExecArrayValue.slice : { (start?: 0): RegExpExecArray; (start: number, end?: number): string[]; } >regExpExecArrayValue : RegExpExecArray ->slice : (start?: number, end?: number) => string[] +>slice : { (start?: 0): RegExpExecArray; (start: number, end?: number): string[]; } regExpExecArrayValue.slice(0); ->regExpExecArrayValue.slice(0) : string[] ->regExpExecArrayValue.slice : (start?: number, end?: number) => string[] +>regExpExecArrayValue.slice(0) : RegExpExecArray +>regExpExecArrayValue.slice : { (start?: 0): RegExpExecArray; (start: number, end?: number): string[]; } >regExpExecArrayValue : RegExpExecArray ->slice : (start?: number, end?: number) => string[] +>slice : { (start?: 0): RegExpExecArray; (start: number, end?: number): string[]; } >0 : 0 regExpExecArrayValue.slice(0,1); >regExpExecArrayValue.slice(0,1) : string[] ->regExpExecArrayValue.slice : (start?: number, end?: number) => string[] +>regExpExecArrayValue.slice : { (start?: 0): RegExpExecArray; (start: number, end?: number): string[]; } >regExpExecArrayValue : RegExpExecArray ->slice : (start?: number, end?: number) => string[] +>slice : { (start?: 0): RegExpExecArray; (start: number, end?: number): string[]; } >0 : 0 >1 : 1 diff --git a/tests/baselines/reference/literalTypes2.symbols b/tests/baselines/reference/literalTypes2.symbols index a59a91eeb1a59..ecbd8c978c04c 100644 --- a/tests/baselines/reference/literalTypes2.symbols +++ b/tests/baselines/reference/literalTypes2.symbols @@ -573,9 +573,9 @@ function append(a: T[], x: T): T[] { let result = a.slice(); >result : Symbol(result, Decl(literalTypes2.ts, 169, 7)) ->a.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>a.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(literalTypes2.ts, 168, 19)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) result.push(x); >result.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/literalTypes2.types b/tests/baselines/reference/literalTypes2.types index 716b016f64e15..5dbb325a91e42 100644 --- a/tests/baselines/reference/literalTypes2.types +++ b/tests/baselines/reference/literalTypes2.types @@ -781,9 +781,9 @@ function append(a: T[], x: T): T[] { let result = a.slice(); >result : T[] >a.slice() : T[] ->a.slice : (start?: number, end?: number) => T[] +>a.slice : { (start?: 0): T[]; (start: number, end?: number): T[]; } >a : T[] ->slice : (start?: number, end?: number) => T[] +>slice : { (start?: 0): T[]; (start: number, end?: number): T[]; } result.push(x); >result.push(x) : number diff --git a/tests/baselines/reference/mapOnTupleTypes01.types b/tests/baselines/reference/mapOnTupleTypes01.types index 0a01ecfa3805b..33b8a60c770d6 100644 --- a/tests/baselines/reference/mapOnTupleTypes01.types +++ b/tests/baselines/reference/mapOnTupleTypes01.types @@ -26,9 +26,9 @@ let numTuple: [number] = [1]; export let a = numTuple.map(x => x * x); >a : number[] >numTuple.map(x => x * x) : number[] ->numTuple.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>numTuple.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): U[]; } >numTuple : [number] ->map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number]) => U, thisArg?: any): U[]; } >x => x * x : (x: number) => number >x : number >x * x : number @@ -58,9 +58,9 @@ let numStr: [number, string] = [ 100, "hello"]; export let b = numNum.map(n => n * n); >b : [number, number] >numNum.map(n => n * n) : [number, number] ->numNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>numNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): U[]; } >numNum : [number, number] ->map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number @@ -70,9 +70,9 @@ export let b = numNum.map(n => n * n); export let c = strStr.map(s => s.charCodeAt(0)); >c : [number, number] >strStr.map(s => s.charCodeAt(0)) : [number, number] ->strStr.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } +>strStr.map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): U[]; } >strStr : [string, string] ->map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any): U[]; } +>map : { (this: [string, string, string, string, string], callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string, string, string, string], callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): [U, U, U, U]; (this: [string, string, string], callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): [U, U, U]; (this: [string, string], callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string, index: number, array: [string, string]) => U, thisArg?: any): U[]; } >s => s.charCodeAt(0) : (s: string) => number >s : string >s.charCodeAt(0) : number @@ -84,9 +84,9 @@ export let c = strStr.map(s => s.charCodeAt(0)); export let d = numStr.map(x => x); >d : [string | number, string | number] >numStr.map(x => x) : [string | number, string | number] ->numStr.map : { (this: [string | number, string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U, U]; (this: [string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U]; (this: [string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): U[]; } +>numStr.map : { (this: [string | number, string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): [U, U, U, U]; (this: [string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): [U, U, U]; (this: [string | number, string | number], callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): U[]; } >numStr : [number, string] ->map : { (this: [string | number, string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U, U]; (this: [string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U, U]; (this: [string | number, string | number], callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string | number, index: number, array: (string | number)[]) => U, thisArg?: any): U[]; } +>map : { (this: [string | number, string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): [U, U, U, U, U]; (this: [string | number, string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): [U, U, U, U]; (this: [string | number, string | number, string | number], callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): [U, U, U]; (this: [string | number, string | number], callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): [U, U]; (callbackfn: (value: string | number, index: number, array: [number, string]) => U, thisArg?: any): U[]; } >x => x : (x: string | number) => string | number >x : string | number >x : string | number @@ -103,9 +103,9 @@ let numNumNum: [number, number, number] = [1, 2, 3]; export let e = numNumNum.map(n => n * n); >e : [number, number, number] >numNumNum.map(n => n * n) : [number, number, number] ->numNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>numNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): U[]; } >numNumNum : [number, number, number] ->map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number, number]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number @@ -125,9 +125,9 @@ let numNumNumNum: [number, number, number, number] = [1, 2, 3, 4]; export let f = numNumNumNum.map(n => n * n); >f : [number, number, number, number] >numNumNumNum.map(n => n * n) : [number, number, number, number] ->numNumNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>numNumNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): U[]; } >numNumNumNum : [number, number, number, number] ->map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number, number, number]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number @@ -148,9 +148,9 @@ let numNumNumNumNum: [number, number, number, number, number] = [1, 2, 3, 4, 5]; export let g = numNumNumNumNum.map(n => n * n); >g : [number, number, number, number, number] >numNumNumNumNum.map(n => n * n) : [number, number, number, number, number] ->numNumNumNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>numNumNumNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): U[]; } >numNumNumNumNum : [number, number, number, number, number] ->map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number @@ -173,9 +173,9 @@ let numNumNumNumNumNum: [number, number, number, number, number, number] = [1, 2 export let h = numNumNumNumNum.map(n => n * n); >h : [number, number, number, number, number] >numNumNumNumNum.map(n => n * n) : [number, number, number, number, number] ->numNumNumNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>numNumNumNumNum.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): U[]; } >numNumNumNumNum : [number, number, number, number, number] ->map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number, number, number, number]) => U, thisArg?: any): U[]; } >n => n * n : (n: number) => number >n : number >n * n : number diff --git a/tests/baselines/reference/mapOnTupleTypes02.types b/tests/baselines/reference/mapOnTupleTypes02.types index 3803e3c319e1d..026e451484865 100644 --- a/tests/baselines/reference/mapOnTupleTypes02.types +++ b/tests/baselines/reference/mapOnTupleTypes02.types @@ -10,9 +10,9 @@ export function increment(point: Point) { return point.map(d => d + 1); >point.map(d => d + 1) : [number, number] ->point.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>point.map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): U[]; } >point : [number, number] ->map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; } +>map : { (this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U, U, U]; (this: [number, number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U, U]; (this: [number, number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U, U]; (this: [number, number], callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): [U, U]; (callbackfn: (value: number, index: number, array: [number, number]) => U, thisArg?: any): U[]; } >d => d + 1 : (d: number) => number >d : number >d + 1 : number diff --git a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.symbols b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.symbols index f217f42a8d6fb..cae122f84bd7a 100644 --- a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.symbols +++ b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.symbols @@ -36,9 +36,9 @@ class ListWrapper2 { >array : Symbol(array, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 12, 43)) >T : Symbol(T, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 12, 15)) >T : Symbol(T, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 12, 15)) ->array.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>array.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >array : Symbol(array, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 12, 43)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) static reversed(dit: typeof ListWrapper2, array: T[]): T[] { >reversed : Symbol(ListWrapper2.reversed, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 12, 87)) @@ -155,9 +155,9 @@ class ListWrapper { >array : Symbol(array, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 44, 42)) >T : Symbol(T, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 44, 15)) >T : Symbol(T, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 44, 15)) ->array.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>array.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >array : Symbol(array, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 44, 42)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) static forEachWithIndex(dit: typeof ListWrapper, array: T[], fn: (t: T, n: number) => void) { >forEachWithIndex : Symbol(ListWrapper.forEachWithIndex, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 44, 86)) @@ -300,9 +300,9 @@ class ListWrapper { >ListWrapper : Symbol(ListWrapper, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 38, 1)) >a : Symbol(a, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 68, 40)) >b : Symbol(b, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 68, 50)) ->a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 68, 40)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 68, 50)) static insert(dit: typeof ListWrapper, list: T[], index: number, value: T) { list.splice(index, 0, value); } @@ -490,9 +490,9 @@ class ListWrapper { >T : Symbol(T, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 101, 15)) return l.slice(from, to === null ? undefined : to); ->l.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>l.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >l : Symbol(l, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 101, 42)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >from : Symbol(from, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 101, 50)) >to : Symbol(to, Decl(staticAnonymousTypeNotReferencingTypeParameter.ts, 101, 68)) >undefined : Symbol(undefined) diff --git a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types index 127a8d930c59b..e61ad6d6e5044 100644 --- a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types +++ b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types @@ -39,9 +39,9 @@ class ListWrapper2 { >T : T >T : T >array.slice(0) : T[] ->array.slice : (start?: number, end?: number) => T[] +>array.slice : { (start?: 0): T[]; (start: number, end?: number): T[]; } >array : T[] ->slice : (start?: number, end?: number) => T[] +>slice : { (start?: 0): T[]; (start: number, end?: number): T[]; } >0 : 0 static reversed(dit: typeof ListWrapper2, array: T[]): T[] { @@ -168,9 +168,9 @@ class ListWrapper { >T : T >T : T >array.slice(0) : T[] ->array.slice : (start?: number, end?: number) => T[] +>array.slice : { (start?: 0): T[]; (start: number, end?: number): T[]; } >array : T[] ->slice : (start?: number, end?: number) => T[] +>slice : { (start?: 0): T[]; (start: number, end?: number): T[]; } >0 : 0 static forEachWithIndex(dit: typeof ListWrapper, array: T[], fn: (t: T, n: number) => void) { @@ -348,9 +348,9 @@ class ListWrapper { >a : any[] >b : any[] >a.concat(b) : any[] ->a.concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>a.concat : { (): any[]; (...items: any[][]): any[]; (...items: any[]): any[]; } >a : any[] ->concat : { (...items: any[][]): any[]; (...items: any[]): any[]; } +>concat : { (): any[]; (...items: any[][]): any[]; (...items: any[]): any[]; } >b : any[] static insert(dit: typeof ListWrapper, list: T[], index: number, value: T) { list.splice(index, 0, value); } @@ -581,9 +581,9 @@ class ListWrapper { return l.slice(from, to === null ? undefined : to); >l.slice(from, to === null ? undefined : to) : T[] ->l.slice : (start?: number, end?: number) => T[] +>l.slice : { (start?: 0): T[]; (start: number, end?: number): T[]; } >l : T[] ->slice : (start?: number, end?: number) => T[] +>slice : { (start?: 0): T[]; (start: number, end?: number): T[]; } >from : number >to === null ? undefined : to : number >to === null : boolean diff --git a/tests/baselines/reference/thisTypeInTuples.symbols b/tests/baselines/reference/thisTypeInTuples.symbols index 44f8660f6916a..58d5a6dfef0c8 100644 --- a/tests/baselines/reference/thisTypeInTuples.symbols +++ b/tests/baselines/reference/thisTypeInTuples.symbols @@ -4,7 +4,7 @@ interface Array { >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 16)) slice(): this; ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) } let t: [number, string] = [42, "hello"]; @@ -12,19 +12,19 @@ let t: [number, string] = [42, "hello"]; let a = t.slice(); >a : Symbol(a, Decl(thisTypeInTuples.ts, 5, 3)) ->t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) +>t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) >t : Symbol(t, Decl(thisTypeInTuples.ts, 4, 3)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) let b = t.slice(1); >b : Symbol(b, Decl(thisTypeInTuples.ts, 6, 3)) ->t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) +>t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) >t : Symbol(t, Decl(thisTypeInTuples.ts, 4, 3)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) let c = t.slice(0, 1); >c : Symbol(c, Decl(thisTypeInTuples.ts, 7, 3)) ->t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) +>t.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) >t : Symbol(t, Decl(thisTypeInTuples.ts, 4, 3)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) +>slice : Symbol(Array.slice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(thisTypeInTuples.ts, 0, 20)) diff --git a/tests/baselines/reference/thisTypeInTuples.types b/tests/baselines/reference/thisTypeInTuples.types index 3b6f995840ec6..06d0efa7ab0ee 100644 --- a/tests/baselines/reference/thisTypeInTuples.types +++ b/tests/baselines/reference/thisTypeInTuples.types @@ -4,7 +4,7 @@ interface Array { >T : T slice(): this; ->slice : { (start?: number, end?: number): T[]; (): this; } +>slice : { (start?: 0): this; (start: number, end?: number): T[]; (): this; } } let t: [number, string] = [42, "hello"]; @@ -16,24 +16,24 @@ let t: [number, string] = [42, "hello"]; let a = t.slice(); >a : [number, string] >t.slice() : [number, string] ->t.slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } +>t.slice : { (start?: 0): [number, string]; (start: number, end?: number): (string | number)[]; (): [number, string]; } >t : [number, string] ->slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } +>slice : { (start?: 0): [number, string]; (start: number, end?: number): (string | number)[]; (): [number, string]; } let b = t.slice(1); >b : (string | number)[] >t.slice(1) : (string | number)[] ->t.slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } +>t.slice : { (start?: 0): [number, string]; (start: number, end?: number): (string | number)[]; (): [number, string]; } >t : [number, string] ->slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } +>slice : { (start?: 0): [number, string]; (start: number, end?: number): (string | number)[]; (): [number, string]; } >1 : 1 let c = t.slice(0, 1); >c : (string | number)[] >t.slice(0, 1) : (string | number)[] ->t.slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } +>t.slice : { (start?: 0): [number, string]; (start: number, end?: number): (string | number)[]; (): [number, string]; } >t : [number, string] ->slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } +>slice : { (start?: 0): [number, string]; (start: number, end?: number): (string | number)[]; (): [number, string]; } >0 : 0 >1 : 1 diff --git a/tests/baselines/reference/underscoreTest1.symbols b/tests/baselines/reference/underscoreTest1.symbols index 89815bd2371a6..7f3252959867c 100644 --- a/tests/baselines/reference/underscoreTest1.symbols +++ b/tests/baselines/reference/underscoreTest1.symbols @@ -71,9 +71,9 @@ var flat = _.reduceRight(list, (a, b) => a.concat(b), []); >list : Symbol(list, Decl(underscoreTest1_underscoreTests.ts, 13, 3)) >a : Symbol(a, Decl(underscoreTest1_underscoreTests.ts, 14, 32)) >b : Symbol(b, Decl(underscoreTest1_underscoreTests.ts, 14, 34)) ->a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>a.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(underscoreTest1_underscoreTests.ts, 14, 32)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(underscoreTest1_underscoreTests.ts, 14, 34)) var even = _.find([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index 97e064fb12c45..bb267053a150c 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -124,9 +124,9 @@ var flat = _.reduceRight(list, (a, b) => a.concat(b), []); >a : number[] >b : number[] >a.concat(b) : number[] ->a.concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>a.concat : { (): number[]; (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >a : number[] ->concat : { (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } +>concat : { (): number[]; (...items: number[][]): number[]; (...items: (number | number[])[]): number[]; } >b : number[] >[] : undefined[] diff --git a/tests/cases/compiler/duplicateOverloadInTypeAugmentation1.ts b/tests/cases/compiler/duplicateOverloadInTypeAugmentation1.ts index 2c4967a10a395..ce4198c0959ef 100644 --- a/tests/cases/compiler/duplicateOverloadInTypeAugmentation1.ts +++ b/tests/cases/compiler/duplicateOverloadInTypeAugmentation1.ts @@ -1,7 +1,7 @@ interface Array { - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; } var a: Array; diff --git a/tests/cases/compiler/implementArrayInterface.ts b/tests/cases/compiler/implementArrayInterface.ts index 79ba68bdc4279..ba34546e9a1b2 100644 --- a/tests/cases/compiler/implementArrayInterface.ts +++ b/tests/cases/compiler/implementArrayInterface.ts @@ -1,14 +1,16 @@ declare class MyArray implements Array { toString(): string; toLocaleString(): string; + concat(): this; concat(...items: U[]): T[]; concat(...items: T[]): T[]; join(separator?: string): string; pop(): T; push(...items: T[]): number; - reverse(): T[]; + reverse(): this; shift(): T; - slice(start?: number, end?: number): T[]; + slice(start?: 0): this; + slice(start: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): this; splice(start: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; @@ -16,15 +18,15 @@ declare class MyArray implements Array { indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + every(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; + some(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): boolean; + forEach(callbackfn: (value: T, index: number, array: this) => void, thisArg?: any): void; + map(callbackfn: (value: T, index: number, array: this) => U, thisArg?: any): U[]; + filter(callbackfn: (value: T, index: number, array: this) => boolean, thisArg?: any): this; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: this) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: this) => U, initialValue: U): U; length: number;