diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index f3eb069e6f647..bbbcebd7529e7 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -1189,9 +1189,12 @@ export namespace Completion { interfaceEntry("Promise"), typeEntry("Awaited"), interfaceEntry("ArrayLike"), + interfaceEntry("ArrayLikeOrIterableTypes"), + typeEntry("ArrayLikeOrIterable"), typeEntry("Partial"), typeEntry("Required"), typeEntry("Readonly"), + typeEntry("Writable"), typeEntry("Pick"), typeEntry("Record"), typeEntry("Exclude"), diff --git a/src/lib/es2015.collection.d.ts b/src/lib/es2015.collection.d.ts index 9e27045a5592a..fd4a752cd57e9 100644 --- a/src/lib/es2015.collection.d.ts +++ b/src/lib/es2015.collection.d.ts @@ -64,7 +64,7 @@ interface WeakMap { } interface WeakMapConstructor { - new (entries?: readonly [K, V][] | null): WeakMap; + new (entries?: readonly (readonly [K, V])[] | null): WeakMap; readonly prototype: WeakMap; } declare var WeakMap: WeakMapConstructor; diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index 3b1c76c5afc3c..320b4f2edeb78 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -8,8 +8,18 @@ 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: T[]) => value is S, thisArg?: any): S | undefined; - find(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined; + find(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S | undefined; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @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, array: T[]) => unknown, thisArg?: any): T | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -20,50 +30,50 @@ 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: T[]) => unknown, thisArg?: any): number; + findIndex(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): number; /** * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: T, start?: number, end?: number): this; + fill(value: T, start?: number, end?: number): T[]; /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): T[]; } interface ArrayConstructor { /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. + * Creates an array from an array-like or iterable object. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): T[]; + from(source: ArrayLikeOrIterable): T[]; /** - * Creates an array from an iterable object. - * @param arrayLike An array-like object to convert to an array. + * Creates an array from an array-like or iterable object. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; /** * Returns a new array from a set of elements. * @param items A set of elements to include in the new array object. */ - of(...items: T[]): T[]; + of(...items: T): T; } interface DateConstructor { @@ -194,7 +204,7 @@ interface NumberConstructor { /** * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10‍−‍16. + * 2.2204460492503130808472633361816E−‍16 (2^-52). */ readonly EPSILON: number; @@ -229,14 +239,14 @@ interface NumberConstructor { /** * The value of the largest integer n such that n and n + 1 are both exactly representable as * a Number value. - * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1. + * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 (2^53 − 1). */ readonly MAX_SAFE_INTEGER: number; /** * The value of the smallest integer n such that n and n − 1 are both exactly representable as * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−2^53 + 1). */ readonly MIN_SAFE_INTEGER: number; @@ -257,13 +267,20 @@ interface NumberConstructor { } interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + */ + assign(target: T): T; + /** * Copy the values of all of the enumerable own properties from one or more source objects to a * target object. Returns the target object. * @param target The target object to copy to. * @param source The source object from which to copy properties. */ - assign(target: T, source: U): T & U; + assign(target: T, source: U): T & Writable; /** * Copy the values of all of the enumerable own properties from one or more source objects to a @@ -272,7 +289,7 @@ interface ObjectConstructor { * @param source1 The first source object from which to copy properties. * @param source2 The second source object from which to copy properties. */ - assign(target: T, source1: U, source2: V): T & U & V; + assign(target: T, source1: U, source2: V): T & Writable & Writable; /** * Copy the values of all of the enumerable own properties from one or more source objects to a @@ -282,21 +299,21 @@ interface ObjectConstructor { * @param source2 The second source object from which to copy properties. * @param source3 The third source object from which to copy properties. */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + assign(target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; /** * Copy the values of all of the enumerable own properties from one or more source objects to a * target object. Returns the target object. * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties + * @param sources One or more source objects from which to copy properties. */ - assign(target: object, ...sources: any[]): any; + assign(target: {}, ...sources: any[]): any; /** * Returns an array of all symbol properties found directly on object o. * @param o Object to retrieve the symbols from. */ - getOwnPropertySymbols(o: any): symbol[]; + getOwnPropertySymbols(o: {}): symbol[]; /** * Returns the names of the enumerable string properties and methods of an object. @@ -316,7 +333,7 @@ interface ObjectConstructor { * @param o The object to change its prototype. * @param proto The value of the new prototype or null. */ - setPrototypeOf(o: any, proto: object | null): any; + setPrototypeOf(o: {}, proto: object | null): any; } interface ReadonlyArray { @@ -329,8 +346,18 @@ interface ReadonlyArray { * @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: readonly T[]) => value is S, thisArg?: any): S | undefined; - find(predicate: (value: T, index: number, obj: readonly T[]) => unknown, thisArg?: any): T | undefined; + find(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S | undefined; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @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, array: readonly T[]) => unknown, thisArg?: any): T | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -341,7 +368,7 @@ interface ReadonlyArray { * @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: readonly T[]) => unknown, thisArg?: any): number; + findIndex(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): number; } interface RegExp { @@ -379,11 +406,11 @@ interface RegExpConstructor { interface String { /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + * Returns a non-negative integer less than 1114112 (0x110000) that is the code point value + * starting at the string element at the specified position. + * @param pos The zero-based index of the desired code point. If there is no character at the + * specified index, undefined is returned. If a UTF-16 surrogate pair does not begin at pos, + * the result is the code unit at pos. */ codePointAt(pos: number): number | undefined; @@ -397,46 +424,38 @@ interface String { includes(searchString: string, position?: number): boolean; /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. + * Determines whether the string ends with a substring, ending at the specified index. + * @param searchString The string to search for. + * @param endPosition The index at which to begin searching for. The default value is the + * length of searchString. */ endsWith(searchString: string, endPosition?: number): boolean; /** * Returns the String value result of normalizing the string into the normalization form * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" - */ - normalize(form: "NFC" | "NFD" | "NFKC" | "NFKD"): string; - - /** - * Returns the String value result of normalizing the string into the normalization form - * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms. - * @param form Applicable values: "NFC", "NFD", "NFKC", or "NFKD", If not specified default - * is "NFC" + * @param form The normalization form to be used. The default value is "NFC". */ - normalize(form?: string): string; + normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD"): string; /** * Returns a String value that is made from count copies appended together. If count is 0, * the empty string is returned. - * @param count number of copies to append + * @param count The number of copies to append */ repeat(count: number): string; /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. + * Determines whether the string starts with a substring, beginning at the specified index. + * @param searchString The string to search for. + * @param position The index at which to begin searching for. The default value is 0. */ startsWith(searchString: string, position?: number): boolean; /** - * Returns an `` HTML anchor element and sets the name attribute to the text value + * Returns an `` HTML anchor element and sets the name attribute value * @deprecated A legacy feature for browser compatibility - * @param name + * @param name The name attribute value */ anchor(name: string): string; @@ -467,20 +486,16 @@ interface String { /** * Returns a `` HTML element and sets the color attribute value * @deprecated A legacy feature for browser compatibility + * @param color The color attribute value */ fontcolor(color: string): string; /** * Returns a `` HTML element and sets the size attribute value * @deprecated A legacy feature for browser compatibility + * @param size The size attribute value */ - fontsize(size: number): string; - - /** - * Returns a `` HTML element and sets the size attribute value - * @deprecated A legacy feature for browser compatibility - */ - fontsize(size: string): string; + fontsize(size: number | string): string; /** * Returns an `` HTML element @@ -491,6 +506,7 @@ interface String { /** * Returns an `` HTML element and sets the href attribute value * @deprecated A legacy feature for browser compatibility + * @param url The href attribute value */ link(url: string): string; @@ -521,8 +537,9 @@ interface String { interface StringConstructor { /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. + * Returns a string created by a sequence of code points. + * If no arguments are given, the empty string is returned. + * @param codePoints A sequence of code points. */ fromCodePoint(...codePoints: number[]): string; @@ -535,5 +552,5 @@ interface StringConstructor { * @param template A well-formed template string call site representation. * @param substitutions A set of substitution values. */ - raw(template: { raw: readonly string[] | ArrayLike}, ...substitutions: any[]): string; + raw(template: { raw: readonly string[] | ArrayLike }, ...substitutions: any[]): string; } diff --git a/src/lib/es2015.iterable.d.ts b/src/lib/es2015.iterable.d.ts index f1fb454f980b1..6dc2cfc0fa822 100644 --- a/src/lib/es2015.iterable.d.ts +++ b/src/lib/es2015.iterable.d.ts @@ -35,6 +35,10 @@ interface IterableIterator extends Iterator { [Symbol.iterator](): IterableIterator; } +interface ArrayLikeOrIterableTypes { + iterable: Iterable; +} + interface Array { /** Iterator */ [Symbol.iterator](): IterableIterator; @@ -55,22 +59,6 @@ interface Array { values(): IterableIterator; } -interface ArrayConstructor { - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable | ArrayLike): T[]; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; -} - interface ReadonlyArray { /** Iterator of values in the array. */ [Symbol.iterator](): IterableIterator; @@ -151,7 +139,7 @@ interface Set { /** Iterates over values in the set. */ [Symbol.iterator](): IterableIterator; /** - * Returns an iterable of [v,v] pairs for every value `v` in the set. + * Returns an iterable of [v, v] pairs for every value `v` in the set. */ entries(): IterableIterator<[T, T]>; /** @@ -170,7 +158,7 @@ interface ReadonlySet { [Symbol.iterator](): IterableIterator; /** - * Returns an iterable of [v,v] pairs for every value `v` in the set. + * Returns an iterable of [v, v] pairs for every value `v` in the set. */ entries(): IterableIterator<[T, T]>; @@ -223,256 +211,147 @@ interface String { interface Int8Array { [Symbol.iterator](): IterableIterator; /** - * Returns an array of key, value pairs for every entry in the array + * Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, number]>; /** - * Returns an list of keys in the array + * Yields each index in the array. */ keys(): IterableIterator; /** - * Returns an list of values in the array + * Yields each value in the array. */ values(): IterableIterator; } -interface Int8ArrayConstructor { - new (elements: Iterable): Int8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; -} - interface Uint8Array { [Symbol.iterator](): IterableIterator; /** - * Returns an array of key, value pairs for every entry in the array + * Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, number]>; /** - * Returns an list of keys in the array + * Yields each index in the array. */ keys(): IterableIterator; /** - * Returns an list of values in the array + * Yields each value in the array. */ values(): IterableIterator; } -interface Uint8ArrayConstructor { - new (elements: Iterable): Uint8Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; -} - interface Uint8ClampedArray { [Symbol.iterator](): IterableIterator; /** - * Returns an array of key, value pairs for every entry in the array + * Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, number]>; /** - * Returns an list of keys in the array + * Yields each index in the array. */ keys(): IterableIterator; /** - * Returns an list of values in the array + * Yields each value in the array. */ values(): IterableIterator; } -interface Uint8ClampedArrayConstructor { - new (elements: Iterable): Uint8ClampedArray; - - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; -} - interface Int16Array { [Symbol.iterator](): IterableIterator; /** - * Returns an array of key, value pairs for every entry in the array + * Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, number]>; /** - * Returns an list of keys in the array + * Yields each index in the array. */ keys(): IterableIterator; /** - * Returns an list of values in the array + * Yields each value in the array. */ values(): IterableIterator; } -interface Int16ArrayConstructor { - new (elements: Iterable): Int16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; -} - interface Uint16Array { [Symbol.iterator](): IterableIterator; /** - * Returns an array of key, value pairs for every entry in the array + * Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, number]>; /** - * Returns an list of keys in the array + * Yields each index in the array. */ keys(): IterableIterator; /** - * Returns an list of values in the array + * Yields each value in the array. */ values(): IterableIterator; } -interface Uint16ArrayConstructor { - new (elements: Iterable): Uint16Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; -} - interface Int32Array { [Symbol.iterator](): IterableIterator; /** - * Returns an array of key, value pairs for every entry in the array + * Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, number]>; /** - * Returns an list of keys in the array + * Yields each index in the array. */ keys(): IterableIterator; /** - * Returns an list of values in the array + * Yields each value in the array. */ values(): IterableIterator; } -interface Int32ArrayConstructor { - new (elements: Iterable): Int32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; -} - interface Uint32Array { [Symbol.iterator](): IterableIterator; /** - * Returns an array of key, value pairs for every entry in the array + * Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, number]>; /** - * Returns an list of keys in the array + * Yields each index in the array. */ keys(): IterableIterator; /** - * Returns an list of values in the array + * Yields each value in the array. */ values(): IterableIterator; } -interface Uint32ArrayConstructor { - new (elements: Iterable): Uint32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; -} - interface Float32Array { [Symbol.iterator](): IterableIterator; /** - * Returns an array of key, value pairs for every entry in the array + * Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, number]>; /** - * Returns an list of keys in the array + * Yields each index in the array. */ keys(): IterableIterator; /** - * Returns an list of values in the array + * Yields each value in the array. */ values(): IterableIterator; } -interface Float32ArrayConstructor { - new (elements: Iterable): Float32Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; -} - interface Float64Array { [Symbol.iterator](): IterableIterator; /** - * Returns an array of key, value pairs for every entry in the array + * Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, number]>; /** - * Returns an list of keys in the array + * Yields each index in the array. */ keys(): IterableIterator; /** - * Returns an list of values in the array + * Yields each value in the array. */ values(): IterableIterator; } - -interface Float64ArrayConstructor { - new (elements: Iterable): Float64Array; - - /** - * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; -} diff --git a/src/lib/es2015.symbol.wellknown.d.ts b/src/lib/es2015.symbol.wellknown.d.ts index f27dc68850016..d4d9037a3ccac 100644 --- a/src/lib/es2015.symbol.wellknown.d.ts +++ b/src/lib/es2015.symbol.wellknown.d.ts @@ -219,22 +219,24 @@ interface String { match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null; /** - * Passes a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. This method is expected to implement its own replacement algorithm. + * Passes a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. * @param searchValue An object that supports searching for and replacing matches within a string. + * This object is expected to implement its own replacement algorithm. * @param replaceValue The replacement text. */ replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; - /** - * Replaces text in a string, using an object that supports replacement within a string. - * @param searchValue A object can search for and replace matches within a string. - * @param replacer A function that returns the replacement text. - */ + /** + * Passes a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. + * @param searchValue An object that supports searching for and replacing matches within a string. + * This object is expected to implement its own replacement algorithm. + * @param replacer A function that returns the replacement text. + */ replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; /** * Finds the first substring match in a regular expression search. - * @param searcher An object which supports searching within a string. + * @param searcher An object that supports searching within a string. */ search(searcher: { [Symbol.search](string: string): number; }): number; diff --git a/src/lib/es2017.object.d.ts b/src/lib/es2017.object.d.ts index b3ace85bef182..3e5dcc95629fe 100644 --- a/src/lib/es2017.object.d.ts +++ b/src/lib/es2017.object.d.ts @@ -27,5 +27,5 @@ interface ObjectConstructor { * Returns an object containing all own property descriptors of an object * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - getOwnPropertyDescriptors(o: T): {[P in keyof T]: TypedPropertyDescriptor} & { [x: string]: PropertyDescriptor }; + getOwnPropertyDescriptors(o: T): { [P in keyof T]: TypedPropertyDescriptor } & PropertyDescriptorMap; } diff --git a/src/lib/es2019.array.d.ts b/src/lib/es2019.array.d.ts index 5181677c5f973..e507301c6cb4a 100644 --- a/src/lib/es2019.array.d.ts +++ b/src/lib/es2019.array.d.ts @@ -6,7 +6,6 @@ type FlatArray = { }[Depth extends -1 ? "done" : "recur"]; interface ReadonlyArray { - /** * Calls a defined callback function on each element of an array. Then, flattens the result into * a new array. @@ -17,11 +16,7 @@ interface ReadonlyArray { * @param thisArg An object to which the this keyword can refer in the callback function. If * thisArg is omitted, undefined is used as the this value. */ - flatMap ( - callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray, - thisArg?: This - ): U[] - + flatMap(callback: (value: T, index: number, array: T[]) => U | ReadonlyArray, thisArg?: any): U[] /** * Returns a new array with all sub-array elements concatenated into it recursively up to the @@ -29,14 +24,10 @@ interface ReadonlyArray { * * @param depth The maximum recursion depth */ - flat( - this: A, - depth?: D - ): FlatArray[] + flat(this: A, depth?: D): FlatArray[] } interface Array { - /** * Calls a defined callback function on each element of an array. Then, flattens the result into * a new array. @@ -47,10 +38,7 @@ interface Array { * @param thisArg An object to which the this keyword can refer in the callback function. If * thisArg is omitted, undefined is used as the this value. */ - flatMap ( - callback: (this: This, value: T, index: number, array: T[]) => U | ReadonlyArray, - thisArg?: This - ): U[] + flatMap(callback: (value: T, index: number, array: T[]) => U | ReadonlyArray, thisArg?: any): U[] /** * Returns a new array with all sub-array elements concatenated into it recursively up to the @@ -58,8 +46,5 @@ interface Array { * * @param depth The maximum recursion depth */ - flat( - this: A, - depth?: D - ): FlatArray[] + flat(this: A, depth?: D): FlatArray[] } diff --git a/src/lib/es2019.object.d.ts b/src/lib/es2019.object.d.ts index e3518b7b9d689..7efcb4b861f13 100644 --- a/src/lib/es2019.object.d.ts +++ b/src/lib/es2019.object.d.ts @@ -5,7 +5,7 @@ interface ObjectConstructor { * Returns an object created by key-value entries for properties and methods * @param entries An iterable object that contains key-value entries for properties and methods. */ - fromEntries(entries: Iterable): { [k: string]: T }; + fromEntries(entries: Iterable): { [k: PropertyKey]: T }; /** * Returns an object created by key-value entries for properties and methods diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index e13da87bc71c7..84f8ae5a845f8 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -144,13 +144,13 @@ interface BigInt64Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): BigInt64Array; /** Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, bigint]>; @@ -163,17 +163,17 @@ interface BigInt64Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - every(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean; + every(predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any): boolean; /** * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: bigint, start?: number, end?: number): this; + fill(value: bigint, start?: number, end?: number): BigInt64Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -182,7 +182,7 @@ interface BigInt64Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: bigint, index: number, array: BigInt64Array) => any, thisArg?: any): BigInt64Array; + filter(predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any): BigInt64Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -193,7 +193,7 @@ interface BigInt64Array { * @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: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): bigint | undefined; + find(predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any): bigint | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -204,7 +204,7 @@ interface BigInt64Array { * @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: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -271,7 +271,7 @@ interface BigInt64Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint; + reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint, initialValue?: bigint): bigint; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -295,7 +295,7 @@ interface BigInt64Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint): bigint; + reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigInt64Array) => bigint, initialValue?: bigint): bigint; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -310,7 +310,7 @@ interface BigInt64Array { reduceRight(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigInt64Array) => U, initialValue: U): U; /** Reverses the elements in the array. */ - reverse(): this; + reverse(): BigInt64Array; /** * Sets a value or an array of values. @@ -334,13 +334,13 @@ interface BigInt64Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - some(predicate: (value: bigint, index: number, array: BigInt64Array) => boolean, thisArg?: any): boolean; + some(predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any): boolean; /** * Sorts the array. * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order. */ - sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this; + sort(compareFn?: (a: bigint, b: bigint) => number | bigint): BigInt64Array; /** * Gets a new BigInt64Array view of the ArrayBuffer store for this array, referencing the elements @@ -350,13 +350,13 @@ interface BigInt64Array { */ subarray(begin?: number, end?: number): BigInt64Array; - /** Converts the array to a string by using the current locale. */ + /** Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** Returns the primitive value of the array. */ valueOf(): BigInt64Array; /** Yields each value in the array. */ @@ -372,8 +372,8 @@ interface BigInt64Array { interface BigInt64ArrayConstructor { readonly prototype: BigInt64Array; new(length?: number): BigInt64Array; - new(array: Iterable): BigInt64Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): BigInt64Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): BigInt64Array; /** The size in bytes of each element in the array. */ readonly BYTES_PER_ELEMENT: number; @@ -386,12 +386,17 @@ interface BigInt64ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. + */ + from(source: ArrayLikeOrIterable): BigInt64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike): BigInt64Array; - from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigInt64Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => bigint, thisArg?: any): BigInt64Array; } declare var BigInt64Array: BigInt64ArrayConstructor; @@ -416,13 +421,13 @@ interface BigUint64Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): BigUint64Array; /** Yields index, value pairs for every entry in the array. */ entries(): IterableIterator<[number, bigint]>; @@ -435,17 +440,17 @@ interface BigUint64Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - every(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean; + every(predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any): boolean; /** * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: bigint, start?: number, end?: number): this; + fill(value: bigint, start?: number, end?: number): BigUint64Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -454,7 +459,7 @@ interface BigUint64Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: bigint, index: number, array: BigUint64Array) => any, thisArg?: any): BigUint64Array; + filter(predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any): BigUint64Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -465,7 +470,7 @@ interface BigUint64Array { * @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: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): bigint | undefined; + find(predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any): bigint | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -476,7 +481,7 @@ interface BigUint64Array { * @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: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -543,7 +548,7 @@ interface BigUint64Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint; + reduce(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint, initialValue?: bigint): bigint; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -567,7 +572,7 @@ interface BigUint64Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint): bigint; + reduceRight(callbackfn: (previousValue: bigint, currentValue: bigint, currentIndex: number, array: BigUint64Array) => bigint, initialValue?: bigint): bigint; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -582,7 +587,7 @@ interface BigUint64Array { reduceRight(callbackfn: (previousValue: U, currentValue: bigint, currentIndex: number, array: BigUint64Array) => U, initialValue: U): U; /** Reverses the elements in the array. */ - reverse(): this; + reverse(): BigUint64Array; /** * Sets a value or an array of values. @@ -606,13 +611,13 @@ interface BigUint64Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - some(predicate: (value: bigint, index: number, array: BigUint64Array) => boolean, thisArg?: any): boolean; + some(predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any): boolean; /** * Sorts the array. * @param compareFn The function used to determine the order of the elements. If omitted, the elements are sorted in ascending order. */ - sort(compareFn?: (a: bigint, b: bigint) => number | bigint): this; + sort(compareFn?: (a: bigint, b: bigint) => number | bigint): BigUint64Array; /** * Gets a new BigUint64Array view of the ArrayBuffer store for this array, referencing the elements @@ -622,13 +627,13 @@ interface BigUint64Array { */ subarray(begin?: number, end?: number): BigUint64Array; - /** Converts the array to a string by using the current locale. */ + /** Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** Returns the primitive value of the array. */ valueOf(): BigUint64Array; /** Yields each value in the array. */ @@ -644,8 +649,8 @@ interface BigUint64Array { interface BigUint64ArrayConstructor { readonly prototype: BigUint64Array; new(length?: number): BigUint64Array; - new(array: Iterable): BigUint64Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): BigUint64Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): BigUint64Array; /** The size in bytes of each element in the array. */ readonly BYTES_PER_ELEMENT: number; @@ -658,12 +663,17 @@ interface BigUint64ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. + */ + from(source: ArrayLikeOrIterable): BigUint64Array; + + /** + * Creates an array from an array-like or iterable object. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike): BigUint64Array; - from(arrayLike: ArrayLike, mapfn: (v: U, k: number) => bigint, thisArg?: any): BigUint64Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => bigint, thisArg?: any): BigUint64Array; } declare var BigUint64Array: BigUint64ArrayConstructor; diff --git a/src/lib/es2020.symbol.wellknown.d.ts b/src/lib/es2020.symbol.wellknown.d.ts index 94a11768256c7..158ca3b83aa36 100644 --- a/src/lib/es2020.symbol.wellknown.d.ts +++ b/src/lib/es2020.symbol.wellknown.d.ts @@ -13,7 +13,7 @@ interface RegExp { /** * Matches a string with this regular expression, and returns an iterable of matches * containing the results of that search. - * @param string A string to search within. + * @param str A string to search within. */ [Symbol.matchAll](str: string): IterableIterator; } diff --git a/src/lib/es2021.string.d.ts b/src/lib/es2021.string.d.ts index 66971bf84d6cf..8a0bce1b88149 100644 --- a/src/lib/es2021.string.d.ts +++ b/src/lib/es2021.string.d.ts @@ -1,15 +1,35 @@ interface String { /** - * Replace all instances of a substring in a string, using a regular expression or search string. - * @param searchValue A string to search for. - * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string. + * Replaces all occurrences of substrings that match a search string or a regular expression. + * When the {@linkcode searchValue} is a `RegExp`, a `TypeError` will be thrown if the `g` (global) flag is not set + * (only those matches at the beginning are replaced if the `y` (sticky) flag is also present). + * @param searchValue A string or RegExp search value. + * @param replaceValue The replacement text. */ replaceAll(searchValue: string | RegExp, replaceValue: string): string; /** - * Replace all instances of a substring in a string, using a regular expression or search string. - * @param searchValue A string to search for. + * Replaces all occurrences of substrings that match a search string or a regular expression. + * When the {@linkcode searchValue} is a `RegExp`, a `TypeError` will be thrown if the `g` (global) flag is not set + * (only those matches at the beginning are replaced if the `y` (sticky) flag is also present). + * @param searchValue A string or RegExp search value. * @param replacer A function that returns the replacement text. */ replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; + + /** + * Passes a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. + * @param searchValue An object that supports searching for and replacing matches within a string. + * This object is expected to implement its own replacement algorithm. + * @param replaceValue The replacement text. + */ + replaceAll(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string; + + /** + * Passes a string and {@linkcode replaceValue} to the `[Symbol.replace]` method on {@linkcode searchValue}. + * @param searchValue An object that supports searching for and replacing matches within a string. + * This object is expected to implement its own replacement algorithm. + * @param replacer A function that returns the replacement text. + */ + replaceAll(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string; } diff --git a/src/lib/es2022.object.d.ts b/src/lib/es2022.object.d.ts index 7325ef3c343e2..0a07706ba941c 100644 --- a/src/lib/es2022.object.d.ts +++ b/src/lib/es2022.object.d.ts @@ -4,5 +4,5 @@ interface ObjectConstructor { * @param o An object. * @param v A property name. */ - hasOwn(o: object, v: PropertyKey): boolean; + hasOwn(o: {}, v: PropertyKey): boolean; } diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index a74b3cb4c2111..d31bf2acb7329 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -146,7 +146,7 @@ interface ObjectConstructor { * Returns the prototype of an object. * @param o The object that references the prototype. */ - getPrototypeOf(o: any): any; + getPrototypeOf(o: {}): any; /** * Gets the own property descriptor of the specified object. @@ -154,14 +154,14 @@ interface ObjectConstructor { * @param o Object that contains the property. * @param p Name of the property. */ - getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined; + getOwnPropertyDescriptor(o: {}, p: PropertyKey): PropertyDescriptor | undefined; /** * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. * @param o Object that contains the own properties. */ - getOwnPropertyNames(o: any): string[]; + getOwnPropertyNames(o: {}): string[]; /** * Creates an object that has the specified prototype or that has null prototype. @@ -182,14 +182,14 @@ interface ObjectConstructor { * @param p The property name. * @param attributes Descriptor for the property. It can be for a data property or an accessor property. */ - defineProperty(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType): T; + defineProperty(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType): T; /** * Adds one or more properties to an object, and/or modifies attributes of existing properties. * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. */ - defineProperties(o: T, properties: PropertyDescriptorMap & ThisType): T; + defineProperties(o: T, properties: PropertyDescriptorMap & ThisType): T; /** * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. @@ -207,7 +207,7 @@ interface ObjectConstructor { * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - freeze(o: T): Readonly; + freeze(o: T): Readonly; /** * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. @@ -225,19 +225,37 @@ interface ObjectConstructor { * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. * @param o Object to test. */ - isSealed(o: any): boolean; + isSealed(o: object): boolean; + + /** + * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. + * @param o Object to test. + */ + isSealed(o: any): true; + + /** + * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. + * @param o Object to test. + */ + isFrozen(o: object): boolean; /** * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. * @param o Object to test. */ - isFrozen(o: any): boolean; + isFrozen(o: any): true; + + /** + * Returns a value that indicates whether new properties can be added to an object. + * @param o Object to test. + */ + isExtensible(o: object): boolean; /** * Returns a value that indicates whether new properties can be added to an object. * @param o Object to test. */ - isExtensible(o: any): boolean; + isExtensible(o: any): false; /** * Returns the names of the enumerable string properties and methods of an object. @@ -314,9 +332,14 @@ interface CallableFunction extends Function { /** * Calls the function with the specified object as the this value and the elements of specified array as the arguments. * @param thisArg The object to be used as the this object. - * @param args An array of argument values to be passed to the function. */ apply(this: (this: T) => R, thisArg: T): R; + + /** + * Calls the function with the specified object as the this value and the elements of specified array as the arguments. + * @param thisArg The object to be used as the this object. + * @param args An array of argument values to be passed to the function. + */ apply(this: (this: T, ...args: A) => R, thisArg: T, args: A): R; /** @@ -330,23 +353,29 @@ interface CallableFunction extends Function { * For a given function, creates a bound function that has the same body as the original function. * The this object of the bound function is associated with the specified object, and has the specified initial parameters. * @param thisArg The object to be used as the this object. - * @param args Arguments to bind to the parameters of the function. */ bind(this: T, thisArg: ThisParameterType): OmitThisParameter; - bind(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; - bind(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; - bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; - bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; - bind(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg The object to be used as the this object. + * @param args Arguments to bind to the parameters of the function. + */ + bind(this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } interface NewableFunction extends Function { /** * Calls the function with the specified object as the this value and the elements of specified array as the arguments. * @param thisArg The object to be used as the this object. - * @param args An array of argument values to be passed to the function. */ apply(this: new () => T, thisArg: T): void; + /** + * Calls the function with the specified object as the this value and the elements of specified array as the arguments. + * @param thisArg The object to be used as the this object. + * @param args An array of argument values to be passed to the function. + */ apply(this: new (...args: A) => T, thisArg: T, args: A): void; /** @@ -360,14 +389,16 @@ interface NewableFunction extends Function { * For a given function, creates a bound function that has the same body as the original function. * The this object of the bound function is associated with the specified object, and has the specified initial parameters. * @param thisArg The object to be used as the this object. - * @param args Arguments to bind to the parameters of the function. */ bind(this: T, thisArg: any): T; - bind(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; - bind(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; - bind(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; - bind(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; - bind(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg The object to be used as the this object. + * @param args Arguments to bind to the parameters of the function. + */ + bind(this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R; } interface IArguments { @@ -387,7 +418,7 @@ interface String { charAt(pos: number): string; /** - * Returns the Unicode value of the character at the specified location. + * Returns a non-negative integer less than 65536 (0x10000) that is the code unit value of the character at the specified index. * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. */ charCodeAt(index: number): number; @@ -413,42 +444,51 @@ interface String { lastIndexOf(searchString: string, position?: number): number; /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string + * Determines whether the reference string comes before, after or is equivalent to the specified string in the current locale. + * Returns a negative integer if it comes before, a positive number if it comes after, and 0 if they are equivalent. + * @param that The string to compare to. */ localeCompare(that: string): number; /** * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. + * @param regexp The regular expression for matching. If the provided value is not a RegExp, it is implicitly + * converted to a RegExp by using `new RegExp(regexp)`. */ match(regexp: string | RegExp): RegExpMatchArray | null; /** - * Replaces text in a string, using a regular expression or search string. + * Replaces one or more occurrences of substrings that match a search string or a regular expression. + * When the {@linkcode searchValue} is a `RegExp`, all matches are replaced if the `g` (global) flag is set + * (or only those matches at the beginning, if the `y` (sticky) flag is also present). + * Otherwise, only the first match of {@linkcode searchValue} is replaced. * @param searchValue A string or regular expression to search for. - * @param replaceValue A string containing the text to replace. When the {@linkcode searchValue} is a `RegExp`, all matches are replaced if the `g` flag is set (or only those matches at the beginning, if the `y` flag is also present). Otherwise, only the first match of {@linkcode searchValue} is replaced. + * @param replaceValue The replacement text. */ replace(searchValue: string | RegExp, replaceValue: string): string; - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A string to search for. - * @param replacer A function that returns the replacement text. - */ + /** + * Replaces one or more occurrences of substrings that match a search string or a regular expression. + * When the {@linkcode searchValue} is a `RegExp`, all matches are replaced if the `g` (global) flag is set + * (or only those matches at the beginning, if the `y` (sticky) flag is also present). + * Otherwise, only the first match of {@linkcode searchValue} is replaced. + * @param searchValue A string or regular expression to search for. + * @param replacer A function that returns the replacement text. + */ replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; /** * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. + * @param regexp The regular expression for matching. If the provided value is not a RegExp, it is implicitly + * converted to a RegExp by using `new RegExp(regexp)`. */ search(regexp: string | RegExp): number; /** * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. + * @param start The index to the beginning of the specified portion of the string. + * @param end The index to the end of the specified portion of the string. The substring includes the characters up to, but not including, the character indicated by end. + * If this value is not specified, the substring continues to the end of the string. */ slice(start?: number, end?: number): string; @@ -460,9 +500,9 @@ interface String { split(separator: string | RegExp, limit?: number): string[]; /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. + * Returns the substring beginning at the specified index within a String object. + * @param start The zero-based index indicating the beginning of the substring. + * @param end The zero-based index indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. * If end is omitted, the characters from start through the end of the original string are returned. */ substring(start: number, end?: number): string; @@ -487,9 +527,9 @@ interface String { // IE extensions /** - * Gets a substring beginning at the specified location and having the specified length. + * Gets a substring beginning at the specified index and having the specified length. * @deprecated A legacy feature for browser compatibility - * @param from The starting position of the desired substring. The index of the first character in the string is zero. + * @param from The starting index of the desired substring. The index of the first character in the string is zero. * @param length The number of characters to include in the returned substring. */ substr(from: number, length?: number): string; @@ -508,7 +548,7 @@ interface StringConstructor { } /** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. + * Allows manipulation and formatting of text strings and determination of location of substrings within strings. */ declare var String: StringConstructor; @@ -573,13 +613,13 @@ interface NumberConstructor { /** * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. + * JavaScript displays NEGATIVE_INFINITY values as -Infinity. */ readonly NEGATIVE_INFINITY: number; /** * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. + * JavaScript displays POSITIVE_INFINITY values as Infinity. */ readonly POSITIVE_INFINITY: number; } @@ -975,11 +1015,16 @@ interface RegExp { /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ readonly multiline: boolean; + /** + * Gets or sets the index at which the {@link RegExp.exec()} or {@link RegExp.test()} methods start searching for a match in an arbitrary string. + * After each execution of {@link RegExp.exec()} or {@link RegExp.test()}, `lastIndex` will be set to the end index of the matched string, + * or 0 if a match was not found. + */ lastIndex: number; // Non-standard extensions /** @deprecated A legacy feature for browser compatibility */ - compile(pattern: string, flags?: string): this; + compile(pattern: string, flags?: string): RegExp; } interface RegExpConstructor { @@ -1152,13 +1197,17 @@ interface ReadonlyArray { */ readonly length: number; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods. + * Returns a string representation of the array. The elements are converted to string using their toLocaleString methods. */ toLocaleString(): string; + /** + * Returns the primitive value of the array. + */ + valueOf(): readonly T[]; /** * Combines two or more arrays. * @param items Additional items to add to the end of array1. @@ -1248,8 +1297,7 @@ interface ReadonlyArray { * @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: readonly T[]) => T): T; - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => 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. @@ -1261,8 +1309,7 @@ interface ReadonlyArray { * @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: readonly T[]) => T): T; - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => 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. @@ -1286,13 +1333,17 @@ interface Array { */ length: number; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; /** - * Returns a string representation of an array. The elements are converted to string using their toLocaleString methods. + * Returns a string representation of the array. The elements are converted to string using their toLocaleString methods. */ toLocaleString(): string; + /** + * Returns the primitive value of the array. + */ + valueOf(): T[]; /** * Removes the last element from an array and returns it. * If the array is empty, undefined is returned and the array is not modified. @@ -1347,20 +1398,20 @@ interface Array { * a negative value if the first argument is less than the second argument, zero if they're equal, and a positive * value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: T, b: T) => number): this; + sort(compareFn?: (a: T, b: T) => number): T[]; /** * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. + * @param start The zero-based index in the array from which to start removing elements. * @param deleteCount The number of elements to remove. * @returns An array containing the elements that were deleted. */ splice(start: number, deleteCount?: number): T[]; /** * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. + * @param start The zero-based index in the array from which to start removing elements. * @param deleteCount The number of elements to remove. * @param items Elements to insert into the array in place of the deleted elements. * @returns An array containing the elements that were deleted. @@ -1439,8 +1490,7 @@ interface Array { * @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): T; - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => 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. @@ -1452,8 +1502,7 @@ interface Array { * @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): T; - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => 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. @@ -1471,7 +1520,14 @@ interface ArrayConstructor { (arrayLength?: number): any[]; (arrayLength: number): T[]; (...items: T[]): T[]; - isArray(arg: any): arg is any[]; + isArray(arg: T): arg is + T extends any ? Extract< + true extends false & T ? any[] : + T extends readonly any[] ? T : + T extends string ? never : + T extends ArrayLikeOrIterable ? U[] : + unknown[], T + > : never; readonly prototype: any[]; } @@ -1534,6 +1590,12 @@ interface ArrayLike { readonly [n: number]: T; } +interface ArrayLikeOrIterableTypes { + arrayLike: ArrayLike; +} + +type ArrayLikeOrIterable = ArrayLikeOrIterableTypes[keyof ArrayLikeOrIterableTypes]; + /** * Make all properties in T optional */ @@ -1555,6 +1617,13 @@ type Readonly = { readonly [P in keyof T]: T[P]; }; +/** + * Make all properties in T writable + */ +type Writable = { + -readonly [P in keyof T]: T[P]; +}; + /** * From T, pick a set of properties whose keys are in the union K */ @@ -1846,13 +1915,13 @@ interface Int8Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): Int8Array; /** * Determines whether all the members of an array satisfy the specified test. @@ -1868,11 +1937,11 @@ interface Int8Array { * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: number, start?: number, end?: number): this; + fill(value: number, start?: number, end?: number): Int8Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -1881,7 +1950,7 @@ interface Int8Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array; + filter(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): Int8Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -1892,7 +1961,7 @@ interface Int8Array { * @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: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined; + find(predicate: (value: number, index: number, obj: Int8Array) => unknown, thisArg?: any): number | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -1903,7 +1972,7 @@ interface Int8Array { * @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: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: number, index: number, obj: Int8Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -1962,8 +2031,7 @@ interface Int8Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -1987,8 +2055,7 @@ interface Int8Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -2037,10 +2104,10 @@ interface Int8Array { * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: number, b: number) => number): this; + sort(compareFn?: (a: number, b: number) => number): Int8Array; /** * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements @@ -2051,25 +2118,27 @@ interface Int8Array { subarray(begin?: number, end?: number): Int8Array; /** - * Converts a number to a string by using the current locale. + * Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** + * Returns the primitive value of the array. + */ valueOf(): Int8Array; [index: number]: number; } interface Int8ArrayConstructor { readonly prototype: Int8Array; - new(length: number): Int8Array; - new(array: ArrayLike | ArrayBufferLike): Int8Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array; + new(length?: number): Int8Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): Int8Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; /** * The size in bytes of each element in the array. @@ -2084,17 +2153,17 @@ interface Int8ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): Int8Array; + from(source: ArrayLikeOrIterable): Int8Array; /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } @@ -2128,13 +2197,13 @@ interface Uint8Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): Uint8Array; /** * Determines whether all the members of an array satisfy the specified test. @@ -2150,11 +2219,11 @@ interface Uint8Array { * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: number, start?: number, end?: number): this; + fill(value: number, start?: number, end?: number): Uint8Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -2163,7 +2232,7 @@ interface Uint8Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array; + filter(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): Uint8Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -2174,7 +2243,7 @@ interface Uint8Array { * @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: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined; + find(predicate: (value: number, index: number, obj: Uint8Array) => unknown, thisArg?: any): number | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -2185,7 +2254,7 @@ interface Uint8Array { * @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: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: number, index: number, obj: Uint8Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -2244,8 +2313,7 @@ interface Uint8Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -2269,8 +2337,7 @@ interface Uint8Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -2319,10 +2386,10 @@ interface Uint8Array { * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: number, b: number) => number): this; + sort(compareFn?: (a: number, b: number) => number): Uint8Array; /** * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements @@ -2333,16 +2400,18 @@ interface Uint8Array { subarray(begin?: number, end?: number): Uint8Array; /** - * Converts a number to a string by using the current locale. + * Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** + * Returns the primitive value of the array. + */ valueOf(): Uint8Array; [index: number]: number; @@ -2350,9 +2419,9 @@ interface Uint8Array { interface Uint8ArrayConstructor { readonly prototype: Uint8Array; - new(length: number): Uint8Array; - new(array: ArrayLike | ArrayBufferLike): Uint8Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array; + new(length?: number): Uint8Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): Uint8Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; /** * The size in bytes of each element in the array. @@ -2367,17 +2436,17 @@ interface Uint8ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): Uint8Array; + from(source: ArrayLikeOrIterable): Uint8Array; /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } declare var Uint8Array: Uint8ArrayConstructor; @@ -2410,13 +2479,13 @@ interface Uint8ClampedArray { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): Uint8ClampedArray; /** * Determines whether all the members of an array satisfy the specified test. @@ -2432,11 +2501,11 @@ interface Uint8ClampedArray { * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: number, start?: number, end?: number): this; + fill(value: number, start?: number, end?: number): Uint8ClampedArray; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -2445,7 +2514,7 @@ interface Uint8ClampedArray { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray; + filter(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): Uint8ClampedArray; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -2456,7 +2525,7 @@ interface Uint8ClampedArray { * @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: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined; + find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => unknown, thisArg?: any): number | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -2467,7 +2536,7 @@ interface Uint8ClampedArray { * @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: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number; + findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -2526,8 +2595,7 @@ interface Uint8ClampedArray { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -2551,8 +2619,7 @@ interface Uint8ClampedArray { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -2601,10 +2668,10 @@ interface Uint8ClampedArray { * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: number, b: number) => number): this; + sort(compareFn?: (a: number, b: number) => number): Uint8ClampedArray; /** * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements @@ -2615,16 +2682,18 @@ interface Uint8ClampedArray { subarray(begin?: number, end?: number): Uint8ClampedArray; /** - * Converts a number to a string by using the current locale. + * Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** + * Returns the primitive value of the array. + */ valueOf(): Uint8ClampedArray; [index: number]: number; @@ -2632,9 +2701,9 @@ interface Uint8ClampedArray { interface Uint8ClampedArrayConstructor { readonly prototype: Uint8ClampedArray; - new(length: number): Uint8ClampedArray; - new(array: ArrayLike | ArrayBufferLike): Uint8ClampedArray; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray; + new(length?: number): Uint8ClampedArray; + new(array: ArrayLikeOrIterable | ArrayBufferLike): Uint8ClampedArray; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8ClampedArray; /** * The size in bytes of each element in the array. @@ -2649,17 +2718,17 @@ interface Uint8ClampedArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): Uint8ClampedArray; + from(source: ArrayLikeOrIterable): Uint8ClampedArray; /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } declare var Uint8ClampedArray: Uint8ClampedArrayConstructor; @@ -2691,13 +2760,13 @@ interface Int16Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): Int16Array; /** * Determines whether all the members of an array satisfy the specified test. @@ -2713,11 +2782,11 @@ interface Int16Array { * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: number, start?: number, end?: number): this; + fill(value: number, start?: number, end?: number): Int16Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -2726,7 +2795,7 @@ interface Int16Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array; + filter(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): Int16Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -2737,7 +2806,7 @@ interface Int16Array { * @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: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined; + find(predicate: (value: number, index: number, obj: Int16Array) => unknown, thisArg?: any): number | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -2748,7 +2817,7 @@ interface Int16Array { * @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: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: number, index: number, obj: Int16Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -2806,8 +2875,7 @@ interface Int16Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -2831,8 +2899,7 @@ interface Int16Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -2881,10 +2948,10 @@ interface Int16Array { * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: number, b: number) => number): this; + sort(compareFn?: (a: number, b: number) => number): Int16Array; /** * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements @@ -2895,16 +2962,18 @@ interface Int16Array { subarray(begin?: number, end?: number): Int16Array; /** - * Converts a number to a string by using the current locale. + * Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** + * Returns the primitive value of the array. + */ valueOf(): Int16Array; [index: number]: number; @@ -2912,9 +2981,9 @@ interface Int16Array { interface Int16ArrayConstructor { readonly prototype: Int16Array; - new(length: number): Int16Array; - new(array: ArrayLike | ArrayBufferLike): Int16Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array; + new(length?: number): Int16Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): Int16Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; /** * The size in bytes of each element in the array. @@ -2929,17 +2998,17 @@ interface Int16ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): Int16Array; + from(source: ArrayLikeOrIterable): Int16Array; /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } @@ -2973,13 +3042,13 @@ interface Uint16Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): Uint16Array; /** * Determines whether all the members of an array satisfy the specified test. @@ -2995,11 +3064,11 @@ interface Uint16Array { * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: number, start?: number, end?: number): this; + fill(value: number, start?: number, end?: number): Uint16Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -3008,7 +3077,7 @@ interface Uint16Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array; + filter(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): Uint16Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -3019,7 +3088,7 @@ interface Uint16Array { * @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: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined; + find(predicate: (value: number, index: number, obj: Uint16Array) => unknown, thisArg?: any): number | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -3030,7 +3099,7 @@ interface Uint16Array { * @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: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: number, index: number, obj: Uint16Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -3089,8 +3158,7 @@ interface Uint16Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -3114,8 +3182,7 @@ interface Uint16Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -3164,10 +3231,10 @@ interface Uint16Array { * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: number, b: number) => number): this; + sort(compareFn?: (a: number, b: number) => number): Uint16Array; /** * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements @@ -3178,16 +3245,18 @@ interface Uint16Array { subarray(begin?: number, end?: number): Uint16Array; /** - * Converts a number to a string by using the current locale. + * Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** + * Returns the primitive value of the array. + */ valueOf(): Uint16Array; [index: number]: number; @@ -3195,9 +3264,9 @@ interface Uint16Array { interface Uint16ArrayConstructor { readonly prototype: Uint16Array; - new(length: number): Uint16Array; - new(array: ArrayLike | ArrayBufferLike): Uint16Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array; + new(length?: number): Uint16Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): Uint16Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; /** * The size in bytes of each element in the array. @@ -3212,17 +3281,17 @@ interface Uint16ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): Uint16Array; + from(source: ArrayLikeOrIterable): Uint16Array; /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } @@ -3255,13 +3324,13 @@ interface Int32Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): Int32Array; /** * Determines whether all the members of an array satisfy the specified test. @@ -3277,11 +3346,11 @@ interface Int32Array { * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: number, start?: number, end?: number): this; + fill(value: number, start?: number, end?: number): Int32Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -3290,7 +3359,7 @@ interface Int32Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array; + filter(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): Int32Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -3301,7 +3370,7 @@ interface Int32Array { * @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: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined; + find(predicate: (value: number, index: number, obj: Int32Array) => unknown, thisArg?: any): number | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -3312,7 +3381,7 @@ interface Int32Array { * @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: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: number, index: number, obj: Int32Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -3371,8 +3440,7 @@ interface Int32Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -3396,8 +3464,7 @@ interface Int32Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -3446,10 +3513,10 @@ interface Int32Array { * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: number, b: number) => number): this; + sort(compareFn?: (a: number, b: number) => number): Int32Array; /** * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements @@ -3460,16 +3527,18 @@ interface Int32Array { subarray(begin?: number, end?: number): Int32Array; /** - * Converts a number to a string by using the current locale. + * Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** + * Returns the primitive value of the array. + */ valueOf(): Int32Array; [index: number]: number; @@ -3477,9 +3546,9 @@ interface Int32Array { interface Int32ArrayConstructor { readonly prototype: Int32Array; - new(length: number): Int32Array; - new(array: ArrayLike | ArrayBufferLike): Int32Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array; + new(length?: number): Int32Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): Int32Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; /** * The size in bytes of each element in the array. @@ -3494,17 +3563,17 @@ interface Int32ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): Int32Array; + from(source: ArrayLikeOrIterable): Int32Array; /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } declare var Int32Array: Int32ArrayConstructor; @@ -3537,13 +3606,13 @@ interface Uint32Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): Uint32Array; /** * Determines whether all the members of an array satisfy the specified test. @@ -3559,11 +3628,11 @@ interface Uint32Array { * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: number, start?: number, end?: number): this; + fill(value: number, start?: number, end?: number): Uint32Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -3572,7 +3641,7 @@ interface Uint32Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array; + filter(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): Uint32Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -3583,7 +3652,7 @@ interface Uint32Array { * @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: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined; + find(predicate: (value: number, index: number, obj: Uint32Array) => unknown, thisArg?: any): number | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -3594,7 +3663,7 @@ interface Uint32Array { * @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: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: number, index: number, obj: Uint32Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -3652,8 +3721,7 @@ interface Uint32Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -3677,8 +3745,7 @@ interface Uint32Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -3727,10 +3794,10 @@ interface Uint32Array { * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: number, b: number) => number): this; + sort(compareFn?: (a: number, b: number) => number): Uint32Array; /** * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements @@ -3741,16 +3808,18 @@ interface Uint32Array { subarray(begin?: number, end?: number): Uint32Array; /** - * Converts a number to a string by using the current locale. + * Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** + * Returns the primitive value of the array. + */ valueOf(): Uint32Array; [index: number]: number; @@ -3758,9 +3827,9 @@ interface Uint32Array { interface Uint32ArrayConstructor { readonly prototype: Uint32Array; - new(length: number): Uint32Array; - new(array: ArrayLike | ArrayBufferLike): Uint32Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array; + new(length?: number): Uint32Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): Uint32Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; /** * The size in bytes of each element in the array. @@ -3775,17 +3844,17 @@ interface Uint32ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): Uint32Array; + from(source: ArrayLikeOrIterable): Uint32Array; /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } declare var Uint32Array: Uint32ArrayConstructor; @@ -3818,13 +3887,13 @@ interface Float32Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): Float32Array; /** * Determines whether all the members of an array satisfy the specified test. @@ -3840,11 +3909,11 @@ interface Float32Array { * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: number, start?: number, end?: number): this; + fill(value: number, start?: number, end?: number): Float32Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -3853,7 +3922,7 @@ interface Float32Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array; + filter(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): Float32Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -3864,7 +3933,7 @@ interface Float32Array { * @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: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined; + find(predicate: (value: number, index: number, obj: Float32Array) => unknown, thisArg?: any): number | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -3875,7 +3944,7 @@ interface Float32Array { * @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: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: number, index: number, obj: Float32Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -3934,8 +4003,7 @@ interface Float32Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -3959,8 +4027,7 @@ interface Float32Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -4009,10 +4076,10 @@ interface Float32Array { * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: number, b: number) => number): this; + sort(compareFn?: (a: number, b: number) => number): Float32Array; /** * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements @@ -4023,16 +4090,18 @@ interface Float32Array { subarray(begin?: number, end?: number): Float32Array; /** - * Converts a number to a string by using the current locale. + * Returns a string representation of the array in the current locale. */ toLocaleString(): string; /** - * Returns a string representation of an array. + * Returns a string representation of the array. */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** + * Returns the primitive value of the array. + */ valueOf(): Float32Array; [index: number]: number; @@ -4040,9 +4109,9 @@ interface Float32Array { interface Float32ArrayConstructor { readonly prototype: Float32Array; - new(length: number): Float32Array; - new(array: ArrayLike | ArrayBufferLike): Float32Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array; + new(length?: number): Float32Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): Float32Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; /** * The size in bytes of each element in the array. @@ -4057,17 +4126,17 @@ interface Float32ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): Float32Array; + from(source: ArrayLikeOrIterable): Float32Array; /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } @@ -4101,13 +4170,13 @@ interface Float64Array { /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the + * @param target If target is negative, it is treated as length + target where length is the * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. + * @param start If start is negative, it is treated as length + start. If end is negative, it + * is treated as length + end. * @param end If not specified, length of the this object is used as its default value. */ - copyWithin(target: number, start: number, end?: number): this; + copyWithin(target: number, start: number, end?: number): Float64Array; /** * Determines whether all the members of an array satisfy the specified test. @@ -4123,11 +4192,11 @@ interface Float64Array { * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. + * length + start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. + * length + end. */ - fill(value: number, start?: number, end?: number): this; + fill(value: number, start?: number, end?: number): Float64Array; /** * Returns the elements of an array that meet the condition specified in a callback function. @@ -4136,7 +4205,7 @@ interface Float64Array { * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ - filter(predicate: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array; + filter(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): Float64Array; /** * Returns the value of the first element in the array where predicate is true, and undefined @@ -4147,7 +4216,7 @@ interface Float64Array { * @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: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined; + find(predicate: (value: number, index: number, obj: Float64Array) => unknown, thisArg?: any): number | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 @@ -4158,7 +4227,7 @@ interface Float64Array { * @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: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number; + findIndex(predicate: (value: number, index: number, obj: Float64Array) => unknown, thisArg?: any): number; /** * Performs the specified action for each element in an array. @@ -4217,8 +4286,7 @@ interface Float64Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number; - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -4242,8 +4310,7 @@ interface Float64Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number; - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -4292,21 +4359,32 @@ interface Float64Array { * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts - * [11,2,22,1].sort((a, b) => a - b) + * [11, 2, 22, 1].sort((a, b) => a - b) * ``` */ - sort(compareFn?: (a: number, b: number) => number): this; + sort(compareFn?: (a: number, b: number) => number): Float64Array; /** + * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin?: number, end?: number): Float64Array; + /** + * Returns a string representation of the array in the current locale. + */ + toLocaleString(): string; + + /** + * Returns a string representation of the array. + */ toString(): string; - /** Returns the primitive value of the specified object. */ + /** + * Returns the primitive value of the array. + */ valueOf(): Float64Array; [index: number]: number; @@ -4314,9 +4392,9 @@ interface Float64Array { interface Float64ArrayConstructor { readonly prototype: Float64Array; - new(length: number): Float64Array; - new(array: ArrayLike | ArrayBufferLike): Float64Array; - new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array; + new(length?: number): Float64Array; + new(array: ArrayLikeOrIterable | ArrayBufferLike): Float64Array; + new(buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; /** * The size in bytes of each element in the array. @@ -4331,17 +4409,17 @@ interface Float64ArrayConstructor { /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. */ - from(arrayLike: ArrayLike): Float64Array; + from(source: ArrayLikeOrIterable): Float64Array; /** * Creates an array from an array-like or iterable object. - * @param arrayLike An array-like or iterable object to convert to an array. + * @param source An array-like or iterable object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; + from(source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } declare var Float64Array: Float64ArrayConstructor; diff --git a/src/lib/scripthost.d.ts b/src/lib/scripthost.d.ts index c3ac4a7e6560f..8dd04b3998770 100644 --- a/src/lib/scripthost.d.ts +++ b/src/lib/scripthost.d.ts @@ -175,7 +175,7 @@ declare var WScript: { /** * Creates a COM object. - * @param strProgiID + * @param strProgID * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events. */ CreateObject(strProgID: string, strPrefix?: string): any; @@ -277,9 +277,9 @@ interface VBArray { ubound(dimension?: number): number; /** - * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions, + * Returns a JavaScript array with all the elements in the VBArray. If there are multiple dimensions, * each successive dimension is appended to the end of the array. - * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6] + * Example: [[1, 2, 3], [4, 5, 6]] becomes [1, 2, 3, 4, 5, 6] */ toArray(): T[]; } diff --git a/src/testRunner/parallel/worker.ts b/src/testRunner/parallel/worker.ts index 05c1038488291..b333556164974 100644 --- a/src/testRunner/parallel/worker.ts +++ b/src/testRunner/parallel/worker.ts @@ -196,7 +196,7 @@ export function start() { newSuite.addTest(test); root.addSuite(newSuite); Object.setPrototypeOf(newSuite.ctx, root.ctx); - Object.setPrototypeOf(test.ctx, root.ctx); + Object.setPrototypeOf(test.ctx!, root.ctx); test.parent = newSuite; suite = newSuite; } diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols index 941b19b32392b..b005c75a84fc4 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols @@ -3,9 +3,9 @@ var paired: any[]; >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) paired.reduce(function (a1, a2) { ->paired.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>paired.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >a1 : Symbol(a1, Decl(anyInferenceAnonymousFunctions.ts, 2, 24)) >a2 : Symbol(a2, Decl(anyInferenceAnonymousFunctions.ts, 2, 27)) @@ -15,9 +15,9 @@ paired.reduce(function (a1, a2) { } , []); paired.reduce((b1, b2) => { ->paired.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>paired.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >b1 : Symbol(b1, Decl(anyInferenceAnonymousFunctions.ts, 8, 15)) >b2 : Symbol(b2, Decl(anyInferenceAnonymousFunctions.ts, 8, 18)) @@ -27,9 +27,9 @@ paired.reduce((b1, b2) => { } , []); paired.reduce((b3, b4) => b3.concat({}), []); ->paired.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>paired.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15)) >b4 : Symbol(b4, Decl(anyInferenceAnonymousFunctions.ts, 13, 18)) >b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15)) diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.types b/tests/baselines/reference/anyInferenceAnonymousFunctions.types index d5f693b5453b4..8dc7fdcb90f1d 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.types +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.types @@ -4,9 +4,9 @@ var paired: any[]; paired.reduce(function (a1, a2) { >paired.reduce(function (a1, a2) { return a1.concat({});} , []) : any ->paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >paired : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >function (a1, a2) { return a1.concat({});} : (a1: any, a2: any) => any >a1 : any >a2 : any @@ -23,9 +23,9 @@ paired.reduce(function (a1, a2) { paired.reduce((b1, b2) => { >paired.reduce((b1, b2) => { return b1.concat({});} , []) : any ->paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >paired : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >(b1, b2) => { return b1.concat({});} : (b1: any, b2: any) => any >b1 : any >b2 : any @@ -42,9 +42,9 @@ paired.reduce((b1, b2) => { paired.reduce((b3, b4) => b3.concat({}), []); >paired.reduce((b3, b4) => b3.concat({}), []) : any ->paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >paired : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >(b3, b4) => b3.concat({}) : (b3: any, b4: any) => any >b3 : any >b4 : any diff --git a/tests/baselines/reference/arrayCopyWithin.js b/tests/baselines/reference/arrayCopyWithin.js new file mode 100644 index 0000000000000..f2901ac21d875 --- /dev/null +++ b/tests/baselines/reference/arrayCopyWithin.js @@ -0,0 +1,79 @@ +//// [arrayCopyWithin.ts] +var strTuple: ["foo", "bar", "baz"]; +strTuple.copyWithin(0, 0); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] + +var numTuple: [11, 2, 22, 1]; +numTuple.copyWithin(0, 0); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +int8Array.copyWithin(0, 0); // Int8Array + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +uint8Array.copyWithin(0, 0); // Uint8Array + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +uint8ClampedArray.copyWithin(0, 0); // Uint8ClampedArray + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +int16Array.copyWithin(0, 0); // Int16Array + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +uint16Array.copyWithin(0, 0); // Uint16Array + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +int32Array.copyWithin(0, 0); // Int32Array + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +uint32Array.copyWithin(0, 0); // Uint32Array + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +float32Array.copyWithin(0, 0); // Float32Array + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +float64Array.copyWithin(0, 0); // Float64Array + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +bigInt64Array.copyWithin(0, 0); // BigInt64Array + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +bigUint64Array.copyWithin(0, 0); // BigUint64Array + + +//// [arrayCopyWithin.js] +var strTuple; +strTuple.copyWithin(0, 0); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +var numTuple; +numTuple.copyWithin(0, 0); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +var int8Array; +int8Array.copyWithin(0, 0); // Int8Array +var uint8Array; +uint8Array.copyWithin(0, 0); // Uint8Array +var uint8ClampedArray; +uint8ClampedArray.copyWithin(0, 0); // Uint8ClampedArray +var int16Array; +int16Array.copyWithin(0, 0); // Int16Array +var uint16Array; +uint16Array.copyWithin(0, 0); // Uint16Array +var int32Array; +int32Array.copyWithin(0, 0); // Int32Array +var uint32Array; +uint32Array.copyWithin(0, 0); // Uint32Array +var float32Array; +float32Array.copyWithin(0, 0); // Float32Array +var float64Array; +float64Array.copyWithin(0, 0); // Float64Array +var bigInt64Array; +bigInt64Array.copyWithin(0, 0); // BigInt64Array +var bigUint64Array; +bigUint64Array.copyWithin(0, 0); // BigUint64Array diff --git a/tests/baselines/reference/arrayCopyWithin.symbols b/tests/baselines/reference/arrayCopyWithin.symbols new file mode 100644 index 0000000000000..c36d84a737c8c --- /dev/null +++ b/tests/baselines/reference/arrayCopyWithin.symbols @@ -0,0 +1,160 @@ +=== tests/cases/compiler/arrayCopyWithin.ts === +var strTuple: ["foo", "bar", "baz"]; +>strTuple : Symbol(strTuple, Decl(arrayCopyWithin.ts, 0, 3)) + +strTuple.copyWithin(0, 0); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +>strTuple.copyWithin : Symbol(Array.copyWithin, Decl(lib.es2015.core.d.ts, --, --)) +>strTuple : Symbol(strTuple, Decl(arrayCopyWithin.ts, 0, 3)) +>copyWithin : Symbol(Array.copyWithin, Decl(lib.es2015.core.d.ts, --, --)) + +var numTuple: [11, 2, 22, 1]; +>numTuple : Symbol(numTuple, Decl(arrayCopyWithin.ts, 3, 3)) + +numTuple.copyWithin(0, 0); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +>numTuple.copyWithin : Symbol(Array.copyWithin, Decl(lib.es2015.core.d.ts, --, --)) +>numTuple : Symbol(numTuple, Decl(arrayCopyWithin.ts, 3, 3)) +>copyWithin : Symbol(Array.copyWithin, Decl(lib.es2015.core.d.ts, --, --)) + +interface Int8ArrayExtension extends Int8Array {} +>Int8ArrayExtension : Symbol(Int8ArrayExtension, Decl(arrayCopyWithin.ts, 4, 26)) +>Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int8Array: Int8ArrayExtension; +>int8Array : Symbol(int8Array, Decl(arrayCopyWithin.ts, 7, 3)) +>Int8ArrayExtension : Symbol(Int8ArrayExtension, Decl(arrayCopyWithin.ts, 4, 26)) + +int8Array.copyWithin(0, 0); // Int8Array +>int8Array.copyWithin : Symbol(Int8Array.copyWithin, Decl(lib.es5.d.ts, --, --)) +>int8Array : Symbol(int8Array, Decl(arrayCopyWithin.ts, 7, 3)) +>copyWithin : Symbol(Int8Array.copyWithin, Decl(lib.es5.d.ts, --, --)) + +interface Uint8ArrayExtension extends Uint8Array {} +>Uint8ArrayExtension : Symbol(Uint8ArrayExtension, Decl(arrayCopyWithin.ts, 8, 27)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8Array: Uint8ArrayExtension; +>uint8Array : Symbol(uint8Array, Decl(arrayCopyWithin.ts, 11, 3)) +>Uint8ArrayExtension : Symbol(Uint8ArrayExtension, Decl(arrayCopyWithin.ts, 8, 27)) + +uint8Array.copyWithin(0, 0); // Uint8Array +>uint8Array.copyWithin : Symbol(Uint8Array.copyWithin, Decl(lib.es5.d.ts, --, --)) +>uint8Array : Symbol(uint8Array, Decl(arrayCopyWithin.ts, 11, 3)) +>copyWithin : Symbol(Uint8Array.copyWithin, Decl(lib.es5.d.ts, --, --)) + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +>Uint8ClampedArrayExtension : Symbol(Uint8ClampedArrayExtension, Decl(arrayCopyWithin.ts, 12, 28)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8ClampedArray: Uint8ClampedArrayExtension; +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayCopyWithin.ts, 15, 3)) +>Uint8ClampedArrayExtension : Symbol(Uint8ClampedArrayExtension, Decl(arrayCopyWithin.ts, 12, 28)) + +uint8ClampedArray.copyWithin(0, 0); // Uint8ClampedArray +>uint8ClampedArray.copyWithin : Symbol(Uint8ClampedArray.copyWithin, Decl(lib.es5.d.ts, --, --)) +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayCopyWithin.ts, 15, 3)) +>copyWithin : Symbol(Uint8ClampedArray.copyWithin, Decl(lib.es5.d.ts, --, --)) + +interface Int16ArrayExtension extends Int16Array {} +>Int16ArrayExtension : Symbol(Int16ArrayExtension, Decl(arrayCopyWithin.ts, 16, 35)) +>Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int16Array: Int16ArrayExtension; +>int16Array : Symbol(int16Array, Decl(arrayCopyWithin.ts, 19, 3)) +>Int16ArrayExtension : Symbol(Int16ArrayExtension, Decl(arrayCopyWithin.ts, 16, 35)) + +int16Array.copyWithin(0, 0); // Int16Array +>int16Array.copyWithin : Symbol(Int16Array.copyWithin, Decl(lib.es5.d.ts, --, --)) +>int16Array : Symbol(int16Array, Decl(arrayCopyWithin.ts, 19, 3)) +>copyWithin : Symbol(Int16Array.copyWithin, Decl(lib.es5.d.ts, --, --)) + +interface Uint16ArrayExtension extends Uint16Array {} +>Uint16ArrayExtension : Symbol(Uint16ArrayExtension, Decl(arrayCopyWithin.ts, 20, 28)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint16Array: Uint16ArrayExtension; +>uint16Array : Symbol(uint16Array, Decl(arrayCopyWithin.ts, 23, 3)) +>Uint16ArrayExtension : Symbol(Uint16ArrayExtension, Decl(arrayCopyWithin.ts, 20, 28)) + +uint16Array.copyWithin(0, 0); // Uint16Array +>uint16Array.copyWithin : Symbol(Uint16Array.copyWithin, Decl(lib.es5.d.ts, --, --)) +>uint16Array : Symbol(uint16Array, Decl(arrayCopyWithin.ts, 23, 3)) +>copyWithin : Symbol(Uint16Array.copyWithin, Decl(lib.es5.d.ts, --, --)) + +interface Int32ArrayExtension extends Int32Array {} +>Int32ArrayExtension : Symbol(Int32ArrayExtension, Decl(arrayCopyWithin.ts, 24, 29)) +>Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int32Array: Int32ArrayExtension; +>int32Array : Symbol(int32Array, Decl(arrayCopyWithin.ts, 27, 3)) +>Int32ArrayExtension : Symbol(Int32ArrayExtension, Decl(arrayCopyWithin.ts, 24, 29)) + +int32Array.copyWithin(0, 0); // Int32Array +>int32Array.copyWithin : Symbol(Int32Array.copyWithin, Decl(lib.es5.d.ts, --, --)) +>int32Array : Symbol(int32Array, Decl(arrayCopyWithin.ts, 27, 3)) +>copyWithin : Symbol(Int32Array.copyWithin, Decl(lib.es5.d.ts, --, --)) + +interface Uint32ArrayExtension extends Uint32Array {} +>Uint32ArrayExtension : Symbol(Uint32ArrayExtension, Decl(arrayCopyWithin.ts, 28, 28)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint32Array: Uint32ArrayExtension; +>uint32Array : Symbol(uint32Array, Decl(arrayCopyWithin.ts, 31, 3)) +>Uint32ArrayExtension : Symbol(Uint32ArrayExtension, Decl(arrayCopyWithin.ts, 28, 28)) + +uint32Array.copyWithin(0, 0); // Uint32Array +>uint32Array.copyWithin : Symbol(Uint32Array.copyWithin, Decl(lib.es5.d.ts, --, --)) +>uint32Array : Symbol(uint32Array, Decl(arrayCopyWithin.ts, 31, 3)) +>copyWithin : Symbol(Uint32Array.copyWithin, Decl(lib.es5.d.ts, --, --)) + +interface Float32ArrayExtension extends Float32Array {} +>Float32ArrayExtension : Symbol(Float32ArrayExtension, Decl(arrayCopyWithin.ts, 32, 29)) +>Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float32Array: Float32ArrayExtension; +>float32Array : Symbol(float32Array, Decl(arrayCopyWithin.ts, 35, 3)) +>Float32ArrayExtension : Symbol(Float32ArrayExtension, Decl(arrayCopyWithin.ts, 32, 29)) + +float32Array.copyWithin(0, 0); // Float32Array +>float32Array.copyWithin : Symbol(Float32Array.copyWithin, Decl(lib.es5.d.ts, --, --)) +>float32Array : Symbol(float32Array, Decl(arrayCopyWithin.ts, 35, 3)) +>copyWithin : Symbol(Float32Array.copyWithin, Decl(lib.es5.d.ts, --, --)) + +interface Float64ArrayExtension extends Float64Array {} +>Float64ArrayExtension : Symbol(Float64ArrayExtension, Decl(arrayCopyWithin.ts, 36, 30)) +>Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float64Array: Float64ArrayExtension; +>float64Array : Symbol(float64Array, Decl(arrayCopyWithin.ts, 39, 3)) +>Float64ArrayExtension : Symbol(Float64ArrayExtension, Decl(arrayCopyWithin.ts, 36, 30)) + +float64Array.copyWithin(0, 0); // Float64Array +>float64Array.copyWithin : Symbol(Float64Array.copyWithin, Decl(lib.es5.d.ts, --, --)) +>float64Array : Symbol(float64Array, Decl(arrayCopyWithin.ts, 39, 3)) +>copyWithin : Symbol(Float64Array.copyWithin, Decl(lib.es5.d.ts, --, --)) + +interface BigInt64ArrayExtension extends BigInt64Array {} +>BigInt64ArrayExtension : Symbol(BigInt64ArrayExtension, Decl(arrayCopyWithin.ts, 40, 30)) +>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +var bigInt64Array: BigInt64ArrayExtension; +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayCopyWithin.ts, 43, 3)) +>BigInt64ArrayExtension : Symbol(BigInt64ArrayExtension, Decl(arrayCopyWithin.ts, 40, 30)) + +bigInt64Array.copyWithin(0, 0); // BigInt64Array +>bigInt64Array.copyWithin : Symbol(BigInt64Array.copyWithin, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayCopyWithin.ts, 43, 3)) +>copyWithin : Symbol(BigInt64Array.copyWithin, Decl(lib.es2020.bigint.d.ts, --, --)) + +interface BigUint64ArrayExtension extends BigUint64Array {} +>BigUint64ArrayExtension : Symbol(BigUint64ArrayExtension, Decl(arrayCopyWithin.ts, 44, 31)) +>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +var bigUint64Array: BigUint64ArrayExtension; +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayCopyWithin.ts, 47, 3)) +>BigUint64ArrayExtension : Symbol(BigUint64ArrayExtension, Decl(arrayCopyWithin.ts, 44, 31)) + +bigUint64Array.copyWithin(0, 0); // BigUint64Array +>bigUint64Array.copyWithin : Symbol(BigUint64Array.copyWithin, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayCopyWithin.ts, 47, 3)) +>copyWithin : Symbol(BigUint64Array.copyWithin, Decl(lib.es2020.bigint.d.ts, --, --)) + diff --git a/tests/baselines/reference/arrayCopyWithin.types b/tests/baselines/reference/arrayCopyWithin.types new file mode 100644 index 0000000000000..ba4b573e7e88e --- /dev/null +++ b/tests/baselines/reference/arrayCopyWithin.types @@ -0,0 +1,155 @@ +=== tests/cases/compiler/arrayCopyWithin.ts === +var strTuple: ["foo", "bar", "baz"]; +>strTuple : ["foo", "bar", "baz"] + +strTuple.copyWithin(0, 0); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +>strTuple.copyWithin(0, 0) : ("foo" | "bar" | "baz")[] +>strTuple.copyWithin : (target: number, start: number, end?: number) => ("foo" | "bar" | "baz")[] +>strTuple : ["foo", "bar", "baz"] +>copyWithin : (target: number, start: number, end?: number) => ("foo" | "bar" | "baz")[] +>0 : 0 +>0 : 0 + +var numTuple: [11, 2, 22, 1]; +>numTuple : [11, 2, 22, 1] + +numTuple.copyWithin(0, 0); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +>numTuple.copyWithin(0, 0) : (11 | 2 | 22 | 1)[] +>numTuple.copyWithin : (target: number, start: number, end?: number) => (11 | 2 | 22 | 1)[] +>numTuple : [11, 2, 22, 1] +>copyWithin : (target: number, start: number, end?: number) => (11 | 2 | 22 | 1)[] +>0 : 0 +>0 : 0 + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +>int8Array : Int8ArrayExtension + +int8Array.copyWithin(0, 0); // Int8Array +>int8Array.copyWithin(0, 0) : Int8Array +>int8Array.copyWithin : (target: number, start: number, end?: number) => Int8Array +>int8Array : Int8ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => Int8Array +>0 : 0 +>0 : 0 + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +>uint8Array : Uint8ArrayExtension + +uint8Array.copyWithin(0, 0); // Uint8Array +>uint8Array.copyWithin(0, 0) : Uint8Array +>uint8Array.copyWithin : (target: number, start: number, end?: number) => Uint8Array +>uint8Array : Uint8ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => Uint8Array +>0 : 0 +>0 : 0 + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +>uint8ClampedArray : Uint8ClampedArrayExtension + +uint8ClampedArray.copyWithin(0, 0); // Uint8ClampedArray +>uint8ClampedArray.copyWithin(0, 0) : Uint8ClampedArray +>uint8ClampedArray.copyWithin : (target: number, start: number, end?: number) => Uint8ClampedArray +>uint8ClampedArray : Uint8ClampedArrayExtension +>copyWithin : (target: number, start: number, end?: number) => Uint8ClampedArray +>0 : 0 +>0 : 0 + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +>int16Array : Int16ArrayExtension + +int16Array.copyWithin(0, 0); // Int16Array +>int16Array.copyWithin(0, 0) : Int16Array +>int16Array.copyWithin : (target: number, start: number, end?: number) => Int16Array +>int16Array : Int16ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => Int16Array +>0 : 0 +>0 : 0 + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +>uint16Array : Uint16ArrayExtension + +uint16Array.copyWithin(0, 0); // Uint16Array +>uint16Array.copyWithin(0, 0) : Uint16Array +>uint16Array.copyWithin : (target: number, start: number, end?: number) => Uint16Array +>uint16Array : Uint16ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => Uint16Array +>0 : 0 +>0 : 0 + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +>int32Array : Int32ArrayExtension + +int32Array.copyWithin(0, 0); // Int32Array +>int32Array.copyWithin(0, 0) : Int32Array +>int32Array.copyWithin : (target: number, start: number, end?: number) => Int32Array +>int32Array : Int32ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => Int32Array +>0 : 0 +>0 : 0 + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +>uint32Array : Uint32ArrayExtension + +uint32Array.copyWithin(0, 0); // Uint32Array +>uint32Array.copyWithin(0, 0) : Uint32Array +>uint32Array.copyWithin : (target: number, start: number, end?: number) => Uint32Array +>uint32Array : Uint32ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => Uint32Array +>0 : 0 +>0 : 0 + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +>float32Array : Float32ArrayExtension + +float32Array.copyWithin(0, 0); // Float32Array +>float32Array.copyWithin(0, 0) : Float32Array +>float32Array.copyWithin : (target: number, start: number, end?: number) => Float32Array +>float32Array : Float32ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => Float32Array +>0 : 0 +>0 : 0 + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +>float64Array : Float64ArrayExtension + +float64Array.copyWithin(0, 0); // Float64Array +>float64Array.copyWithin(0, 0) : Float64Array +>float64Array.copyWithin : (target: number, start: number, end?: number) => Float64Array +>float64Array : Float64ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => Float64Array +>0 : 0 +>0 : 0 + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +>bigInt64Array : BigInt64ArrayExtension + +bigInt64Array.copyWithin(0, 0); // BigInt64Array +>bigInt64Array.copyWithin(0, 0) : BigInt64Array +>bigInt64Array.copyWithin : (target: number, start: number, end?: number) => BigInt64Array +>bigInt64Array : BigInt64ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => BigInt64Array +>0 : 0 +>0 : 0 + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +>bigUint64Array : BigUint64ArrayExtension + +bigUint64Array.copyWithin(0, 0); // BigUint64Array +>bigUint64Array.copyWithin(0, 0) : BigUint64Array +>bigUint64Array.copyWithin : (target: number, start: number, end?: number) => BigUint64Array +>bigUint64Array : BigUint64ArrayExtension +>copyWithin : (target: number, start: number, end?: number) => BigUint64Array +>0 : 0 +>0 : 0 + diff --git a/tests/baselines/reference/arrayDestructuringInSwitch1.types b/tests/baselines/reference/arrayDestructuringInSwitch1.types index 56d48f6a30075..13cc44bbb1b8e 100644 --- a/tests/baselines/reference/arrayDestructuringInSwitch1.types +++ b/tests/baselines/reference/arrayDestructuringInSwitch1.types @@ -11,9 +11,9 @@ export function evaluate(expression: Expression): boolean { if (Array.isArray(expression)) { >Array.isArray(expression) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >expression : Expression const [operator, ...operands] = expression; diff --git a/tests/baselines/reference/arrayFill.js b/tests/baselines/reference/arrayFill.js new file mode 100644 index 0000000000000..aa13f1e28c8fd --- /dev/null +++ b/tests/baselines/reference/arrayFill.js @@ -0,0 +1,79 @@ +//// [arrayFill.ts] +var strTuple: ["foo", "bar", "baz"]; +strTuple.fill("foo"); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] + +var numTuple: [11, 2, 22, 1]; +numTuple.fill(11); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +int8Array.fill(0); // Int8Array + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +uint8Array.fill(0); // Uint8Array + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +uint8ClampedArray.fill(0); // Uint8ClampedArray + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +int16Array.fill(0); // Int16Array + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +uint16Array.fill(0); // Uint16Array + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +int32Array.fill(0); // Int32Array + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +uint32Array.fill(0); // Uint32Array + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +float32Array.fill(0); // Float32Array + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +float64Array.fill(0); // Float64Array + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +bigInt64Array.fill(0n); // BigInt64Array + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +bigUint64Array.fill(0n); // BigUint64Array + + +//// [arrayFill.js] +var strTuple; +strTuple.fill("foo"); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +var numTuple; +numTuple.fill(11); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +var int8Array; +int8Array.fill(0); // Int8Array +var uint8Array; +uint8Array.fill(0); // Uint8Array +var uint8ClampedArray; +uint8ClampedArray.fill(0); // Uint8ClampedArray +var int16Array; +int16Array.fill(0); // Int16Array +var uint16Array; +uint16Array.fill(0); // Uint16Array +var int32Array; +int32Array.fill(0); // Int32Array +var uint32Array; +uint32Array.fill(0); // Uint32Array +var float32Array; +float32Array.fill(0); // Float32Array +var float64Array; +float64Array.fill(0); // Float64Array +var bigInt64Array; +bigInt64Array.fill(0n); // BigInt64Array +var bigUint64Array; +bigUint64Array.fill(0n); // BigUint64Array diff --git a/tests/baselines/reference/arrayFill.symbols b/tests/baselines/reference/arrayFill.symbols new file mode 100644 index 0000000000000..0c9a65e888a07 --- /dev/null +++ b/tests/baselines/reference/arrayFill.symbols @@ -0,0 +1,160 @@ +=== tests/cases/compiler/arrayFill.ts === +var strTuple: ["foo", "bar", "baz"]; +>strTuple : Symbol(strTuple, Decl(arrayFill.ts, 0, 3)) + +strTuple.fill("foo"); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +>strTuple.fill : Symbol(Array.fill, Decl(lib.es2015.core.d.ts, --, --)) +>strTuple : Symbol(strTuple, Decl(arrayFill.ts, 0, 3)) +>fill : Symbol(Array.fill, Decl(lib.es2015.core.d.ts, --, --)) + +var numTuple: [11, 2, 22, 1]; +>numTuple : Symbol(numTuple, Decl(arrayFill.ts, 3, 3)) + +numTuple.fill(11); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +>numTuple.fill : Symbol(Array.fill, Decl(lib.es2015.core.d.ts, --, --)) +>numTuple : Symbol(numTuple, Decl(arrayFill.ts, 3, 3)) +>fill : Symbol(Array.fill, Decl(lib.es2015.core.d.ts, --, --)) + +interface Int8ArrayExtension extends Int8Array {} +>Int8ArrayExtension : Symbol(Int8ArrayExtension, Decl(arrayFill.ts, 4, 18)) +>Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int8Array: Int8ArrayExtension; +>int8Array : Symbol(int8Array, Decl(arrayFill.ts, 7, 3)) +>Int8ArrayExtension : Symbol(Int8ArrayExtension, Decl(arrayFill.ts, 4, 18)) + +int8Array.fill(0); // Int8Array +>int8Array.fill : Symbol(Int8Array.fill, Decl(lib.es5.d.ts, --, --)) +>int8Array : Symbol(int8Array, Decl(arrayFill.ts, 7, 3)) +>fill : Symbol(Int8Array.fill, Decl(lib.es5.d.ts, --, --)) + +interface Uint8ArrayExtension extends Uint8Array {} +>Uint8ArrayExtension : Symbol(Uint8ArrayExtension, Decl(arrayFill.ts, 8, 18)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8Array: Uint8ArrayExtension; +>uint8Array : Symbol(uint8Array, Decl(arrayFill.ts, 11, 3)) +>Uint8ArrayExtension : Symbol(Uint8ArrayExtension, Decl(arrayFill.ts, 8, 18)) + +uint8Array.fill(0); // Uint8Array +>uint8Array.fill : Symbol(Uint8Array.fill, Decl(lib.es5.d.ts, --, --)) +>uint8Array : Symbol(uint8Array, Decl(arrayFill.ts, 11, 3)) +>fill : Symbol(Uint8Array.fill, Decl(lib.es5.d.ts, --, --)) + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +>Uint8ClampedArrayExtension : Symbol(Uint8ClampedArrayExtension, Decl(arrayFill.ts, 12, 19)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8ClampedArray: Uint8ClampedArrayExtension; +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayFill.ts, 15, 3)) +>Uint8ClampedArrayExtension : Symbol(Uint8ClampedArrayExtension, Decl(arrayFill.ts, 12, 19)) + +uint8ClampedArray.fill(0); // Uint8ClampedArray +>uint8ClampedArray.fill : Symbol(Uint8ClampedArray.fill, Decl(lib.es5.d.ts, --, --)) +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayFill.ts, 15, 3)) +>fill : Symbol(Uint8ClampedArray.fill, Decl(lib.es5.d.ts, --, --)) + +interface Int16ArrayExtension extends Int16Array {} +>Int16ArrayExtension : Symbol(Int16ArrayExtension, Decl(arrayFill.ts, 16, 26)) +>Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int16Array: Int16ArrayExtension; +>int16Array : Symbol(int16Array, Decl(arrayFill.ts, 19, 3)) +>Int16ArrayExtension : Symbol(Int16ArrayExtension, Decl(arrayFill.ts, 16, 26)) + +int16Array.fill(0); // Int16Array +>int16Array.fill : Symbol(Int16Array.fill, Decl(lib.es5.d.ts, --, --)) +>int16Array : Symbol(int16Array, Decl(arrayFill.ts, 19, 3)) +>fill : Symbol(Int16Array.fill, Decl(lib.es5.d.ts, --, --)) + +interface Uint16ArrayExtension extends Uint16Array {} +>Uint16ArrayExtension : Symbol(Uint16ArrayExtension, Decl(arrayFill.ts, 20, 19)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint16Array: Uint16ArrayExtension; +>uint16Array : Symbol(uint16Array, Decl(arrayFill.ts, 23, 3)) +>Uint16ArrayExtension : Symbol(Uint16ArrayExtension, Decl(arrayFill.ts, 20, 19)) + +uint16Array.fill(0); // Uint16Array +>uint16Array.fill : Symbol(Uint16Array.fill, Decl(lib.es5.d.ts, --, --)) +>uint16Array : Symbol(uint16Array, Decl(arrayFill.ts, 23, 3)) +>fill : Symbol(Uint16Array.fill, Decl(lib.es5.d.ts, --, --)) + +interface Int32ArrayExtension extends Int32Array {} +>Int32ArrayExtension : Symbol(Int32ArrayExtension, Decl(arrayFill.ts, 24, 20)) +>Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int32Array: Int32ArrayExtension; +>int32Array : Symbol(int32Array, Decl(arrayFill.ts, 27, 3)) +>Int32ArrayExtension : Symbol(Int32ArrayExtension, Decl(arrayFill.ts, 24, 20)) + +int32Array.fill(0); // Int32Array +>int32Array.fill : Symbol(Int32Array.fill, Decl(lib.es5.d.ts, --, --)) +>int32Array : Symbol(int32Array, Decl(arrayFill.ts, 27, 3)) +>fill : Symbol(Int32Array.fill, Decl(lib.es5.d.ts, --, --)) + +interface Uint32ArrayExtension extends Uint32Array {} +>Uint32ArrayExtension : Symbol(Uint32ArrayExtension, Decl(arrayFill.ts, 28, 19)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint32Array: Uint32ArrayExtension; +>uint32Array : Symbol(uint32Array, Decl(arrayFill.ts, 31, 3)) +>Uint32ArrayExtension : Symbol(Uint32ArrayExtension, Decl(arrayFill.ts, 28, 19)) + +uint32Array.fill(0); // Uint32Array +>uint32Array.fill : Symbol(Uint32Array.fill, Decl(lib.es5.d.ts, --, --)) +>uint32Array : Symbol(uint32Array, Decl(arrayFill.ts, 31, 3)) +>fill : Symbol(Uint32Array.fill, Decl(lib.es5.d.ts, --, --)) + +interface Float32ArrayExtension extends Float32Array {} +>Float32ArrayExtension : Symbol(Float32ArrayExtension, Decl(arrayFill.ts, 32, 20)) +>Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float32Array: Float32ArrayExtension; +>float32Array : Symbol(float32Array, Decl(arrayFill.ts, 35, 3)) +>Float32ArrayExtension : Symbol(Float32ArrayExtension, Decl(arrayFill.ts, 32, 20)) + +float32Array.fill(0); // Float32Array +>float32Array.fill : Symbol(Float32Array.fill, Decl(lib.es5.d.ts, --, --)) +>float32Array : Symbol(float32Array, Decl(arrayFill.ts, 35, 3)) +>fill : Symbol(Float32Array.fill, Decl(lib.es5.d.ts, --, --)) + +interface Float64ArrayExtension extends Float64Array {} +>Float64ArrayExtension : Symbol(Float64ArrayExtension, Decl(arrayFill.ts, 36, 21)) +>Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float64Array: Float64ArrayExtension; +>float64Array : Symbol(float64Array, Decl(arrayFill.ts, 39, 3)) +>Float64ArrayExtension : Symbol(Float64ArrayExtension, Decl(arrayFill.ts, 36, 21)) + +float64Array.fill(0); // Float64Array +>float64Array.fill : Symbol(Float64Array.fill, Decl(lib.es5.d.ts, --, --)) +>float64Array : Symbol(float64Array, Decl(arrayFill.ts, 39, 3)) +>fill : Symbol(Float64Array.fill, Decl(lib.es5.d.ts, --, --)) + +interface BigInt64ArrayExtension extends BigInt64Array {} +>BigInt64ArrayExtension : Symbol(BigInt64ArrayExtension, Decl(arrayFill.ts, 40, 21)) +>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +var bigInt64Array: BigInt64ArrayExtension; +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayFill.ts, 43, 3)) +>BigInt64ArrayExtension : Symbol(BigInt64ArrayExtension, Decl(arrayFill.ts, 40, 21)) + +bigInt64Array.fill(0n); // BigInt64Array +>bigInt64Array.fill : Symbol(BigInt64Array.fill, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayFill.ts, 43, 3)) +>fill : Symbol(BigInt64Array.fill, Decl(lib.es2020.bigint.d.ts, --, --)) + +interface BigUint64ArrayExtension extends BigUint64Array {} +>BigUint64ArrayExtension : Symbol(BigUint64ArrayExtension, Decl(arrayFill.ts, 44, 23)) +>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +var bigUint64Array: BigUint64ArrayExtension; +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayFill.ts, 47, 3)) +>BigUint64ArrayExtension : Symbol(BigUint64ArrayExtension, Decl(arrayFill.ts, 44, 23)) + +bigUint64Array.fill(0n); // BigUint64Array +>bigUint64Array.fill : Symbol(BigUint64Array.fill, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayFill.ts, 47, 3)) +>fill : Symbol(BigUint64Array.fill, Decl(lib.es2020.bigint.d.ts, --, --)) + diff --git a/tests/baselines/reference/arrayFill.types b/tests/baselines/reference/arrayFill.types new file mode 100644 index 0000000000000..1fda958eba186 --- /dev/null +++ b/tests/baselines/reference/arrayFill.types @@ -0,0 +1,142 @@ +=== tests/cases/compiler/arrayFill.ts === +var strTuple: ["foo", "bar", "baz"]; +>strTuple : ["foo", "bar", "baz"] + +strTuple.fill("foo"); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +>strTuple.fill("foo") : ("foo" | "bar" | "baz")[] +>strTuple.fill : (value: "foo" | "bar" | "baz", start?: number, end?: number) => ("foo" | "bar" | "baz")[] +>strTuple : ["foo", "bar", "baz"] +>fill : (value: "foo" | "bar" | "baz", start?: number, end?: number) => ("foo" | "bar" | "baz")[] +>"foo" : "foo" + +var numTuple: [11, 2, 22, 1]; +>numTuple : [11, 2, 22, 1] + +numTuple.fill(11); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +>numTuple.fill(11) : (11 | 2 | 22 | 1)[] +>numTuple.fill : (value: 11 | 2 | 22 | 1, start?: number, end?: number) => (11 | 2 | 22 | 1)[] +>numTuple : [11, 2, 22, 1] +>fill : (value: 11 | 2 | 22 | 1, start?: number, end?: number) => (11 | 2 | 22 | 1)[] +>11 : 11 + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +>int8Array : Int8ArrayExtension + +int8Array.fill(0); // Int8Array +>int8Array.fill(0) : Int8Array +>int8Array.fill : (value: number, start?: number, end?: number) => Int8Array +>int8Array : Int8ArrayExtension +>fill : (value: number, start?: number, end?: number) => Int8Array +>0 : 0 + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +>uint8Array : Uint8ArrayExtension + +uint8Array.fill(0); // Uint8Array +>uint8Array.fill(0) : Uint8Array +>uint8Array.fill : (value: number, start?: number, end?: number) => Uint8Array +>uint8Array : Uint8ArrayExtension +>fill : (value: number, start?: number, end?: number) => Uint8Array +>0 : 0 + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +>uint8ClampedArray : Uint8ClampedArrayExtension + +uint8ClampedArray.fill(0); // Uint8ClampedArray +>uint8ClampedArray.fill(0) : Uint8ClampedArray +>uint8ClampedArray.fill : (value: number, start?: number, end?: number) => Uint8ClampedArray +>uint8ClampedArray : Uint8ClampedArrayExtension +>fill : (value: number, start?: number, end?: number) => Uint8ClampedArray +>0 : 0 + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +>int16Array : Int16ArrayExtension + +int16Array.fill(0); // Int16Array +>int16Array.fill(0) : Int16Array +>int16Array.fill : (value: number, start?: number, end?: number) => Int16Array +>int16Array : Int16ArrayExtension +>fill : (value: number, start?: number, end?: number) => Int16Array +>0 : 0 + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +>uint16Array : Uint16ArrayExtension + +uint16Array.fill(0); // Uint16Array +>uint16Array.fill(0) : Uint16Array +>uint16Array.fill : (value: number, start?: number, end?: number) => Uint16Array +>uint16Array : Uint16ArrayExtension +>fill : (value: number, start?: number, end?: number) => Uint16Array +>0 : 0 + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +>int32Array : Int32ArrayExtension + +int32Array.fill(0); // Int32Array +>int32Array.fill(0) : Int32Array +>int32Array.fill : (value: number, start?: number, end?: number) => Int32Array +>int32Array : Int32ArrayExtension +>fill : (value: number, start?: number, end?: number) => Int32Array +>0 : 0 + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +>uint32Array : Uint32ArrayExtension + +uint32Array.fill(0); // Uint32Array +>uint32Array.fill(0) : Uint32Array +>uint32Array.fill : (value: number, start?: number, end?: number) => Uint32Array +>uint32Array : Uint32ArrayExtension +>fill : (value: number, start?: number, end?: number) => Uint32Array +>0 : 0 + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +>float32Array : Float32ArrayExtension + +float32Array.fill(0); // Float32Array +>float32Array.fill(0) : Float32Array +>float32Array.fill : (value: number, start?: number, end?: number) => Float32Array +>float32Array : Float32ArrayExtension +>fill : (value: number, start?: number, end?: number) => Float32Array +>0 : 0 + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +>float64Array : Float64ArrayExtension + +float64Array.fill(0); // Float64Array +>float64Array.fill(0) : Float64Array +>float64Array.fill : (value: number, start?: number, end?: number) => Float64Array +>float64Array : Float64ArrayExtension +>fill : (value: number, start?: number, end?: number) => Float64Array +>0 : 0 + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +>bigInt64Array : BigInt64ArrayExtension + +bigInt64Array.fill(0n); // BigInt64Array +>bigInt64Array.fill(0n) : BigInt64Array +>bigInt64Array.fill : (value: bigint, start?: number, end?: number) => BigInt64Array +>bigInt64Array : BigInt64ArrayExtension +>fill : (value: bigint, start?: number, end?: number) => BigInt64Array +>0n : 0n + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +>bigUint64Array : BigUint64ArrayExtension + +bigUint64Array.fill(0n); // BigUint64Array +>bigUint64Array.fill(0n) : BigUint64Array +>bigUint64Array.fill : (value: bigint, start?: number, end?: number) => BigUint64Array +>bigUint64Array : BigUint64ArrayExtension +>fill : (value: bigint, start?: number, end?: number) => BigUint64Array +>0n : 0n + diff --git a/tests/baselines/reference/arrayFind.types b/tests/baselines/reference/arrayFind.types index 9ba393d76212c..68e0cff925568 100644 --- a/tests/baselines/reference/arrayFind.types +++ b/tests/baselines/reference/arrayFind.types @@ -24,9 +24,9 @@ const arrayOfStringsNumbersAndBooleans = ["string", false, 0, "strung", 1, true] const foundNumber: number | undefined = arrayOfStringsNumbersAndBooleans.find(isNumber); >foundNumber : number >arrayOfStringsNumbersAndBooleans.find(isNumber) : number ->arrayOfStringsNumbersAndBooleans.find : { (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } +>arrayOfStringsNumbersAndBooleans.find : { (predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } >arrayOfStringsNumbersAndBooleans : (string | number | boolean)[] ->find : { (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } +>find : { (predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } >isNumber : (x: any) => x is number const readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBooleans as ReadonlyArray; @@ -37,8 +37,8 @@ const readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBoolean const readonlyFoundNumber: number | undefined = readonlyArrayOfStringsNumbersAndBooleans.find(isNumber); >readonlyFoundNumber : number >readonlyArrayOfStringsNumbersAndBooleans.find(isNumber) : number ->readonlyArrayOfStringsNumbersAndBooleans.find : { (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } +>readonlyArrayOfStringsNumbersAndBooleans.find : { (predicate: (value: string | number | boolean, index: number, array: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, array: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } >readonlyArrayOfStringsNumbersAndBooleans : readonly (string | number | boolean)[] ->find : { (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } +>find : { (predicate: (value: string | number | boolean, index: number, array: readonly (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, array: readonly (string | number | boolean)[]) => unknown, thisArg?: any): string | number | boolean; } >isNumber : (x: any) => x is number diff --git a/tests/baselines/reference/arrayFlatMap.types b/tests/baselines/reference/arrayFlatMap.types index 0e36141f64b64..0c9bec17629ea 100644 --- a/tests/baselines/reference/arrayFlatMap.types +++ b/tests/baselines/reference/arrayFlatMap.types @@ -9,17 +9,17 @@ const readonlyArray: ReadonlyArray = []; array.flatMap((): ReadonlyArray => []); // ok >array.flatMap((): ReadonlyArray => []) : number[] ->array.flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[] +>array.flatMap : (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[] >array : number[] ->flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[] +>flatMap : (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[] >(): ReadonlyArray => [] : () => ReadonlyArray >[] : undefined[] readonlyArray.flatMap((): ReadonlyArray => []); // ok >readonlyArray.flatMap((): ReadonlyArray => []) : number[] ->readonlyArray.flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[] +>readonlyArray.flatMap : (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[] >readonlyArray : readonly number[] ->flatMap : (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[] +>flatMap : (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[] >(): ReadonlyArray => [] : () => ReadonlyArray >[] : undefined[] diff --git a/tests/baselines/reference/arrayFrom.symbols b/tests/baselines/reference/arrayFrom.symbols index 29ccb93a2e6bf..691ae02f2e1ed 100644 --- a/tests/baselines/reference/arrayFrom.symbols +++ b/tests/baselines/reference/arrayFrom.symbols @@ -44,17 +44,17 @@ const inputASet = new Set(); const result1: A[] = Array.from(inputA); >result1 : Symbol(result1, Decl(arrayFrom.ts, 17, 5)) >A : Symbol(A, Decl(arrayFrom.ts, 0, 0)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputA : Symbol(inputA, Decl(arrayFrom.ts, 11, 5)) const result2: A[] = Array.from(inputA.values()); >result2 : Symbol(result2, Decl(arrayFrom.ts, 18, 5)) >A : Symbol(A, Decl(arrayFrom.ts, 0, 0)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputA.values : Symbol(Array.values, Decl(lib.es2015.iterable.d.ts, --, --)) >inputA : Symbol(inputA, Decl(arrayFrom.ts, 11, 5)) >values : Symbol(Array.values, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -62,9 +62,9 @@ const result2: A[] = Array.from(inputA.values()); const result3: B[] = Array.from(inputA.values()); // expect error >result3 : Symbol(result3, Decl(arrayFrom.ts, 19, 5)) >B : Symbol(B, Decl(arrayFrom.ts, 5, 1)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputA.values : Symbol(Array.values, Decl(lib.es2015.iterable.d.ts, --, --)) >inputA : Symbol(inputA, Decl(arrayFrom.ts, 11, 5)) >values : Symbol(Array.values, Decl(lib.es2015.iterable.d.ts, --, --)) @@ -72,9 +72,9 @@ const result3: B[] = Array.from(inputA.values()); // expect error const result4: A[] = Array.from(inputB, ({ b }): A => ({ a: b })); >result4 : Symbol(result4, Decl(arrayFrom.ts, 20, 5)) >A : Symbol(A, Decl(arrayFrom.ts, 0, 0)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputB : Symbol(inputB, Decl(arrayFrom.ts, 12, 5)) >b : Symbol(b, Decl(arrayFrom.ts, 20, 42)) >A : Symbol(A, Decl(arrayFrom.ts, 0, 0)) @@ -84,25 +84,25 @@ const result4: A[] = Array.from(inputB, ({ b }): A => ({ a: b })); const result5: A[] = Array.from(inputALike); >result5 : Symbol(result5, Decl(arrayFrom.ts, 21, 5)) >A : Symbol(A, Decl(arrayFrom.ts, 0, 0)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputALike : Symbol(inputALike, Decl(arrayFrom.ts, 13, 5)) const result6: B[] = Array.from(inputALike); // expect error >result6 : Symbol(result6, Decl(arrayFrom.ts, 22, 5)) >B : Symbol(B, Decl(arrayFrom.ts, 5, 1)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputALike : Symbol(inputALike, Decl(arrayFrom.ts, 13, 5)) const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a })); >result7 : Symbol(result7, Decl(arrayFrom.ts, 23, 5)) >B : Symbol(B, Decl(arrayFrom.ts, 5, 1)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputALike : Symbol(inputALike, Decl(arrayFrom.ts, 13, 5)) >a : Symbol(a, Decl(arrayFrom.ts, 23, 46)) >B : Symbol(B, Decl(arrayFrom.ts, 5, 1)) @@ -112,17 +112,17 @@ const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a })); const result8: A[] = Array.from(inputARand); >result8 : Symbol(result8, Decl(arrayFrom.ts, 24, 5)) >A : Symbol(A, Decl(arrayFrom.ts, 0, 0)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputARand : Symbol(inputARand, Decl(arrayFrom.ts, 14, 5)) const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a })); >result9 : Symbol(result9, Decl(arrayFrom.ts, 25, 5)) >B : Symbol(B, Decl(arrayFrom.ts, 5, 1)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputARand : Symbol(inputARand, Decl(arrayFrom.ts, 14, 5)) >a : Symbol(a, Decl(arrayFrom.ts, 25, 46)) >B : Symbol(B, Decl(arrayFrom.ts, 5, 1)) @@ -132,18 +132,18 @@ const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a })); const result10: A[] = Array.from(new Set()); >result10 : Symbol(result10, Decl(arrayFrom.ts, 26, 5)) >A : Symbol(A, Decl(arrayFrom.ts, 0, 0)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Set : Symbol(Set, Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >A : Symbol(A, Decl(arrayFrom.ts, 0, 0)) const result11: B[] = Array.from(inputASet, ({ a }): B => ({ b: a })); >result11 : Symbol(result11, Decl(arrayFrom.ts, 27, 5)) >B : Symbol(B, Decl(arrayFrom.ts, 5, 1)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >inputASet : Symbol(inputASet, Decl(arrayFrom.ts, 15, 5)) >a : Symbol(a, Decl(arrayFrom.ts, 27, 46)) >B : Symbol(B, Decl(arrayFrom.ts, 5, 1)) diff --git a/tests/baselines/reference/arrayFrom.types b/tests/baselines/reference/arrayFrom.types index 8c755a6366f8a..4a6aeeb2d5b0f 100644 --- a/tests/baselines/reference/arrayFrom.types +++ b/tests/baselines/reference/arrayFrom.types @@ -41,17 +41,17 @@ const inputASet = new Set(); const result1: A[] = Array.from(inputA); >result1 : A[] >Array.from(inputA) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputA : A[] const result2: A[] = Array.from(inputA.values()); >result2 : A[] >Array.from(inputA.values()) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputA.values() : IterableIterator >inputA.values : () => IterableIterator >inputA : A[] @@ -60,9 +60,9 @@ const result2: A[] = Array.from(inputA.values()); const result3: B[] = Array.from(inputA.values()); // expect error >result3 : B[] >Array.from(inputA.values()) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputA.values() : IterableIterator >inputA.values : () => IterableIterator >inputA : A[] @@ -71,9 +71,9 @@ const result3: B[] = Array.from(inputA.values()); // expect error const result4: A[] = Array.from(inputB, ({ b }): A => ({ a: b })); >result4 : A[] >Array.from(inputB, ({ b }): A => ({ a: b })) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputB : B[] >({ b }): A => ({ a: b }) : ({ b }: B) => A >b : string @@ -85,25 +85,25 @@ const result4: A[] = Array.from(inputB, ({ b }): A => ({ a: b })); const result5: A[] = Array.from(inputALike); >result5 : A[] >Array.from(inputALike) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputALike : ArrayLike const result6: B[] = Array.from(inputALike); // expect error >result6 : B[] >Array.from(inputALike) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputALike : ArrayLike const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a })); >result7 : B[] >Array.from(inputALike, ({ a }): B => ({ b: a })) : B[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputALike : ArrayLike >({ a }): B => ({ b: a }) : ({ a }: A) => B >a : string @@ -115,17 +115,17 @@ const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a })); const result8: A[] = Array.from(inputARand); >result8 : A[] >Array.from(inputARand) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputARand : ArrayLike | Iterable const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a })); >result9 : B[] >Array.from(inputARand, ({ a }): B => ({ b: a })) : B[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputARand : ArrayLike | Iterable >({ a }): B => ({ b: a }) : ({ a }: A) => B >a : string @@ -137,18 +137,18 @@ const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a })); const result10: A[] = Array.from(new Set()); >result10 : A[] >Array.from(new Set()) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >new Set() : Set >Set : SetConstructor const result11: B[] = Array.from(inputASet, ({ a }): B => ({ b: a })); >result11 : B[] >Array.from(inputASet, ({ a }): B => ({ b: a })) : B[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >inputASet : Set >({ a }): B => ({ b: a }) : ({ a }: A) => B >a : string diff --git a/tests/baselines/reference/arrayMethodPredicates.js b/tests/baselines/reference/arrayMethodPredicates.js new file mode 100644 index 0000000000000..bb1d30dad7d1b --- /dev/null +++ b/tests/baselines/reference/arrayMethodPredicates.js @@ -0,0 +1,165 @@ +//// [arrayMethodPredicates.ts] +var array: number[]; +var readonlyArray: readonly number[]; +var int8Array: Int8Array; +var uint8Array: Uint8Array; +var uint8ClampedArray: Uint8ClampedArray; +var int16Array: Int16Array; +var uint16Array: Uint16Array; +var int32Array: Int32Array; +var uint32Array: Uint32Array; +var float32Array: Float32Array; +var float64Array: Float64Array; +var bigInt64Array: BigInt64Array; +var bigUint64Array: BigUint64Array; + +array.every(x => x); +readonlyArray.every(x => x); +int8Array.every(x => x); +uint8Array.every(x => x); +uint8ClampedArray.every(x => x); +int16Array.every(x => x); +uint16Array.every(x => x); +int32Array.every(x => x); +uint32Array.every(x => x); +float32Array.every(x => x); +float64Array.every(x => x); +bigInt64Array.every(x => x); +bigUint64Array.every(x => x); + +array.filter(x => x); +readonlyArray.filter(x => x); +int8Array.filter(x => x); +uint8Array.filter(x => x); +uint8ClampedArray.filter(x => x); +int16Array.filter(x => x); +uint16Array.filter(x => x); +int32Array.filter(x => x); +uint32Array.filter(x => x); +float32Array.filter(x => x); +float64Array.filter(x => x); +bigInt64Array.filter(x => x); +bigUint64Array.filter(x => x); + +array.find(x => x); +readonlyArray.find(x => x); +int8Array.find(x => x); +uint8Array.find(x => x); +uint8ClampedArray.find(x => x); +int16Array.find(x => x); +uint16Array.find(x => x); +int32Array.find(x => x); +uint32Array.find(x => x); +float32Array.find(x => x); +float64Array.find(x => x); +bigInt64Array.find(x => x); +bigUint64Array.find(x => x); + +array.findIndex(x => x); +readonlyArray.findIndex(x => x); +int8Array.findIndex(x => x); +uint8Array.findIndex(x => x); +uint8ClampedArray.findIndex(x => x); +int16Array.findIndex(x => x); +uint16Array.findIndex(x => x); +int32Array.findIndex(x => x); +uint32Array.findIndex(x => x); +float32Array.findIndex(x => x); +float64Array.findIndex(x => x); +bigInt64Array.findIndex(x => x); +bigUint64Array.findIndex(x => x); + +array.some(x => x); +readonlyArray.some(x => x); +int8Array.some(x => x); +uint8Array.some(x => x); +uint8ClampedArray.some(x => x); +int16Array.some(x => x); +uint16Array.some(x => x); +int32Array.some(x => x); +uint32Array.some(x => x); +float32Array.some(x => x); +float64Array.some(x => x); +bigInt64Array.some(x => x); +bigUint64Array.some(x => x); + + +//// [arrayMethodPredicates.js] +var array; +var readonlyArray; +var int8Array; +var uint8Array; +var uint8ClampedArray; +var int16Array; +var uint16Array; +var int32Array; +var uint32Array; +var float32Array; +var float64Array; +var bigInt64Array; +var bigUint64Array; +array.every(function (x) { return x; }); +readonlyArray.every(function (x) { return x; }); +int8Array.every(function (x) { return x; }); +uint8Array.every(function (x) { return x; }); +uint8ClampedArray.every(function (x) { return x; }); +int16Array.every(function (x) { return x; }); +uint16Array.every(function (x) { return x; }); +int32Array.every(function (x) { return x; }); +uint32Array.every(function (x) { return x; }); +float32Array.every(function (x) { return x; }); +float64Array.every(function (x) { return x; }); +bigInt64Array.every(function (x) { return x; }); +bigUint64Array.every(function (x) { return x; }); +array.filter(function (x) { return x; }); +readonlyArray.filter(function (x) { return x; }); +int8Array.filter(function (x) { return x; }); +uint8Array.filter(function (x) { return x; }); +uint8ClampedArray.filter(function (x) { return x; }); +int16Array.filter(function (x) { return x; }); +uint16Array.filter(function (x) { return x; }); +int32Array.filter(function (x) { return x; }); +uint32Array.filter(function (x) { return x; }); +float32Array.filter(function (x) { return x; }); +float64Array.filter(function (x) { return x; }); +bigInt64Array.filter(function (x) { return x; }); +bigUint64Array.filter(function (x) { return x; }); +array.find(function (x) { return x; }); +readonlyArray.find(function (x) { return x; }); +int8Array.find(function (x) { return x; }); +uint8Array.find(function (x) { return x; }); +uint8ClampedArray.find(function (x) { return x; }); +int16Array.find(function (x) { return x; }); +uint16Array.find(function (x) { return x; }); +int32Array.find(function (x) { return x; }); +uint32Array.find(function (x) { return x; }); +float32Array.find(function (x) { return x; }); +float64Array.find(function (x) { return x; }); +bigInt64Array.find(function (x) { return x; }); +bigUint64Array.find(function (x) { return x; }); +array.findIndex(function (x) { return x; }); +readonlyArray.findIndex(function (x) { return x; }); +int8Array.findIndex(function (x) { return x; }); +uint8Array.findIndex(function (x) { return x; }); +uint8ClampedArray.findIndex(function (x) { return x; }); +int16Array.findIndex(function (x) { return x; }); +uint16Array.findIndex(function (x) { return x; }); +int32Array.findIndex(function (x) { return x; }); +uint32Array.findIndex(function (x) { return x; }); +float32Array.findIndex(function (x) { return x; }); +float64Array.findIndex(function (x) { return x; }); +bigInt64Array.findIndex(function (x) { return x; }); +bigUint64Array.findIndex(function (x) { return x; }); +array.some(function (x) { return x; }); +readonlyArray.some(function (x) { return x; }); +int8Array.some(function (x) { return x; }); +uint8Array.some(function (x) { return x; }); +uint8ClampedArray.some(function (x) { return x; }); +int16Array.some(function (x) { return x; }); +uint16Array.some(function (x) { return x; }); +int32Array.some(function (x) { return x; }); +uint32Array.some(function (x) { return x; }); +float32Array.some(function (x) { return x; }); +float64Array.some(function (x) { return x; }); +bigInt64Array.some(function (x) { return x; }); +bigUint64Array.some(function (x) { return x; }); diff --git a/tests/baselines/reference/arrayMethodPredicates.symbols b/tests/baselines/reference/arrayMethodPredicates.symbols new file mode 100644 index 0000000000000..50f9b30f6ee14 --- /dev/null +++ b/tests/baselines/reference/arrayMethodPredicates.symbols @@ -0,0 +1,506 @@ +=== tests/cases/compiler/arrayMethodPredicates.ts === +var array: number[]; +>array : Symbol(array, Decl(arrayMethodPredicates.ts, 0, 3)) + +var readonlyArray: readonly number[]; +>readonlyArray : Symbol(readonlyArray, Decl(arrayMethodPredicates.ts, 1, 3)) + +var int8Array: Int8Array; +>int8Array : Symbol(int8Array, Decl(arrayMethodPredicates.ts, 2, 3)) +>Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8Array: Uint8Array; +>uint8Array : Symbol(uint8Array, Decl(arrayMethodPredicates.ts, 3, 3)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8ClampedArray: Uint8ClampedArray; +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayMethodPredicates.ts, 4, 3)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int16Array: Int16Array; +>int16Array : Symbol(int16Array, Decl(arrayMethodPredicates.ts, 5, 3)) +>Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint16Array: Uint16Array; +>uint16Array : Symbol(uint16Array, Decl(arrayMethodPredicates.ts, 6, 3)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int32Array: Int32Array; +>int32Array : Symbol(int32Array, Decl(arrayMethodPredicates.ts, 7, 3)) +>Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint32Array: Uint32Array; +>uint32Array : Symbol(uint32Array, Decl(arrayMethodPredicates.ts, 8, 3)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float32Array: Float32Array; +>float32Array : Symbol(float32Array, Decl(arrayMethodPredicates.ts, 9, 3)) +>Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float64Array: Float64Array; +>float64Array : Symbol(float64Array, Decl(arrayMethodPredicates.ts, 10, 3)) +>Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var bigInt64Array: BigInt64Array; +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayMethodPredicates.ts, 11, 3)) +>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +var bigUint64Array: BigUint64Array; +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayMethodPredicates.ts, 12, 3)) +>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +array.every(x => x); +>array.every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>array : Symbol(array, Decl(arrayMethodPredicates.ts, 0, 3)) +>every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 14, 12)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 14, 12)) + +readonlyArray.every(x => x); +>readonlyArray.every : Symbol(ReadonlyArray.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>readonlyArray : Symbol(readonlyArray, Decl(arrayMethodPredicates.ts, 1, 3)) +>every : Symbol(ReadonlyArray.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 15, 20)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 15, 20)) + +int8Array.every(x => x); +>int8Array.every : Symbol(Int8Array.every, Decl(lib.es5.d.ts, --, --)) +>int8Array : Symbol(int8Array, Decl(arrayMethodPredicates.ts, 2, 3)) +>every : Symbol(Int8Array.every, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 16, 16)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 16, 16)) + +uint8Array.every(x => x); +>uint8Array.every : Symbol(Uint8Array.every, Decl(lib.es5.d.ts, --, --)) +>uint8Array : Symbol(uint8Array, Decl(arrayMethodPredicates.ts, 3, 3)) +>every : Symbol(Uint8Array.every, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 17, 17)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 17, 17)) + +uint8ClampedArray.every(x => x); +>uint8ClampedArray.every : Symbol(Uint8ClampedArray.every, Decl(lib.es5.d.ts, --, --)) +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayMethodPredicates.ts, 4, 3)) +>every : Symbol(Uint8ClampedArray.every, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 18, 24)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 18, 24)) + +int16Array.every(x => x); +>int16Array.every : Symbol(Int16Array.every, Decl(lib.es5.d.ts, --, --)) +>int16Array : Symbol(int16Array, Decl(arrayMethodPredicates.ts, 5, 3)) +>every : Symbol(Int16Array.every, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 19, 17)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 19, 17)) + +uint16Array.every(x => x); +>uint16Array.every : Symbol(Uint16Array.every, Decl(lib.es5.d.ts, --, --)) +>uint16Array : Symbol(uint16Array, Decl(arrayMethodPredicates.ts, 6, 3)) +>every : Symbol(Uint16Array.every, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 20, 18)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 20, 18)) + +int32Array.every(x => x); +>int32Array.every : Symbol(Int32Array.every, Decl(lib.es5.d.ts, --, --)) +>int32Array : Symbol(int32Array, Decl(arrayMethodPredicates.ts, 7, 3)) +>every : Symbol(Int32Array.every, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 21, 17)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 21, 17)) + +uint32Array.every(x => x); +>uint32Array.every : Symbol(Uint32Array.every, Decl(lib.es5.d.ts, --, --)) +>uint32Array : Symbol(uint32Array, Decl(arrayMethodPredicates.ts, 8, 3)) +>every : Symbol(Uint32Array.every, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 22, 18)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 22, 18)) + +float32Array.every(x => x); +>float32Array.every : Symbol(Float32Array.every, Decl(lib.es5.d.ts, --, --)) +>float32Array : Symbol(float32Array, Decl(arrayMethodPredicates.ts, 9, 3)) +>every : Symbol(Float32Array.every, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 23, 19)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 23, 19)) + +float64Array.every(x => x); +>float64Array.every : Symbol(Float64Array.every, Decl(lib.es5.d.ts, --, --)) +>float64Array : Symbol(float64Array, Decl(arrayMethodPredicates.ts, 10, 3)) +>every : Symbol(Float64Array.every, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 24, 19)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 24, 19)) + +bigInt64Array.every(x => x); +>bigInt64Array.every : Symbol(BigInt64Array.every, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayMethodPredicates.ts, 11, 3)) +>every : Symbol(BigInt64Array.every, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 25, 20)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 25, 20)) + +bigUint64Array.every(x => x); +>bigUint64Array.every : Symbol(BigUint64Array.every, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayMethodPredicates.ts, 12, 3)) +>every : Symbol(BigUint64Array.every, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 26, 21)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 26, 21)) + +array.filter(x => x); +>array.filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>array : Symbol(array, Decl(arrayMethodPredicates.ts, 0, 3)) +>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 28, 13)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 28, 13)) + +readonlyArray.filter(x => x); +>readonlyArray.filter : Symbol(ReadonlyArray.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>readonlyArray : Symbol(readonlyArray, Decl(arrayMethodPredicates.ts, 1, 3)) +>filter : Symbol(ReadonlyArray.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 29, 21)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 29, 21)) + +int8Array.filter(x => x); +>int8Array.filter : Symbol(Int8Array.filter, Decl(lib.es5.d.ts, --, --)) +>int8Array : Symbol(int8Array, Decl(arrayMethodPredicates.ts, 2, 3)) +>filter : Symbol(Int8Array.filter, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 30, 17)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 30, 17)) + +uint8Array.filter(x => x); +>uint8Array.filter : Symbol(Uint8Array.filter, Decl(lib.es5.d.ts, --, --)) +>uint8Array : Symbol(uint8Array, Decl(arrayMethodPredicates.ts, 3, 3)) +>filter : Symbol(Uint8Array.filter, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 31, 18)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 31, 18)) + +uint8ClampedArray.filter(x => x); +>uint8ClampedArray.filter : Symbol(Uint8ClampedArray.filter, Decl(lib.es5.d.ts, --, --)) +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayMethodPredicates.ts, 4, 3)) +>filter : Symbol(Uint8ClampedArray.filter, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 32, 25)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 32, 25)) + +int16Array.filter(x => x); +>int16Array.filter : Symbol(Int16Array.filter, Decl(lib.es5.d.ts, --, --)) +>int16Array : Symbol(int16Array, Decl(arrayMethodPredicates.ts, 5, 3)) +>filter : Symbol(Int16Array.filter, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 33, 18)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 33, 18)) + +uint16Array.filter(x => x); +>uint16Array.filter : Symbol(Uint16Array.filter, Decl(lib.es5.d.ts, --, --)) +>uint16Array : Symbol(uint16Array, Decl(arrayMethodPredicates.ts, 6, 3)) +>filter : Symbol(Uint16Array.filter, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 34, 19)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 34, 19)) + +int32Array.filter(x => x); +>int32Array.filter : Symbol(Int32Array.filter, Decl(lib.es5.d.ts, --, --)) +>int32Array : Symbol(int32Array, Decl(arrayMethodPredicates.ts, 7, 3)) +>filter : Symbol(Int32Array.filter, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 35, 18)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 35, 18)) + +uint32Array.filter(x => x); +>uint32Array.filter : Symbol(Uint32Array.filter, Decl(lib.es5.d.ts, --, --)) +>uint32Array : Symbol(uint32Array, Decl(arrayMethodPredicates.ts, 8, 3)) +>filter : Symbol(Uint32Array.filter, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 36, 19)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 36, 19)) + +float32Array.filter(x => x); +>float32Array.filter : Symbol(Float32Array.filter, Decl(lib.es5.d.ts, --, --)) +>float32Array : Symbol(float32Array, Decl(arrayMethodPredicates.ts, 9, 3)) +>filter : Symbol(Float32Array.filter, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 37, 20)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 37, 20)) + +float64Array.filter(x => x); +>float64Array.filter : Symbol(Float64Array.filter, Decl(lib.es5.d.ts, --, --)) +>float64Array : Symbol(float64Array, Decl(arrayMethodPredicates.ts, 10, 3)) +>filter : Symbol(Float64Array.filter, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 38, 20)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 38, 20)) + +bigInt64Array.filter(x => x); +>bigInt64Array.filter : Symbol(BigInt64Array.filter, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayMethodPredicates.ts, 11, 3)) +>filter : Symbol(BigInt64Array.filter, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 39, 21)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 39, 21)) + +bigUint64Array.filter(x => x); +>bigUint64Array.filter : Symbol(BigUint64Array.filter, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayMethodPredicates.ts, 12, 3)) +>filter : Symbol(BigUint64Array.filter, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 40, 22)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 40, 22)) + +array.find(x => x); +>array.find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>array : Symbol(array, Decl(arrayMethodPredicates.ts, 0, 3)) +>find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 42, 11)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 42, 11)) + +readonlyArray.find(x => x); +>readonlyArray.find : Symbol(ReadonlyArray.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>readonlyArray : Symbol(readonlyArray, Decl(arrayMethodPredicates.ts, 1, 3)) +>find : Symbol(ReadonlyArray.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 43, 19)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 43, 19)) + +int8Array.find(x => x); +>int8Array.find : Symbol(Int8Array.find, Decl(lib.es5.d.ts, --, --)) +>int8Array : Symbol(int8Array, Decl(arrayMethodPredicates.ts, 2, 3)) +>find : Symbol(Int8Array.find, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 44, 15)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 44, 15)) + +uint8Array.find(x => x); +>uint8Array.find : Symbol(Uint8Array.find, Decl(lib.es5.d.ts, --, --)) +>uint8Array : Symbol(uint8Array, Decl(arrayMethodPredicates.ts, 3, 3)) +>find : Symbol(Uint8Array.find, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 45, 16)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 45, 16)) + +uint8ClampedArray.find(x => x); +>uint8ClampedArray.find : Symbol(Uint8ClampedArray.find, Decl(lib.es5.d.ts, --, --)) +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayMethodPredicates.ts, 4, 3)) +>find : Symbol(Uint8ClampedArray.find, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 46, 23)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 46, 23)) + +int16Array.find(x => x); +>int16Array.find : Symbol(Int16Array.find, Decl(lib.es5.d.ts, --, --)) +>int16Array : Symbol(int16Array, Decl(arrayMethodPredicates.ts, 5, 3)) +>find : Symbol(Int16Array.find, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 47, 16)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 47, 16)) + +uint16Array.find(x => x); +>uint16Array.find : Symbol(Uint16Array.find, Decl(lib.es5.d.ts, --, --)) +>uint16Array : Symbol(uint16Array, Decl(arrayMethodPredicates.ts, 6, 3)) +>find : Symbol(Uint16Array.find, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 48, 17)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 48, 17)) + +int32Array.find(x => x); +>int32Array.find : Symbol(Int32Array.find, Decl(lib.es5.d.ts, --, --)) +>int32Array : Symbol(int32Array, Decl(arrayMethodPredicates.ts, 7, 3)) +>find : Symbol(Int32Array.find, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 49, 16)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 49, 16)) + +uint32Array.find(x => x); +>uint32Array.find : Symbol(Uint32Array.find, Decl(lib.es5.d.ts, --, --)) +>uint32Array : Symbol(uint32Array, Decl(arrayMethodPredicates.ts, 8, 3)) +>find : Symbol(Uint32Array.find, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 50, 17)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 50, 17)) + +float32Array.find(x => x); +>float32Array.find : Symbol(Float32Array.find, Decl(lib.es5.d.ts, --, --)) +>float32Array : Symbol(float32Array, Decl(arrayMethodPredicates.ts, 9, 3)) +>find : Symbol(Float32Array.find, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 51, 18)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 51, 18)) + +float64Array.find(x => x); +>float64Array.find : Symbol(Float64Array.find, Decl(lib.es5.d.ts, --, --)) +>float64Array : Symbol(float64Array, Decl(arrayMethodPredicates.ts, 10, 3)) +>find : Symbol(Float64Array.find, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 52, 18)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 52, 18)) + +bigInt64Array.find(x => x); +>bigInt64Array.find : Symbol(BigInt64Array.find, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayMethodPredicates.ts, 11, 3)) +>find : Symbol(BigInt64Array.find, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 53, 19)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 53, 19)) + +bigUint64Array.find(x => x); +>bigUint64Array.find : Symbol(BigUint64Array.find, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayMethodPredicates.ts, 12, 3)) +>find : Symbol(BigUint64Array.find, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 54, 20)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 54, 20)) + +array.findIndex(x => x); +>array.findIndex : Symbol(Array.findIndex, Decl(lib.es2015.core.d.ts, --, --)) +>array : Symbol(array, Decl(arrayMethodPredicates.ts, 0, 3)) +>findIndex : Symbol(Array.findIndex, Decl(lib.es2015.core.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 56, 16)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 56, 16)) + +readonlyArray.findIndex(x => x); +>readonlyArray.findIndex : Symbol(ReadonlyArray.findIndex, Decl(lib.es2015.core.d.ts, --, --)) +>readonlyArray : Symbol(readonlyArray, Decl(arrayMethodPredicates.ts, 1, 3)) +>findIndex : Symbol(ReadonlyArray.findIndex, Decl(lib.es2015.core.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 57, 24)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 57, 24)) + +int8Array.findIndex(x => x); +>int8Array.findIndex : Symbol(Int8Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>int8Array : Symbol(int8Array, Decl(arrayMethodPredicates.ts, 2, 3)) +>findIndex : Symbol(Int8Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 58, 20)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 58, 20)) + +uint8Array.findIndex(x => x); +>uint8Array.findIndex : Symbol(Uint8Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>uint8Array : Symbol(uint8Array, Decl(arrayMethodPredicates.ts, 3, 3)) +>findIndex : Symbol(Uint8Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 59, 21)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 59, 21)) + +uint8ClampedArray.findIndex(x => x); +>uint8ClampedArray.findIndex : Symbol(Uint8ClampedArray.findIndex, Decl(lib.es5.d.ts, --, --)) +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayMethodPredicates.ts, 4, 3)) +>findIndex : Symbol(Uint8ClampedArray.findIndex, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 60, 28)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 60, 28)) + +int16Array.findIndex(x => x); +>int16Array.findIndex : Symbol(Int16Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>int16Array : Symbol(int16Array, Decl(arrayMethodPredicates.ts, 5, 3)) +>findIndex : Symbol(Int16Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 61, 21)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 61, 21)) + +uint16Array.findIndex(x => x); +>uint16Array.findIndex : Symbol(Uint16Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>uint16Array : Symbol(uint16Array, Decl(arrayMethodPredicates.ts, 6, 3)) +>findIndex : Symbol(Uint16Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 62, 22)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 62, 22)) + +int32Array.findIndex(x => x); +>int32Array.findIndex : Symbol(Int32Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>int32Array : Symbol(int32Array, Decl(arrayMethodPredicates.ts, 7, 3)) +>findIndex : Symbol(Int32Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 63, 21)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 63, 21)) + +uint32Array.findIndex(x => x); +>uint32Array.findIndex : Symbol(Uint32Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>uint32Array : Symbol(uint32Array, Decl(arrayMethodPredicates.ts, 8, 3)) +>findIndex : Symbol(Uint32Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 64, 22)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 64, 22)) + +float32Array.findIndex(x => x); +>float32Array.findIndex : Symbol(Float32Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>float32Array : Symbol(float32Array, Decl(arrayMethodPredicates.ts, 9, 3)) +>findIndex : Symbol(Float32Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 65, 23)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 65, 23)) + +float64Array.findIndex(x => x); +>float64Array.findIndex : Symbol(Float64Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>float64Array : Symbol(float64Array, Decl(arrayMethodPredicates.ts, 10, 3)) +>findIndex : Symbol(Float64Array.findIndex, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 66, 23)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 66, 23)) + +bigInt64Array.findIndex(x => x); +>bigInt64Array.findIndex : Symbol(BigInt64Array.findIndex, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayMethodPredicates.ts, 11, 3)) +>findIndex : Symbol(BigInt64Array.findIndex, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 67, 24)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 67, 24)) + +bigUint64Array.findIndex(x => x); +>bigUint64Array.findIndex : Symbol(BigUint64Array.findIndex, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayMethodPredicates.ts, 12, 3)) +>findIndex : Symbol(BigUint64Array.findIndex, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 68, 25)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 68, 25)) + +array.some(x => x); +>array.some : Symbol(Array.some, Decl(lib.es5.d.ts, --, --)) +>array : Symbol(array, Decl(arrayMethodPredicates.ts, 0, 3)) +>some : Symbol(Array.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 70, 11)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 70, 11)) + +readonlyArray.some(x => x); +>readonlyArray.some : Symbol(ReadonlyArray.some, Decl(lib.es5.d.ts, --, --)) +>readonlyArray : Symbol(readonlyArray, Decl(arrayMethodPredicates.ts, 1, 3)) +>some : Symbol(ReadonlyArray.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 71, 19)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 71, 19)) + +int8Array.some(x => x); +>int8Array.some : Symbol(Int8Array.some, Decl(lib.es5.d.ts, --, --)) +>int8Array : Symbol(int8Array, Decl(arrayMethodPredicates.ts, 2, 3)) +>some : Symbol(Int8Array.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 72, 15)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 72, 15)) + +uint8Array.some(x => x); +>uint8Array.some : Symbol(Uint8Array.some, Decl(lib.es5.d.ts, --, --)) +>uint8Array : Symbol(uint8Array, Decl(arrayMethodPredicates.ts, 3, 3)) +>some : Symbol(Uint8Array.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 73, 16)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 73, 16)) + +uint8ClampedArray.some(x => x); +>uint8ClampedArray.some : Symbol(Uint8ClampedArray.some, Decl(lib.es5.d.ts, --, --)) +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayMethodPredicates.ts, 4, 3)) +>some : Symbol(Uint8ClampedArray.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 74, 23)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 74, 23)) + +int16Array.some(x => x); +>int16Array.some : Symbol(Int16Array.some, Decl(lib.es5.d.ts, --, --)) +>int16Array : Symbol(int16Array, Decl(arrayMethodPredicates.ts, 5, 3)) +>some : Symbol(Int16Array.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 75, 16)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 75, 16)) + +uint16Array.some(x => x); +>uint16Array.some : Symbol(Uint16Array.some, Decl(lib.es5.d.ts, --, --)) +>uint16Array : Symbol(uint16Array, Decl(arrayMethodPredicates.ts, 6, 3)) +>some : Symbol(Uint16Array.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 76, 17)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 76, 17)) + +int32Array.some(x => x); +>int32Array.some : Symbol(Int32Array.some, Decl(lib.es5.d.ts, --, --)) +>int32Array : Symbol(int32Array, Decl(arrayMethodPredicates.ts, 7, 3)) +>some : Symbol(Int32Array.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 77, 16)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 77, 16)) + +uint32Array.some(x => x); +>uint32Array.some : Symbol(Uint32Array.some, Decl(lib.es5.d.ts, --, --)) +>uint32Array : Symbol(uint32Array, Decl(arrayMethodPredicates.ts, 8, 3)) +>some : Symbol(Uint32Array.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 78, 17)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 78, 17)) + +float32Array.some(x => x); +>float32Array.some : Symbol(Float32Array.some, Decl(lib.es5.d.ts, --, --)) +>float32Array : Symbol(float32Array, Decl(arrayMethodPredicates.ts, 9, 3)) +>some : Symbol(Float32Array.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 79, 18)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 79, 18)) + +float64Array.some(x => x); +>float64Array.some : Symbol(Float64Array.some, Decl(lib.es5.d.ts, --, --)) +>float64Array : Symbol(float64Array, Decl(arrayMethodPredicates.ts, 10, 3)) +>some : Symbol(Float64Array.some, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 80, 18)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 80, 18)) + +bigInt64Array.some(x => x); +>bigInt64Array.some : Symbol(BigInt64Array.some, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayMethodPredicates.ts, 11, 3)) +>some : Symbol(BigInt64Array.some, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 81, 19)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 81, 19)) + +bigUint64Array.some(x => x); +>bigUint64Array.some : Symbol(BigUint64Array.some, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayMethodPredicates.ts, 12, 3)) +>some : Symbol(BigUint64Array.some, Decl(lib.es2020.bigint.d.ts, --, --)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 82, 20)) +>x : Symbol(x, Decl(arrayMethodPredicates.ts, 82, 20)) + diff --git a/tests/baselines/reference/arrayMethodPredicates.types b/tests/baselines/reference/arrayMethodPredicates.types new file mode 100644 index 0000000000000..6a43058a1fcf2 --- /dev/null +++ b/tests/baselines/reference/arrayMethodPredicates.types @@ -0,0 +1,625 @@ +=== tests/cases/compiler/arrayMethodPredicates.ts === +var array: number[]; +>array : number[] + +var readonlyArray: readonly number[]; +>readonlyArray : readonly number[] + +var int8Array: Int8Array; +>int8Array : Int8Array + +var uint8Array: Uint8Array; +>uint8Array : Uint8Array + +var uint8ClampedArray: Uint8ClampedArray; +>uint8ClampedArray : Uint8ClampedArray + +var int16Array: Int16Array; +>int16Array : Int16Array + +var uint16Array: Uint16Array; +>uint16Array : Uint16Array + +var int32Array: Int32Array; +>int32Array : Int32Array + +var uint32Array: Uint32Array; +>uint32Array : Uint32Array + +var float32Array: Float32Array; +>float32Array : Float32Array + +var float64Array: Float64Array; +>float64Array : Float64Array + +var bigInt64Array: BigInt64Array; +>bigInt64Array : BigInt64Array + +var bigUint64Array: BigUint64Array; +>bigUint64Array : BigUint64Array + +array.every(x => x); +>array.every(x => x) : boolean +>array.every : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; } +>array : number[] +>every : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; } +>x => x : (x: number) => number +>x : number +>x : number + +readonlyArray.every(x => x); +>readonlyArray.every(x => x) : boolean +>readonlyArray.every : { (predicate: (value: number, index: number, array: readonly number[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any): boolean; } +>readonlyArray : readonly number[] +>every : { (predicate: (value: number, index: number, array: readonly number[]) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any): boolean; } +>x => x : (x: number) => number +>x : number +>x : number + +int8Array.every(x => x); +>int8Array.every(x => x) : boolean +>int8Array.every : (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any) => boolean +>int8Array : Int8Array +>every : (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +uint8Array.every(x => x); +>uint8Array.every(x => x) : boolean +>uint8Array.every : (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean +>uint8Array : Uint8Array +>every : (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +uint8ClampedArray.every(x => x); +>uint8ClampedArray.every(x => x) : boolean +>uint8ClampedArray.every : (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any) => boolean +>uint8ClampedArray : Uint8ClampedArray +>every : (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +int16Array.every(x => x); +>int16Array.every(x => x) : boolean +>int16Array.every : (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any) => boolean +>int16Array : Int16Array +>every : (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +uint16Array.every(x => x); +>uint16Array.every(x => x) : boolean +>uint16Array.every : (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any) => boolean +>uint16Array : Uint16Array +>every : (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +int32Array.every(x => x); +>int32Array.every(x => x) : boolean +>int32Array.every : (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any) => boolean +>int32Array : Int32Array +>every : (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +uint32Array.every(x => x); +>uint32Array.every(x => x) : boolean +>uint32Array.every : (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any) => boolean +>uint32Array : Uint32Array +>every : (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +float32Array.every(x => x); +>float32Array.every(x => x) : boolean +>float32Array.every : (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any) => boolean +>float32Array : Float32Array +>every : (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +float64Array.every(x => x); +>float64Array.every(x => x) : boolean +>float64Array.every : (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any) => boolean +>float64Array : Float64Array +>every : (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +bigInt64Array.every(x => x); +>bigInt64Array.every(x => x) : boolean +>bigInt64Array.every : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => boolean +>bigInt64Array : BigInt64Array +>every : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => boolean +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + +bigUint64Array.every(x => x); +>bigUint64Array.every(x => x) : boolean +>bigUint64Array.every : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => boolean +>bigUint64Array : BigUint64Array +>every : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => boolean +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + +array.filter(x => x); +>array.filter(x => x) : number[] +>array.filter : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; } +>array : number[] +>filter : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; } +>x => x : (x: number) => number +>x : number +>x : number + +readonlyArray.filter(x => x); +>readonlyArray.filter(x => x) : number[] +>readonlyArray.filter : { (predicate: (value: number, index: number, array: readonly number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any): number[]; } +>readonlyArray : readonly number[] +>filter : { (predicate: (value: number, index: number, array: readonly number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any): number[]; } +>x => x : (x: number) => number +>x : number +>x : number + +int8Array.filter(x => x); +>int8Array.filter(x => x) : Int8Array +>int8Array.filter : (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any) => Int8Array +>int8Array : Int8Array +>filter : (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any) => Int8Array +>x => x : (x: number) => number +>x : number +>x : number + +uint8Array.filter(x => x); +>uint8Array.filter(x => x) : Uint8Array +>uint8Array.filter : (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => Uint8Array +>uint8Array : Uint8Array +>filter : (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => Uint8Array +>x => x : (x: number) => number +>x : number +>x : number + +uint8ClampedArray.filter(x => x); +>uint8ClampedArray.filter(x => x) : Uint8ClampedArray +>uint8ClampedArray.filter : (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any) => Uint8ClampedArray +>uint8ClampedArray : Uint8ClampedArray +>filter : (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any) => Uint8ClampedArray +>x => x : (x: number) => number +>x : number +>x : number + +int16Array.filter(x => x); +>int16Array.filter(x => x) : Int16Array +>int16Array.filter : (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any) => Int16Array +>int16Array : Int16Array +>filter : (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any) => Int16Array +>x => x : (x: number) => number +>x : number +>x : number + +uint16Array.filter(x => x); +>uint16Array.filter(x => x) : Uint16Array +>uint16Array.filter : (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any) => Uint16Array +>uint16Array : Uint16Array +>filter : (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any) => Uint16Array +>x => x : (x: number) => number +>x : number +>x : number + +int32Array.filter(x => x); +>int32Array.filter(x => x) : Int32Array +>int32Array.filter : (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any) => Int32Array +>int32Array : Int32Array +>filter : (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any) => Int32Array +>x => x : (x: number) => number +>x : number +>x : number + +uint32Array.filter(x => x); +>uint32Array.filter(x => x) : Uint32Array +>uint32Array.filter : (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any) => Uint32Array +>uint32Array : Uint32Array +>filter : (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any) => Uint32Array +>x => x : (x: number) => number +>x : number +>x : number + +float32Array.filter(x => x); +>float32Array.filter(x => x) : Float32Array +>float32Array.filter : (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any) => Float32Array +>float32Array : Float32Array +>filter : (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any) => Float32Array +>x => x : (x: number) => number +>x : number +>x : number + +float64Array.filter(x => x); +>float64Array.filter(x => x) : Float64Array +>float64Array.filter : (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any) => Float64Array +>float64Array : Float64Array +>filter : (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any) => Float64Array +>x => x : (x: number) => number +>x : number +>x : number + +bigInt64Array.filter(x => x); +>bigInt64Array.filter(x => x) : BigInt64Array +>bigInt64Array.filter : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => BigInt64Array +>bigInt64Array : BigInt64Array +>filter : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => BigInt64Array +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + +bigUint64Array.filter(x => x); +>bigUint64Array.filter(x => x) : BigUint64Array +>bigUint64Array.filter : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => BigUint64Array +>bigUint64Array : BigUint64Array +>filter : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => BigUint64Array +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + +array.find(x => x); +>array.find(x => x) : number +>array.find : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; } +>array : number[] +>find : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; } +>x => x : (x: number) => number +>x : number +>x : number + +readonlyArray.find(x => x); +>readonlyArray.find(x => x) : number +>readonlyArray.find : { (predicate: (value: number, index: number, array: readonly number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any): number; } +>readonlyArray : readonly number[] +>find : { (predicate: (value: number, index: number, array: readonly number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any): number; } +>x => x : (x: number) => number +>x : number +>x : number + +int8Array.find(x => x); +>int8Array.find(x => x) : number +>int8Array.find : (predicate: (value: number, index: number, obj: Int8Array) => unknown, thisArg?: any) => number +>int8Array : Int8Array +>find : (predicate: (value: number, index: number, obj: Int8Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +uint8Array.find(x => x); +>uint8Array.find(x => x) : number +>uint8Array.find : (predicate: (value: number, index: number, obj: Uint8Array) => unknown, thisArg?: any) => number +>uint8Array : Uint8Array +>find : (predicate: (value: number, index: number, obj: Uint8Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +uint8ClampedArray.find(x => x); +>uint8ClampedArray.find(x => x) : number +>uint8ClampedArray.find : (predicate: (value: number, index: number, obj: Uint8ClampedArray) => unknown, thisArg?: any) => number +>uint8ClampedArray : Uint8ClampedArray +>find : (predicate: (value: number, index: number, obj: Uint8ClampedArray) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +int16Array.find(x => x); +>int16Array.find(x => x) : number +>int16Array.find : (predicate: (value: number, index: number, obj: Int16Array) => unknown, thisArg?: any) => number +>int16Array : Int16Array +>find : (predicate: (value: number, index: number, obj: Int16Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +uint16Array.find(x => x); +>uint16Array.find(x => x) : number +>uint16Array.find : (predicate: (value: number, index: number, obj: Uint16Array) => unknown, thisArg?: any) => number +>uint16Array : Uint16Array +>find : (predicate: (value: number, index: number, obj: Uint16Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +int32Array.find(x => x); +>int32Array.find(x => x) : number +>int32Array.find : (predicate: (value: number, index: number, obj: Int32Array) => unknown, thisArg?: any) => number +>int32Array : Int32Array +>find : (predicate: (value: number, index: number, obj: Int32Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +uint32Array.find(x => x); +>uint32Array.find(x => x) : number +>uint32Array.find : (predicate: (value: number, index: number, obj: Uint32Array) => unknown, thisArg?: any) => number +>uint32Array : Uint32Array +>find : (predicate: (value: number, index: number, obj: Uint32Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +float32Array.find(x => x); +>float32Array.find(x => x) : number +>float32Array.find : (predicate: (value: number, index: number, obj: Float32Array) => unknown, thisArg?: any) => number +>float32Array : Float32Array +>find : (predicate: (value: number, index: number, obj: Float32Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +float64Array.find(x => x); +>float64Array.find(x => x) : number +>float64Array.find : (predicate: (value: number, index: number, obj: Float64Array) => unknown, thisArg?: any) => number +>float64Array : Float64Array +>find : (predicate: (value: number, index: number, obj: Float64Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +bigInt64Array.find(x => x); +>bigInt64Array.find(x => x) : bigint +>bigInt64Array.find : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => bigint +>bigInt64Array : BigInt64Array +>find : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => bigint +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + +bigUint64Array.find(x => x); +>bigUint64Array.find(x => x) : bigint +>bigUint64Array.find : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => bigint +>bigUint64Array : BigUint64Array +>find : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => bigint +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + +array.findIndex(x => x); +>array.findIndex(x => x) : number +>array.findIndex : (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number +>array : number[] +>findIndex : (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +readonlyArray.findIndex(x => x); +>readonlyArray.findIndex(x => x) : number +>readonlyArray.findIndex : (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any) => number +>readonlyArray : readonly number[] +>findIndex : (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +int8Array.findIndex(x => x); +>int8Array.findIndex(x => x) : number +>int8Array.findIndex : (predicate: (value: number, index: number, obj: Int8Array) => unknown, thisArg?: any) => number +>int8Array : Int8Array +>findIndex : (predicate: (value: number, index: number, obj: Int8Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +uint8Array.findIndex(x => x); +>uint8Array.findIndex(x => x) : number +>uint8Array.findIndex : (predicate: (value: number, index: number, obj: Uint8Array) => unknown, thisArg?: any) => number +>uint8Array : Uint8Array +>findIndex : (predicate: (value: number, index: number, obj: Uint8Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +uint8ClampedArray.findIndex(x => x); +>uint8ClampedArray.findIndex(x => x) : number +>uint8ClampedArray.findIndex : (predicate: (value: number, index: number, obj: Uint8ClampedArray) => unknown, thisArg?: any) => number +>uint8ClampedArray : Uint8ClampedArray +>findIndex : (predicate: (value: number, index: number, obj: Uint8ClampedArray) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +int16Array.findIndex(x => x); +>int16Array.findIndex(x => x) : number +>int16Array.findIndex : (predicate: (value: number, index: number, obj: Int16Array) => unknown, thisArg?: any) => number +>int16Array : Int16Array +>findIndex : (predicate: (value: number, index: number, obj: Int16Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +uint16Array.findIndex(x => x); +>uint16Array.findIndex(x => x) : number +>uint16Array.findIndex : (predicate: (value: number, index: number, obj: Uint16Array) => unknown, thisArg?: any) => number +>uint16Array : Uint16Array +>findIndex : (predicate: (value: number, index: number, obj: Uint16Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +int32Array.findIndex(x => x); +>int32Array.findIndex(x => x) : number +>int32Array.findIndex : (predicate: (value: number, index: number, obj: Int32Array) => unknown, thisArg?: any) => number +>int32Array : Int32Array +>findIndex : (predicate: (value: number, index: number, obj: Int32Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +uint32Array.findIndex(x => x); +>uint32Array.findIndex(x => x) : number +>uint32Array.findIndex : (predicate: (value: number, index: number, obj: Uint32Array) => unknown, thisArg?: any) => number +>uint32Array : Uint32Array +>findIndex : (predicate: (value: number, index: number, obj: Uint32Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +float32Array.findIndex(x => x); +>float32Array.findIndex(x => x) : number +>float32Array.findIndex : (predicate: (value: number, index: number, obj: Float32Array) => unknown, thisArg?: any) => number +>float32Array : Float32Array +>findIndex : (predicate: (value: number, index: number, obj: Float32Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +float64Array.findIndex(x => x); +>float64Array.findIndex(x => x) : number +>float64Array.findIndex : (predicate: (value: number, index: number, obj: Float64Array) => unknown, thisArg?: any) => number +>float64Array : Float64Array +>findIndex : (predicate: (value: number, index: number, obj: Float64Array) => unknown, thisArg?: any) => number +>x => x : (x: number) => number +>x : number +>x : number + +bigInt64Array.findIndex(x => x); +>bigInt64Array.findIndex(x => x) : number +>bigInt64Array.findIndex : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => number +>bigInt64Array : BigInt64Array +>findIndex : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => number +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + +bigUint64Array.findIndex(x => x); +>bigUint64Array.findIndex(x => x) : number +>bigUint64Array.findIndex : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => number +>bigUint64Array : BigUint64Array +>findIndex : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => number +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + +array.some(x => x); +>array.some(x => x) : boolean +>array.some : (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean +>array : number[] +>some : (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +readonlyArray.some(x => x); +>readonlyArray.some(x => x) : boolean +>readonlyArray.some : (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any) => boolean +>readonlyArray : readonly number[] +>some : (predicate: (value: number, index: number, array: readonly number[]) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +int8Array.some(x => x); +>int8Array.some(x => x) : boolean +>int8Array.some : (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any) => boolean +>int8Array : Int8Array +>some : (predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +uint8Array.some(x => x); +>uint8Array.some(x => x) : boolean +>uint8Array.some : (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean +>uint8Array : Uint8Array +>some : (predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +uint8ClampedArray.some(x => x); +>uint8ClampedArray.some(x => x) : boolean +>uint8ClampedArray.some : (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any) => boolean +>uint8ClampedArray : Uint8ClampedArray +>some : (predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +int16Array.some(x => x); +>int16Array.some(x => x) : boolean +>int16Array.some : (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any) => boolean +>int16Array : Int16Array +>some : (predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +uint16Array.some(x => x); +>uint16Array.some(x => x) : boolean +>uint16Array.some : (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any) => boolean +>uint16Array : Uint16Array +>some : (predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +int32Array.some(x => x); +>int32Array.some(x => x) : boolean +>int32Array.some : (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any) => boolean +>int32Array : Int32Array +>some : (predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +uint32Array.some(x => x); +>uint32Array.some(x => x) : boolean +>uint32Array.some : (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any) => boolean +>uint32Array : Uint32Array +>some : (predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +float32Array.some(x => x); +>float32Array.some(x => x) : boolean +>float32Array.some : (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any) => boolean +>float32Array : Float32Array +>some : (predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +float64Array.some(x => x); +>float64Array.some(x => x) : boolean +>float64Array.some : (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any) => boolean +>float64Array : Float64Array +>some : (predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any) => boolean +>x => x : (x: number) => number +>x : number +>x : number + +bigInt64Array.some(x => x); +>bigInt64Array.some(x => x) : boolean +>bigInt64Array.some : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => boolean +>bigInt64Array : BigInt64Array +>some : (predicate: (value: bigint, index: number, array: BigInt64Array) => unknown, thisArg?: any) => boolean +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + +bigUint64Array.some(x => x); +>bigUint64Array.some(x => x) : boolean +>bigUint64Array.some : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => boolean +>bigUint64Array : BigUint64Array +>some : (predicate: (value: bigint, index: number, array: BigUint64Array) => unknown, thisArg?: any) => boolean +>x => x : (x: bigint) => bigint +>x : bigint +>x : bigint + diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt index 66b3c2c869106..cc45fdef74f91 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt @@ -1,9 +1,8 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(13,1): error TS2322: Type 'A[]' is not assignable to type 'readonly B[]'. Property 'b' is missing in type 'A' but required in type 'B'. tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error TS2322: Type 'C' is not assignable to type 'readonly B[]'. - The types returned by 'concat(...)' are incompatible between these types. - Type 'A[]' is not assignable to type 'B[]'. - Type 'A' is not assignable to type 'B'. + The types returned by 'valueOf()' are incompatible between these types. + Type 'A[]' is not assignable to type 'readonly B[]'. ==== tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts (2 errors) ==== @@ -31,7 +30,6 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error T rrb = cra; // error: 'A' is not assignable to 'B' ~~~ !!! error TS2322: Type 'C' is not assignable to type 'readonly B[]'. -!!! error TS2322: The types returned by 'concat(...)' are incompatible between these types. -!!! error TS2322: Type 'A[]' is not assignable to type 'B[]'. -!!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: The types returned by 'valueOf()' are incompatible between these types. +!!! error TS2322: Type 'A[]' is not assignable to type 'readonly B[]'. \ No newline at end of file diff --git a/tests/baselines/reference/arrayReverse.js b/tests/baselines/reference/arrayReverse.js new file mode 100644 index 0000000000000..716eb55c03076 --- /dev/null +++ b/tests/baselines/reference/arrayReverse.js @@ -0,0 +1,79 @@ +//// [arrayReverse.ts] +var strTuple: ["foo", "bar", "baz"]; +strTuple.reverse(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] + +var numTuple: [11, 2, 22, 1]; +numTuple.reverse(); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +int8Array.reverse(); // Int8Array + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +uint8Array.reverse(); // Uint8Array + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +uint8ClampedArray.reverse(); // Uint8ClampedArray + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +int16Array.reverse(); // Int16Array + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +uint16Array.reverse(); // Uint16Array + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +int32Array.reverse(); // Int32Array + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +uint32Array.reverse(); // Uint32Array + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +float32Array.reverse(); // Float32Array + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +float64Array.reverse(); // Float64Array + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +bigInt64Array.reverse(); // BigInt64Array + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +bigUint64Array.reverse(); // BigUint64Array + + +//// [arrayReverse.js] +var strTuple; +strTuple.reverse(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +var numTuple; +numTuple.reverse(); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +var int8Array; +int8Array.reverse(); // Int8Array +var uint8Array; +uint8Array.reverse(); // Uint8Array +var uint8ClampedArray; +uint8ClampedArray.reverse(); // Uint8ClampedArray +var int16Array; +int16Array.reverse(); // Int16Array +var uint16Array; +uint16Array.reverse(); // Uint16Array +var int32Array; +int32Array.reverse(); // Int32Array +var uint32Array; +uint32Array.reverse(); // Uint32Array +var float32Array; +float32Array.reverse(); // Float32Array +var float64Array; +float64Array.reverse(); // Float64Array +var bigInt64Array; +bigInt64Array.reverse(); // BigInt64Array +var bigUint64Array; +bigUint64Array.reverse(); // BigUint64Array diff --git a/tests/baselines/reference/arrayReverse.symbols b/tests/baselines/reference/arrayReverse.symbols new file mode 100644 index 0000000000000..1b6ae6ac236af --- /dev/null +++ b/tests/baselines/reference/arrayReverse.symbols @@ -0,0 +1,160 @@ +=== tests/cases/compiler/arrayReverse.ts === +var strTuple: ["foo", "bar", "baz"]; +>strTuple : Symbol(strTuple, Decl(arrayReverse.ts, 0, 3)) + +strTuple.reverse(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +>strTuple.reverse : Symbol(Array.reverse, Decl(lib.es5.d.ts, --, --)) +>strTuple : Symbol(strTuple, Decl(arrayReverse.ts, 0, 3)) +>reverse : Symbol(Array.reverse, Decl(lib.es5.d.ts, --, --)) + +var numTuple: [11, 2, 22, 1]; +>numTuple : Symbol(numTuple, Decl(arrayReverse.ts, 3, 3)) + +numTuple.reverse(); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +>numTuple.reverse : Symbol(Array.reverse, Decl(lib.es5.d.ts, --, --)) +>numTuple : Symbol(numTuple, Decl(arrayReverse.ts, 3, 3)) +>reverse : Symbol(Array.reverse, Decl(lib.es5.d.ts, --, --)) + +interface Int8ArrayExtension extends Int8Array {} +>Int8ArrayExtension : Symbol(Int8ArrayExtension, Decl(arrayReverse.ts, 4, 19)) +>Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int8Array: Int8ArrayExtension; +>int8Array : Symbol(int8Array, Decl(arrayReverse.ts, 7, 3)) +>Int8ArrayExtension : Symbol(Int8ArrayExtension, Decl(arrayReverse.ts, 4, 19)) + +int8Array.reverse(); // Int8Array +>int8Array.reverse : Symbol(Int8Array.reverse, Decl(lib.es5.d.ts, --, --)) +>int8Array : Symbol(int8Array, Decl(arrayReverse.ts, 7, 3)) +>reverse : Symbol(Int8Array.reverse, Decl(lib.es5.d.ts, --, --)) + +interface Uint8ArrayExtension extends Uint8Array {} +>Uint8ArrayExtension : Symbol(Uint8ArrayExtension, Decl(arrayReverse.ts, 8, 20)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8Array: Uint8ArrayExtension; +>uint8Array : Symbol(uint8Array, Decl(arrayReverse.ts, 11, 3)) +>Uint8ArrayExtension : Symbol(Uint8ArrayExtension, Decl(arrayReverse.ts, 8, 20)) + +uint8Array.reverse(); // Uint8Array +>uint8Array.reverse : Symbol(Uint8Array.reverse, Decl(lib.es5.d.ts, --, --)) +>uint8Array : Symbol(uint8Array, Decl(arrayReverse.ts, 11, 3)) +>reverse : Symbol(Uint8Array.reverse, Decl(lib.es5.d.ts, --, --)) + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +>Uint8ClampedArrayExtension : Symbol(Uint8ClampedArrayExtension, Decl(arrayReverse.ts, 12, 21)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8ClampedArray: Uint8ClampedArrayExtension; +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayReverse.ts, 15, 3)) +>Uint8ClampedArrayExtension : Symbol(Uint8ClampedArrayExtension, Decl(arrayReverse.ts, 12, 21)) + +uint8ClampedArray.reverse(); // Uint8ClampedArray +>uint8ClampedArray.reverse : Symbol(Uint8ClampedArray.reverse, Decl(lib.es5.d.ts, --, --)) +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arrayReverse.ts, 15, 3)) +>reverse : Symbol(Uint8ClampedArray.reverse, Decl(lib.es5.d.ts, --, --)) + +interface Int16ArrayExtension extends Int16Array {} +>Int16ArrayExtension : Symbol(Int16ArrayExtension, Decl(arrayReverse.ts, 16, 28)) +>Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int16Array: Int16ArrayExtension; +>int16Array : Symbol(int16Array, Decl(arrayReverse.ts, 19, 3)) +>Int16ArrayExtension : Symbol(Int16ArrayExtension, Decl(arrayReverse.ts, 16, 28)) + +int16Array.reverse(); // Int16Array +>int16Array.reverse : Symbol(Int16Array.reverse, Decl(lib.es5.d.ts, --, --)) +>int16Array : Symbol(int16Array, Decl(arrayReverse.ts, 19, 3)) +>reverse : Symbol(Int16Array.reverse, Decl(lib.es5.d.ts, --, --)) + +interface Uint16ArrayExtension extends Uint16Array {} +>Uint16ArrayExtension : Symbol(Uint16ArrayExtension, Decl(arrayReverse.ts, 20, 21)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint16Array: Uint16ArrayExtension; +>uint16Array : Symbol(uint16Array, Decl(arrayReverse.ts, 23, 3)) +>Uint16ArrayExtension : Symbol(Uint16ArrayExtension, Decl(arrayReverse.ts, 20, 21)) + +uint16Array.reverse(); // Uint16Array +>uint16Array.reverse : Symbol(Uint16Array.reverse, Decl(lib.es5.d.ts, --, --)) +>uint16Array : Symbol(uint16Array, Decl(arrayReverse.ts, 23, 3)) +>reverse : Symbol(Uint16Array.reverse, Decl(lib.es5.d.ts, --, --)) + +interface Int32ArrayExtension extends Int32Array {} +>Int32ArrayExtension : Symbol(Int32ArrayExtension, Decl(arrayReverse.ts, 24, 22)) +>Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int32Array: Int32ArrayExtension; +>int32Array : Symbol(int32Array, Decl(arrayReverse.ts, 27, 3)) +>Int32ArrayExtension : Symbol(Int32ArrayExtension, Decl(arrayReverse.ts, 24, 22)) + +int32Array.reverse(); // Int32Array +>int32Array.reverse : Symbol(Int32Array.reverse, Decl(lib.es5.d.ts, --, --)) +>int32Array : Symbol(int32Array, Decl(arrayReverse.ts, 27, 3)) +>reverse : Symbol(Int32Array.reverse, Decl(lib.es5.d.ts, --, --)) + +interface Uint32ArrayExtension extends Uint32Array {} +>Uint32ArrayExtension : Symbol(Uint32ArrayExtension, Decl(arrayReverse.ts, 28, 21)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint32Array: Uint32ArrayExtension; +>uint32Array : Symbol(uint32Array, Decl(arrayReverse.ts, 31, 3)) +>Uint32ArrayExtension : Symbol(Uint32ArrayExtension, Decl(arrayReverse.ts, 28, 21)) + +uint32Array.reverse(); // Uint32Array +>uint32Array.reverse : Symbol(Uint32Array.reverse, Decl(lib.es5.d.ts, --, --)) +>uint32Array : Symbol(uint32Array, Decl(arrayReverse.ts, 31, 3)) +>reverse : Symbol(Uint32Array.reverse, Decl(lib.es5.d.ts, --, --)) + +interface Float32ArrayExtension extends Float32Array {} +>Float32ArrayExtension : Symbol(Float32ArrayExtension, Decl(arrayReverse.ts, 32, 22)) +>Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float32Array: Float32ArrayExtension; +>float32Array : Symbol(float32Array, Decl(arrayReverse.ts, 35, 3)) +>Float32ArrayExtension : Symbol(Float32ArrayExtension, Decl(arrayReverse.ts, 32, 22)) + +float32Array.reverse(); // Float32Array +>float32Array.reverse : Symbol(Float32Array.reverse, Decl(lib.es5.d.ts, --, --)) +>float32Array : Symbol(float32Array, Decl(arrayReverse.ts, 35, 3)) +>reverse : Symbol(Float32Array.reverse, Decl(lib.es5.d.ts, --, --)) + +interface Float64ArrayExtension extends Float64Array {} +>Float64ArrayExtension : Symbol(Float64ArrayExtension, Decl(arrayReverse.ts, 36, 23)) +>Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float64Array: Float64ArrayExtension; +>float64Array : Symbol(float64Array, Decl(arrayReverse.ts, 39, 3)) +>Float64ArrayExtension : Symbol(Float64ArrayExtension, Decl(arrayReverse.ts, 36, 23)) + +float64Array.reverse(); // Float64Array +>float64Array.reverse : Symbol(Float64Array.reverse, Decl(lib.es5.d.ts, --, --)) +>float64Array : Symbol(float64Array, Decl(arrayReverse.ts, 39, 3)) +>reverse : Symbol(Float64Array.reverse, Decl(lib.es5.d.ts, --, --)) + +interface BigInt64ArrayExtension extends BigInt64Array {} +>BigInt64ArrayExtension : Symbol(BigInt64ArrayExtension, Decl(arrayReverse.ts, 40, 23)) +>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +var bigInt64Array: BigInt64ArrayExtension; +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayReverse.ts, 43, 3)) +>BigInt64ArrayExtension : Symbol(BigInt64ArrayExtension, Decl(arrayReverse.ts, 40, 23)) + +bigInt64Array.reverse(); // BigInt64Array +>bigInt64Array.reverse : Symbol(BigInt64Array.reverse, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigInt64Array : Symbol(bigInt64Array, Decl(arrayReverse.ts, 43, 3)) +>reverse : Symbol(BigInt64Array.reverse, Decl(lib.es2020.bigint.d.ts, --, --)) + +interface BigUint64ArrayExtension extends BigUint64Array {} +>BigUint64ArrayExtension : Symbol(BigUint64ArrayExtension, Decl(arrayReverse.ts, 44, 24)) +>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +var bigUint64Array: BigUint64ArrayExtension; +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayReverse.ts, 47, 3)) +>BigUint64ArrayExtension : Symbol(BigUint64ArrayExtension, Decl(arrayReverse.ts, 44, 24)) + +bigUint64Array.reverse(); // BigUint64Array +>bigUint64Array.reverse : Symbol(BigUint64Array.reverse, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigUint64Array : Symbol(bigUint64Array, Decl(arrayReverse.ts, 47, 3)) +>reverse : Symbol(BigUint64Array.reverse, Decl(lib.es2020.bigint.d.ts, --, --)) + diff --git a/tests/baselines/reference/arrayReverse.types b/tests/baselines/reference/arrayReverse.types new file mode 100644 index 0000000000000..359456bd859c7 --- /dev/null +++ b/tests/baselines/reference/arrayReverse.types @@ -0,0 +1,129 @@ +=== tests/cases/compiler/arrayReverse.ts === +var strTuple: ["foo", "bar", "baz"]; +>strTuple : ["foo", "bar", "baz"] + +strTuple.reverse(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +>strTuple.reverse() : ("foo" | "bar" | "baz")[] +>strTuple.reverse : () => ("foo" | "bar" | "baz")[] +>strTuple : ["foo", "bar", "baz"] +>reverse : () => ("foo" | "bar" | "baz")[] + +var numTuple: [11, 2, 22, 1]; +>numTuple : [11, 2, 22, 1] + +numTuple.reverse(); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +>numTuple.reverse() : (11 | 2 | 22 | 1)[] +>numTuple.reverse : () => (11 | 2 | 22 | 1)[] +>numTuple : [11, 2, 22, 1] +>reverse : () => (11 | 2 | 22 | 1)[] + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +>int8Array : Int8ArrayExtension + +int8Array.reverse(); // Int8Array +>int8Array.reverse() : Int8Array +>int8Array.reverse : () => Int8Array +>int8Array : Int8ArrayExtension +>reverse : () => Int8Array + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +>uint8Array : Uint8ArrayExtension + +uint8Array.reverse(); // Uint8Array +>uint8Array.reverse() : Uint8Array +>uint8Array.reverse : () => Uint8Array +>uint8Array : Uint8ArrayExtension +>reverse : () => Uint8Array + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +>uint8ClampedArray : Uint8ClampedArrayExtension + +uint8ClampedArray.reverse(); // Uint8ClampedArray +>uint8ClampedArray.reverse() : Uint8ClampedArray +>uint8ClampedArray.reverse : () => Uint8ClampedArray +>uint8ClampedArray : Uint8ClampedArrayExtension +>reverse : () => Uint8ClampedArray + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +>int16Array : Int16ArrayExtension + +int16Array.reverse(); // Int16Array +>int16Array.reverse() : Int16Array +>int16Array.reverse : () => Int16Array +>int16Array : Int16ArrayExtension +>reverse : () => Int16Array + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +>uint16Array : Uint16ArrayExtension + +uint16Array.reverse(); // Uint16Array +>uint16Array.reverse() : Uint16Array +>uint16Array.reverse : () => Uint16Array +>uint16Array : Uint16ArrayExtension +>reverse : () => Uint16Array + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +>int32Array : Int32ArrayExtension + +int32Array.reverse(); // Int32Array +>int32Array.reverse() : Int32Array +>int32Array.reverse : () => Int32Array +>int32Array : Int32ArrayExtension +>reverse : () => Int32Array + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +>uint32Array : Uint32ArrayExtension + +uint32Array.reverse(); // Uint32Array +>uint32Array.reverse() : Uint32Array +>uint32Array.reverse : () => Uint32Array +>uint32Array : Uint32ArrayExtension +>reverse : () => Uint32Array + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +>float32Array : Float32ArrayExtension + +float32Array.reverse(); // Float32Array +>float32Array.reverse() : Float32Array +>float32Array.reverse : () => Float32Array +>float32Array : Float32ArrayExtension +>reverse : () => Float32Array + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +>float64Array : Float64ArrayExtension + +float64Array.reverse(); // Float64Array +>float64Array.reverse() : Float64Array +>float64Array.reverse : () => Float64Array +>float64Array : Float64ArrayExtension +>reverse : () => Float64Array + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +>bigInt64Array : BigInt64ArrayExtension + +bigInt64Array.reverse(); // BigInt64Array +>bigInt64Array.reverse() : BigInt64Array +>bigInt64Array.reverse : () => BigInt64Array +>bigInt64Array : BigInt64ArrayExtension +>reverse : () => BigInt64Array + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +>bigUint64Array : BigUint64ArrayExtension + +bigUint64Array.reverse(); // BigUint64Array +>bigUint64Array.reverse() : BigUint64Array +>bigUint64Array.reverse : () => BigUint64Array +>bigUint64Array : BigUint64ArrayExtension +>reverse : () => BigUint64Array + diff --git a/tests/baselines/reference/arraySort.js b/tests/baselines/reference/arraySort.js new file mode 100644 index 0000000000000..3bf7ba073bd55 --- /dev/null +++ b/tests/baselines/reference/arraySort.js @@ -0,0 +1,79 @@ +//// [arraySort.ts] +var strTuple: ["foo", "bar", "baz"]; +strTuple.sort(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] + +var numTuple: [11, 2, 22, 1]; +numTuple.sort((a, b) => a - b); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +int8Array.sort((a, b) => a - b); // Int8Array + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +uint8Array.sort((a, b) => a - b); // Uint8Array + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +uint8ClampedArray.sort((a, b) => a - b); // Uint8ClampedArray + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +int16Array.sort((a, b) => a - b); // Int16Array + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +uint16Array.sort((a, b) => a - b); // Uint16Array + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +int32Array.sort((a, b) => a - b); // Int32Array + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +uint32Array.sort((a, b) => a - b); // Uint32Array + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +float32Array.sort((a, b) => a - b); // Float32Array + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +float64Array.sort((a, b) => a - b); // Float64Array + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +bigInt64Array.sort((a, b) => a - b); // BigInt64Array + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +bigUint64Array.sort((a, b) => a - b); // BigUint64Array + + +//// [arraySort.js] +var strTuple; +strTuple.sort(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +var numTuple; +numTuple.sort(function (a, b) { return a - b; }); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +var int8Array; +int8Array.sort(function (a, b) { return a - b; }); // Int8Array +var uint8Array; +uint8Array.sort(function (a, b) { return a - b; }); // Uint8Array +var uint8ClampedArray; +uint8ClampedArray.sort(function (a, b) { return a - b; }); // Uint8ClampedArray +var int16Array; +int16Array.sort(function (a, b) { return a - b; }); // Int16Array +var uint16Array; +uint16Array.sort(function (a, b) { return a - b; }); // Uint16Array +var int32Array; +int32Array.sort(function (a, b) { return a - b; }); // Int32Array +var uint32Array; +uint32Array.sort(function (a, b) { return a - b; }); // Uint32Array +var float32Array; +float32Array.sort(function (a, b) { return a - b; }); // Float32Array +var float64Array; +float64Array.sort(function (a, b) { return a - b; }); // Float64Array +var bigInt64Array; +bigInt64Array.sort(function (a, b) { return a - b; }); // BigInt64Array +var bigUint64Array; +bigUint64Array.sort(function (a, b) { return a - b; }); // BigUint64Array diff --git a/tests/baselines/reference/arraySort.symbols b/tests/baselines/reference/arraySort.symbols new file mode 100644 index 0000000000000..e735221f1e7bd --- /dev/null +++ b/tests/baselines/reference/arraySort.symbols @@ -0,0 +1,208 @@ +=== tests/cases/compiler/arraySort.ts === +var strTuple: ["foo", "bar", "baz"]; +>strTuple : Symbol(strTuple, Decl(arraySort.ts, 0, 3)) + +strTuple.sort(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +>strTuple.sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>strTuple : Symbol(strTuple, Decl(arraySort.ts, 0, 3)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) + +var numTuple: [11, 2, 22, 1]; +>numTuple : Symbol(numTuple, Decl(arraySort.ts, 3, 3)) + +numTuple.sort((a, b) => a - b); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +>numTuple.sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>numTuple : Symbol(numTuple, Decl(arraySort.ts, 3, 3)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 4, 15)) +>b : Symbol(b, Decl(arraySort.ts, 4, 17)) +>a : Symbol(a, Decl(arraySort.ts, 4, 15)) +>b : Symbol(b, Decl(arraySort.ts, 4, 17)) + +interface Int8ArrayExtension extends Int8Array {} +>Int8ArrayExtension : Symbol(Int8ArrayExtension, Decl(arraySort.ts, 4, 31)) +>Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int8Array: Int8ArrayExtension; +>int8Array : Symbol(int8Array, Decl(arraySort.ts, 7, 3)) +>Int8ArrayExtension : Symbol(Int8ArrayExtension, Decl(arraySort.ts, 4, 31)) + +int8Array.sort((a, b) => a - b); // Int8Array +>int8Array.sort : Symbol(Int8Array.sort, Decl(lib.es5.d.ts, --, --)) +>int8Array : Symbol(int8Array, Decl(arraySort.ts, 7, 3)) +>sort : Symbol(Int8Array.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 8, 16)) +>b : Symbol(b, Decl(arraySort.ts, 8, 18)) +>a : Symbol(a, Decl(arraySort.ts, 8, 16)) +>b : Symbol(b, Decl(arraySort.ts, 8, 18)) + +interface Uint8ArrayExtension extends Uint8Array {} +>Uint8ArrayExtension : Symbol(Uint8ArrayExtension, Decl(arraySort.ts, 8, 32)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8Array: Uint8ArrayExtension; +>uint8Array : Symbol(uint8Array, Decl(arraySort.ts, 11, 3)) +>Uint8ArrayExtension : Symbol(Uint8ArrayExtension, Decl(arraySort.ts, 8, 32)) + +uint8Array.sort((a, b) => a - b); // Uint8Array +>uint8Array.sort : Symbol(Uint8Array.sort, Decl(lib.es5.d.ts, --, --)) +>uint8Array : Symbol(uint8Array, Decl(arraySort.ts, 11, 3)) +>sort : Symbol(Uint8Array.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 12, 17)) +>b : Symbol(b, Decl(arraySort.ts, 12, 19)) +>a : Symbol(a, Decl(arraySort.ts, 12, 17)) +>b : Symbol(b, Decl(arraySort.ts, 12, 19)) + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +>Uint8ClampedArrayExtension : Symbol(Uint8ClampedArrayExtension, Decl(arraySort.ts, 12, 33)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint8ClampedArray: Uint8ClampedArrayExtension; +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arraySort.ts, 15, 3)) +>Uint8ClampedArrayExtension : Symbol(Uint8ClampedArrayExtension, Decl(arraySort.ts, 12, 33)) + +uint8ClampedArray.sort((a, b) => a - b); // Uint8ClampedArray +>uint8ClampedArray.sort : Symbol(Uint8ClampedArray.sort, Decl(lib.es5.d.ts, --, --)) +>uint8ClampedArray : Symbol(uint8ClampedArray, Decl(arraySort.ts, 15, 3)) +>sort : Symbol(Uint8ClampedArray.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 16, 24)) +>b : Symbol(b, Decl(arraySort.ts, 16, 26)) +>a : Symbol(a, Decl(arraySort.ts, 16, 24)) +>b : Symbol(b, Decl(arraySort.ts, 16, 26)) + +interface Int16ArrayExtension extends Int16Array {} +>Int16ArrayExtension : Symbol(Int16ArrayExtension, Decl(arraySort.ts, 16, 40)) +>Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int16Array: Int16ArrayExtension; +>int16Array : Symbol(int16Array, Decl(arraySort.ts, 19, 3)) +>Int16ArrayExtension : Symbol(Int16ArrayExtension, Decl(arraySort.ts, 16, 40)) + +int16Array.sort((a, b) => a - b); // Int16Array +>int16Array.sort : Symbol(Int16Array.sort, Decl(lib.es5.d.ts, --, --)) +>int16Array : Symbol(int16Array, Decl(arraySort.ts, 19, 3)) +>sort : Symbol(Int16Array.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 20, 17)) +>b : Symbol(b, Decl(arraySort.ts, 20, 19)) +>a : Symbol(a, Decl(arraySort.ts, 20, 17)) +>b : Symbol(b, Decl(arraySort.ts, 20, 19)) + +interface Uint16ArrayExtension extends Uint16Array {} +>Uint16ArrayExtension : Symbol(Uint16ArrayExtension, Decl(arraySort.ts, 20, 33)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint16Array: Uint16ArrayExtension; +>uint16Array : Symbol(uint16Array, Decl(arraySort.ts, 23, 3)) +>Uint16ArrayExtension : Symbol(Uint16ArrayExtension, Decl(arraySort.ts, 20, 33)) + +uint16Array.sort((a, b) => a - b); // Uint16Array +>uint16Array.sort : Symbol(Uint16Array.sort, Decl(lib.es5.d.ts, --, --)) +>uint16Array : Symbol(uint16Array, Decl(arraySort.ts, 23, 3)) +>sort : Symbol(Uint16Array.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 24, 18)) +>b : Symbol(b, Decl(arraySort.ts, 24, 20)) +>a : Symbol(a, Decl(arraySort.ts, 24, 18)) +>b : Symbol(b, Decl(arraySort.ts, 24, 20)) + +interface Int32ArrayExtension extends Int32Array {} +>Int32ArrayExtension : Symbol(Int32ArrayExtension, Decl(arraySort.ts, 24, 34)) +>Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var int32Array: Int32ArrayExtension; +>int32Array : Symbol(int32Array, Decl(arraySort.ts, 27, 3)) +>Int32ArrayExtension : Symbol(Int32ArrayExtension, Decl(arraySort.ts, 24, 34)) + +int32Array.sort((a, b) => a - b); // Int32Array +>int32Array.sort : Symbol(Int32Array.sort, Decl(lib.es5.d.ts, --, --)) +>int32Array : Symbol(int32Array, Decl(arraySort.ts, 27, 3)) +>sort : Symbol(Int32Array.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 28, 17)) +>b : Symbol(b, Decl(arraySort.ts, 28, 19)) +>a : Symbol(a, Decl(arraySort.ts, 28, 17)) +>b : Symbol(b, Decl(arraySort.ts, 28, 19)) + +interface Uint32ArrayExtension extends Uint32Array {} +>Uint32ArrayExtension : Symbol(Uint32ArrayExtension, Decl(arraySort.ts, 28, 33)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var uint32Array: Uint32ArrayExtension; +>uint32Array : Symbol(uint32Array, Decl(arraySort.ts, 31, 3)) +>Uint32ArrayExtension : Symbol(Uint32ArrayExtension, Decl(arraySort.ts, 28, 33)) + +uint32Array.sort((a, b) => a - b); // Uint32Array +>uint32Array.sort : Symbol(Uint32Array.sort, Decl(lib.es5.d.ts, --, --)) +>uint32Array : Symbol(uint32Array, Decl(arraySort.ts, 31, 3)) +>sort : Symbol(Uint32Array.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 32, 18)) +>b : Symbol(b, Decl(arraySort.ts, 32, 20)) +>a : Symbol(a, Decl(arraySort.ts, 32, 18)) +>b : Symbol(b, Decl(arraySort.ts, 32, 20)) + +interface Float32ArrayExtension extends Float32Array {} +>Float32ArrayExtension : Symbol(Float32ArrayExtension, Decl(arraySort.ts, 32, 34)) +>Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float32Array: Float32ArrayExtension; +>float32Array : Symbol(float32Array, Decl(arraySort.ts, 35, 3)) +>Float32ArrayExtension : Symbol(Float32ArrayExtension, Decl(arraySort.ts, 32, 34)) + +float32Array.sort((a, b) => a - b); // Float32Array +>float32Array.sort : Symbol(Float32Array.sort, Decl(lib.es5.d.ts, --, --)) +>float32Array : Symbol(float32Array, Decl(arraySort.ts, 35, 3)) +>sort : Symbol(Float32Array.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 36, 19)) +>b : Symbol(b, Decl(arraySort.ts, 36, 21)) +>a : Symbol(a, Decl(arraySort.ts, 36, 19)) +>b : Symbol(b, Decl(arraySort.ts, 36, 21)) + +interface Float64ArrayExtension extends Float64Array {} +>Float64ArrayExtension : Symbol(Float64ArrayExtension, Decl(arraySort.ts, 36, 35)) +>Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 2 more) + +var float64Array: Float64ArrayExtension; +>float64Array : Symbol(float64Array, Decl(arraySort.ts, 39, 3)) +>Float64ArrayExtension : Symbol(Float64ArrayExtension, Decl(arraySort.ts, 36, 35)) + +float64Array.sort((a, b) => a - b); // Float64Array +>float64Array.sort : Symbol(Float64Array.sort, Decl(lib.es5.d.ts, --, --)) +>float64Array : Symbol(float64Array, Decl(arraySort.ts, 39, 3)) +>sort : Symbol(Float64Array.sort, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 40, 19)) +>b : Symbol(b, Decl(arraySort.ts, 40, 21)) +>a : Symbol(a, Decl(arraySort.ts, 40, 19)) +>b : Symbol(b, Decl(arraySort.ts, 40, 21)) + +interface BigInt64ArrayExtension extends BigInt64Array {} +>BigInt64ArrayExtension : Symbol(BigInt64ArrayExtension, Decl(arraySort.ts, 40, 35)) +>BigInt64Array : Symbol(BigInt64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +var bigInt64Array: BigInt64ArrayExtension; +>bigInt64Array : Symbol(bigInt64Array, Decl(arraySort.ts, 43, 3)) +>BigInt64ArrayExtension : Symbol(BigInt64ArrayExtension, Decl(arraySort.ts, 40, 35)) + +bigInt64Array.sort((a, b) => a - b); // BigInt64Array +>bigInt64Array.sort : Symbol(BigInt64Array.sort, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigInt64Array : Symbol(bigInt64Array, Decl(arraySort.ts, 43, 3)) +>sort : Symbol(BigInt64Array.sort, Decl(lib.es2020.bigint.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 44, 20)) +>b : Symbol(b, Decl(arraySort.ts, 44, 22)) +>a : Symbol(a, Decl(arraySort.ts, 44, 20)) +>b : Symbol(b, Decl(arraySort.ts, 44, 22)) + +interface BigUint64ArrayExtension extends BigUint64Array {} +>BigUint64ArrayExtension : Symbol(BigUint64ArrayExtension, Decl(arraySort.ts, 44, 36)) +>BigUint64Array : Symbol(BigUint64Array, Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2022.array.d.ts, --, --), Decl(lib.es2023.array.d.ts, --, --)) + +var bigUint64Array: BigUint64ArrayExtension; +>bigUint64Array : Symbol(bigUint64Array, Decl(arraySort.ts, 47, 3)) +>BigUint64ArrayExtension : Symbol(BigUint64ArrayExtension, Decl(arraySort.ts, 44, 36)) + +bigUint64Array.sort((a, b) => a - b); // BigUint64Array +>bigUint64Array.sort : Symbol(BigUint64Array.sort, Decl(lib.es2020.bigint.d.ts, --, --)) +>bigUint64Array : Symbol(bigUint64Array, Decl(arraySort.ts, 47, 3)) +>sort : Symbol(BigUint64Array.sort, Decl(lib.es2020.bigint.d.ts, --, --)) +>a : Symbol(a, Decl(arraySort.ts, 48, 21)) +>b : Symbol(b, Decl(arraySort.ts, 48, 23)) +>a : Symbol(a, Decl(arraySort.ts, 48, 21)) +>b : Symbol(b, Decl(arraySort.ts, 48, 23)) + diff --git a/tests/baselines/reference/arraySort.types b/tests/baselines/reference/arraySort.types new file mode 100644 index 0000000000000..80650f3f43c14 --- /dev/null +++ b/tests/baselines/reference/arraySort.types @@ -0,0 +1,201 @@ +=== tests/cases/compiler/arraySort.ts === +var strTuple: ["foo", "bar", "baz"]; +>strTuple : ["foo", "bar", "baz"] + +strTuple.sort(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] +>strTuple.sort() : ("foo" | "bar" | "baz")[] +>strTuple.sort : (compareFn?: (a: "foo" | "bar" | "baz", b: "foo" | "bar" | "baz") => number) => ("foo" | "bar" | "baz")[] +>strTuple : ["foo", "bar", "baz"] +>sort : (compareFn?: (a: "foo" | "bar" | "baz", b: "foo" | "bar" | "baz") => number) => ("foo" | "bar" | "baz")[] + +var numTuple: [11, 2, 22, 1]; +>numTuple : [11, 2, 22, 1] + +numTuple.sort((a, b) => a - b); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] +>numTuple.sort((a, b) => a - b) : (11 | 2 | 22 | 1)[] +>numTuple.sort : (compareFn?: (a: 11 | 2 | 22 | 1, b: 11 | 2 | 22 | 1) => number) => (11 | 2 | 22 | 1)[] +>numTuple : [11, 2, 22, 1] +>sort : (compareFn?: (a: 11 | 2 | 22 | 1, b: 11 | 2 | 22 | 1) => number) => (11 | 2 | 22 | 1)[] +>(a, b) => a - b : (a: 11 | 2 | 22 | 1, b: 11 | 2 | 22 | 1) => number +>a : 11 | 2 | 22 | 1 +>b : 11 | 2 | 22 | 1 +>a - b : number +>a : 11 | 2 | 22 | 1 +>b : 11 | 2 | 22 | 1 + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +>int8Array : Int8ArrayExtension + +int8Array.sort((a, b) => a - b); // Int8Array +>int8Array.sort((a, b) => a - b) : Int8Array +>int8Array.sort : (compareFn?: (a: number, b: number) => number) => Int8Array +>int8Array : Int8ArrayExtension +>sort : (compareFn?: (a: number, b: number) => number) => Int8Array +>(a, b) => a - b : (a: number, b: number) => number +>a : number +>b : number +>a - b : number +>a : number +>b : number + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +>uint8Array : Uint8ArrayExtension + +uint8Array.sort((a, b) => a - b); // Uint8Array +>uint8Array.sort((a, b) => a - b) : Uint8Array +>uint8Array.sort : (compareFn?: (a: number, b: number) => number) => Uint8Array +>uint8Array : Uint8ArrayExtension +>sort : (compareFn?: (a: number, b: number) => number) => Uint8Array +>(a, b) => a - b : (a: number, b: number) => number +>a : number +>b : number +>a - b : number +>a : number +>b : number + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +>uint8ClampedArray : Uint8ClampedArrayExtension + +uint8ClampedArray.sort((a, b) => a - b); // Uint8ClampedArray +>uint8ClampedArray.sort((a, b) => a - b) : Uint8ClampedArray +>uint8ClampedArray.sort : (compareFn?: (a: number, b: number) => number) => Uint8ClampedArray +>uint8ClampedArray : Uint8ClampedArrayExtension +>sort : (compareFn?: (a: number, b: number) => number) => Uint8ClampedArray +>(a, b) => a - b : (a: number, b: number) => number +>a : number +>b : number +>a - b : number +>a : number +>b : number + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +>int16Array : Int16ArrayExtension + +int16Array.sort((a, b) => a - b); // Int16Array +>int16Array.sort((a, b) => a - b) : Int16Array +>int16Array.sort : (compareFn?: (a: number, b: number) => number) => Int16Array +>int16Array : Int16ArrayExtension +>sort : (compareFn?: (a: number, b: number) => number) => Int16Array +>(a, b) => a - b : (a: number, b: number) => number +>a : number +>b : number +>a - b : number +>a : number +>b : number + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +>uint16Array : Uint16ArrayExtension + +uint16Array.sort((a, b) => a - b); // Uint16Array +>uint16Array.sort((a, b) => a - b) : Uint16Array +>uint16Array.sort : (compareFn?: (a: number, b: number) => number) => Uint16Array +>uint16Array : Uint16ArrayExtension +>sort : (compareFn?: (a: number, b: number) => number) => Uint16Array +>(a, b) => a - b : (a: number, b: number) => number +>a : number +>b : number +>a - b : number +>a : number +>b : number + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +>int32Array : Int32ArrayExtension + +int32Array.sort((a, b) => a - b); // Int32Array +>int32Array.sort((a, b) => a - b) : Int32Array +>int32Array.sort : (compareFn?: (a: number, b: number) => number) => Int32Array +>int32Array : Int32ArrayExtension +>sort : (compareFn?: (a: number, b: number) => number) => Int32Array +>(a, b) => a - b : (a: number, b: number) => number +>a : number +>b : number +>a - b : number +>a : number +>b : number + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +>uint32Array : Uint32ArrayExtension + +uint32Array.sort((a, b) => a - b); // Uint32Array +>uint32Array.sort((a, b) => a - b) : Uint32Array +>uint32Array.sort : (compareFn?: (a: number, b: number) => number) => Uint32Array +>uint32Array : Uint32ArrayExtension +>sort : (compareFn?: (a: number, b: number) => number) => Uint32Array +>(a, b) => a - b : (a: number, b: number) => number +>a : number +>b : number +>a - b : number +>a : number +>b : number + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +>float32Array : Float32ArrayExtension + +float32Array.sort((a, b) => a - b); // Float32Array +>float32Array.sort((a, b) => a - b) : Float32Array +>float32Array.sort : (compareFn?: (a: number, b: number) => number) => Float32Array +>float32Array : Float32ArrayExtension +>sort : (compareFn?: (a: number, b: number) => number) => Float32Array +>(a, b) => a - b : (a: number, b: number) => number +>a : number +>b : number +>a - b : number +>a : number +>b : number + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +>float64Array : Float64ArrayExtension + +float64Array.sort((a, b) => a - b); // Float64Array +>float64Array.sort((a, b) => a - b) : Float64Array +>float64Array.sort : (compareFn?: (a: number, b: number) => number) => Float64Array +>float64Array : Float64ArrayExtension +>sort : (compareFn?: (a: number, b: number) => number) => Float64Array +>(a, b) => a - b : (a: number, b: number) => number +>a : number +>b : number +>a - b : number +>a : number +>b : number + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +>bigInt64Array : BigInt64ArrayExtension + +bigInt64Array.sort((a, b) => a - b); // BigInt64Array +>bigInt64Array.sort((a, b) => a - b) : BigInt64Array +>bigInt64Array.sort : (compareFn?: (a: bigint, b: bigint) => number | bigint) => BigInt64Array +>bigInt64Array : BigInt64ArrayExtension +>sort : (compareFn?: (a: bigint, b: bigint) => number | bigint) => BigInt64Array +>(a, b) => a - b : (a: bigint, b: bigint) => bigint +>a : bigint +>b : bigint +>a - b : bigint +>a : bigint +>b : bigint + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +>bigUint64Array : BigUint64ArrayExtension + +bigUint64Array.sort((a, b) => a - b); // BigUint64Array +>bigUint64Array.sort((a, b) => a - b) : BigUint64Array +>bigUint64Array.sort : (compareFn?: (a: bigint, b: bigint) => number | bigint) => BigUint64Array +>bigUint64Array : BigUint64ArrayExtension +>sort : (compareFn?: (a: bigint, b: bigint) => number | bigint) => BigUint64Array +>(a, b) => a - b : (a: bigint, b: bigint) => bigint +>a : bigint +>b : bigint +>a - b : bigint +>a : bigint +>b : bigint + diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.types b/tests/baselines/reference/arrayTypeOfTypeOf.types index 60eec5fbba21b..fd4cab76a1191 100644 --- a/tests/baselines/reference/arrayTypeOfTypeOf.types +++ b/tests/baselines/reference/arrayTypeOfTypeOf.types @@ -14,11 +14,11 @@ var xs2: typeof Array; >Array : ArrayConstructor var xs3: typeof Array; ->xs3 : { (arrayLength: number): number[]; (...items: number[]): number[]; new (arrayLength: number): number[]; new (...items: number[]): number[]; isArray(arg: any): arg is any[]; readonly prototype: any[]; } +>xs3 : { (arrayLength: number): number[]; (...items: number[]): number[]; new (arrayLength: number): number[]; new (...items: number[]): number[]; isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; } >Array : ArrayConstructor var xs4: typeof Array; ->xs4 : { (arrayLength: number): number[]; (...items: number[]): number[]; new (arrayLength: number): number[]; new (...items: number[]): number[]; isArray(arg: any): arg is any[]; readonly prototype: any[]; } +>xs4 : { (arrayLength: number): number[]; (...items: number[]): number[]; new (arrayLength: number): number[]; new (...items: number[]): number[]; isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; } >Array : ArrayConstructor >x : number diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index bfc87bff5d8dd..514b9364ffafd 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -2,24 +2,20 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function c tests/cases/compiler/bigintWithLib.ts(19,33): error TS2769: No overload matches this call. Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. - Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. - The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. - Type 'IteratorResult' is not assignable to type 'IteratorResult'. - Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. - Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. - Type 'number' is not assignable to type 'bigint'. - Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'. + Overload 2 of 3, '(array: ArrayLikeOrIterable | ArrayBufferLike): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'ArrayLikeOrIterable | ArrayBufferLike'. Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] + Overload 3 of 3, '(buffer: ArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer'. + Type 'number[]' is missing the following properties from type 'ArrayBuffer': byteLength, [Symbol.toStringTag] tests/cases/compiler/bigintWithLib.ts(24,13): error TS2540: Cannot assign to 'length' because it is a read-only property. tests/cases/compiler/bigintWithLib.ts(31,35): error TS2769: No overload matches this call. Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. Argument of type 'number[]' is not assignable to parameter of type 'number'. - Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. - Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array', gave the following error. - Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'. + Overload 2 of 3, '(array: ArrayLikeOrIterable | ArrayBufferLike): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'ArrayLikeOrIterable | ArrayBufferLike'. + Overload 3 of 3, '(buffer: ArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. + Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer'. tests/cases/compiler/bigintWithLib.ts(36,13): error TS2540: Cannot assign to 'length' because it is a read-only property. tests/cases/compiler/bigintWithLib.ts(43,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'bigint'. tests/cases/compiler/bigintWithLib.ts(46,26): error TS2345: Argument of type 'number' is not assignable to parameter of type 'bigint'. @@ -51,16 +47,12 @@ tests/cases/compiler/bigintWithLib.ts(46,26): error TS2345: Argument of type 'nu !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error. !!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! error TS2769: Overload 2 of 3, '(array: Iterable): BigInt64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2769: The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. -!!! error TS2769: Type 'IteratorResult' is not assignable to type 'IteratorResult'. -!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. -!!! error TS2769: Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. -!!! error TS2769: Type 'number' is not assignable to type 'bigint'. -!!! error TS2769: Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigInt64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'. +!!! error TS2769: Overload 2 of 3, '(array: ArrayLikeOrIterable | ArrayBufferLike): BigInt64Array', gave the following error. +!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayLikeOrIterable | ArrayBufferLike'. !!! error TS2769: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] +!!! error TS2769: Overload 3 of 3, '(buffer: ArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error. +!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer'. +!!! error TS2769: Type 'number[]' is missing the following properties from type 'ArrayBuffer': byteLength, [Symbol.toStringTag] bigIntArray = new BigInt64Array(new ArrayBuffer(80)); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8); bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3); @@ -79,10 +71,10 @@ tests/cases/compiler/bigintWithLib.ts(46,26): error TS2345: Argument of type 'nu !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error. !!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'number'. -!!! error TS2769: Overload 2 of 3, '(array: Iterable): BigUint64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'Iterable'. -!!! error TS2769: Overload 3 of 3, '(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BigUint64Array', gave the following error. -!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBufferLike'. +!!! error TS2769: Overload 2 of 3, '(array: ArrayLikeOrIterable | ArrayBufferLike): BigUint64Array', gave the following error. +!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayLikeOrIterable | ArrayBufferLike'. +!!! error TS2769: Overload 3 of 3, '(buffer: ArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error. +!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer'. bigUintArray = new BigUint64Array(new ArrayBuffer(80)); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8); bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3); diff --git a/tests/baselines/reference/checkExportsObjectAssignProperty.types b/tests/baselines/reference/checkExportsObjectAssignProperty.types index 60fcd84477a12..77277f90ce369 100644 --- a/tests/baselines/reference/checkExportsObjectAssignProperty.types +++ b/tests/baselines/reference/checkExportsObjectAssignProperty.types @@ -176,9 +176,9 @@ m2.setonlyAccessor = 0; === tests/cases/conformance/jsdoc/mod1.js === Object.defineProperty(exports, "thing", { value: 42, writable: true }); >Object.defineProperty(exports, "thing", { value: 42, writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"thing" : "thing" >{ value: 42, writable: true } : { value: number; writable: true; } @@ -189,9 +189,9 @@ Object.defineProperty(exports, "thing", { value: 42, writable: true }); Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); >Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"readonlyProp" : "readonlyProp" >{ value: "Smith", writable: false } : { value: string; writable: false; } @@ -202,9 +202,9 @@ Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"rwAccessors" : "rwAccessors" >{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } @@ -215,9 +215,9 @@ Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); >Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"readonlyAccessor" : "readonlyAccessor" >{ get() { return 21.75 } } : { get(): number; } @@ -226,9 +226,9 @@ Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); Object.defineProperty(exports, "setonlyAccessor", { >Object.defineProperty(exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"setonlyAccessor" : "setonlyAccessor" >{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set(str: string): void; } @@ -252,9 +252,9 @@ Object.defineProperty(exports, "setonlyAccessor", { === tests/cases/conformance/jsdoc/mod2.js === Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); >Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -267,9 +267,9 @@ Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); >Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -282,9 +282,9 @@ Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -297,9 +297,9 @@ Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, s Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); >Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -310,9 +310,9 @@ Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 Object.defineProperty(module.exports, "setonlyAccessor", { >Object.defineProperty(module.exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports diff --git a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types index 6ea6a5ff129b8..1a24db4e9ec46 100644 --- a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types +++ b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.types @@ -129,9 +129,9 @@ Person.prototype.describe = function () { }; Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); >Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any @@ -144,9 +144,9 @@ Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }); >Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any @@ -159,9 +159,9 @@ Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writab Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any @@ -174,9 +174,9 @@ Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }); >Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any @@ -187,9 +187,9 @@ Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21. Object.defineProperty(Person.prototype, "setonlyAccessor", { >Object.defineProperty(Person.prototype, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Person.prototype : any >Person : typeof Person >prototype : any diff --git a/tests/baselines/reference/checkObjectDefineProperty.types b/tests/baselines/reference/checkObjectDefineProperty.types index 05f8b200c51f8..a96c2e2209571 100644 --- a/tests/baselines/reference/checkObjectDefineProperty.types +++ b/tests/baselines/reference/checkObjectDefineProperty.types @@ -89,9 +89,9 @@ const x = {}; Object.defineProperty(x, "name", { value: "Charles", writable: true }); >Object.defineProperty(x, "name", { value: "Charles", writable: true }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"name" : "name" >{ value: "Charles", writable: true } : { value: string; writable: true; } @@ -102,9 +102,9 @@ Object.defineProperty(x, "name", { value: "Charles", writable: true }); Object.defineProperty(x, "middleInit", { value: "H" }); >Object.defineProperty(x, "middleInit", { value: "H" }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"middleInit" : "middleInit" >{ value: "H" } : { value: string; } @@ -113,9 +113,9 @@ Object.defineProperty(x, "middleInit", { value: "H" }); Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); >Object.defineProperty(x, "lastName", { value: "Smith", writable: false }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"lastName" : "lastName" >{ value: "Smith", writable: false } : { value: string; writable: false; } @@ -126,9 +126,9 @@ Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }); >Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"zip" : "zip" >{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } @@ -139,9 +139,9 @@ Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); >Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"houseNumber" : "houseNumber" >{ get() { return 21.75 } } : { get(): number; } @@ -150,9 +150,9 @@ Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); Object.defineProperty(x, "zipStr", { >Object.defineProperty(x, "zipStr", { /** @param {string} str */ set(str) { this.zip = Number(str) }}) : typeof x ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >x : typeof x >"zipStr" : "zipStr" >{ /** @param {string} str */ set(str) { this.zip = Number(str) }} : { set(str: string): void; } diff --git a/tests/baselines/reference/checkOtherObjectAssignProperty.types b/tests/baselines/reference/checkOtherObjectAssignProperty.types index 180ea63989945..0ffa9620bc5fc 100644 --- a/tests/baselines/reference/checkOtherObjectAssignProperty.types +++ b/tests/baselines/reference/checkOtherObjectAssignProperty.types @@ -89,9 +89,9 @@ const obj = { value: 42, writable: true }; Object.defineProperty(exports, "thing", obj); >Object.defineProperty(exports, "thing", obj) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"thing" : "thing" >obj : { value: number; writable: boolean; } @@ -106,9 +106,9 @@ let str = /** @type {string} */("other"); Object.defineProperty(exports, str, { value: 42, writable: true }); >Object.defineProperty(exports, str, { value: 42, writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >str : string >{ value: 42, writable: true } : { value: number; writable: true; } @@ -123,9 +123,9 @@ const propName = "prop" Object.defineProperty(exports, propName, { value: 42, writable: true }); >Object.defineProperty(exports, propName, { value: 42, writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >propName : "prop" >{ value: 42, writable: true } : { value: number; writable: true; } @@ -137,18 +137,18 @@ Object.defineProperty(exports, propName, { value: 42, writable: true }); Object.defineProperty(exports, "bad1", { }); >Object.defineProperty(exports, "bad1", { }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"bad1" : "bad1" >{ } : {} Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); >Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"bad2" : "bad2" >{ get() { return 12 }, value: "no" } : { get(): number; value: string; } @@ -159,9 +159,9 @@ Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); Object.defineProperty(exports, "bad3", { writable: true }); >Object.defineProperty(exports, "bad3", { writable: true }) : typeof import("tests/cases/conformance/jsdoc/mod1") ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >exports : typeof import("tests/cases/conformance/jsdoc/mod1") >"bad3" : "bad3" >{ writable: true } : { writable: true; } diff --git a/tests/baselines/reference/completionEntryForUnionMethod.baseline b/tests/baselines/reference/completionEntryForUnionMethod.baseline index 738d7249b298b..0863127c81f2a 100644 --- a/tests/baselines/reference/completionEntryForUnionMethod.baseline +++ b/tests/baselines/reference/completionEntryForUnionMethod.baseline @@ -31,15 +31,13 @@ // | (method) Array.pop(): string | number // | (method) Array.push(items: never[]): number // | (property) Array.reduce: { -// | (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; -// | (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; +// | (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; // | (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; // | } | { // | ...; // | } // | (property) Array.reduceRight: { -// | (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; -// | (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; +// | (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; // | (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; // | } | { // | ...; @@ -53,6 +51,7 @@ // | (method) Array.toLocaleString(): string // | (method) Array.toString(): string // | (method) Array.unshift(items: never[]): number +// | (method) Array.valueOf(): string[] | number[] // | ---------------------------------------------------------------------- [ @@ -3382,118 +3381,6 @@ "text": "string", "kind": "keyword" }, - { - "text": ")", - "kind": "punctuation" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, - { - "text": ";", - "kind": "punctuation" - }, - { - "text": "\n", - "kind": "lineBreak" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "(", - "kind": "punctuation" - }, - { - "text": "callbackfn", - "kind": "parameterName" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "(", - "kind": "punctuation" - }, - { - "text": "previousValue", - "kind": "parameterName" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, - { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "currentValue", - "kind": "parameterName" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, - { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "currentIndex", - "kind": "parameterName" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "number", - "kind": "keyword" - }, { "text": ",", "kind": "punctuation" @@ -3503,61 +3390,13 @@ "kind": "space" }, { - "text": "array", + "text": "initialValue", "kind": "parameterName" }, { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, - { - "text": "[", - "kind": "punctuation" - }, - { - "text": "]", - "kind": "punctuation" - }, - { - "text": ")", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "=>", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, - { - "text": ",", + "text": "?", "kind": "punctuation" }, - { - "text": " ", - "kind": "space" - }, - { - "text": "initialValue", - "kind": "parameterName" - }, { "text": ":", "kind": "punctuation" @@ -4118,94 +3957,6 @@ "text": "string", "kind": "keyword" }, - { - "text": ")", - "kind": "punctuation" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, - { - "text": ";", - "kind": "punctuation" - }, - { - "text": "\n", - "kind": "lineBreak" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "(", - "kind": "punctuation" - }, - { - "text": "callbackfn", - "kind": "parameterName" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "(", - "kind": "punctuation" - }, - { - "text": "previousValue", - "kind": "parameterName" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, - { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "currentValue", - "kind": "parameterName" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, { "text": ",", "kind": "punctuation" @@ -4215,85 +3966,13 @@ "kind": "space" }, { - "text": "currentIndex", + "text": "initialValue", "kind": "parameterName" }, { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "number", - "kind": "keyword" - }, - { - "text": ",", + "text": "?", "kind": "punctuation" }, - { - "text": " ", - "kind": "space" - }, - { - "text": "array", - "kind": "parameterName" - }, - { - "text": ":", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, - { - "text": "[", - "kind": "punctuation" - }, - { - "text": "]", - "kind": "punctuation" - }, - { - "text": ")", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "=>", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "string", - "kind": "keyword" - }, - { - "text": ",", - "kind": "punctuation" - }, - { - "text": " ", - "kind": "space" - }, - { - "text": "initialValue", - "kind": "parameterName" - }, { "text": ":", "kind": "punctuation" @@ -5690,7 +5369,7 @@ "kind": "space" }, { - "text": "Function used to determine the order of the elements. It is expected to return\na negative value if the first argument is less than the second argument, zero if they're equal, and a positive\nvalue otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\n```ts\n[11,2,22,1].sort((a, b) => a - b)\n```", + "text": "Function used to determine the order of the elements. It is expected to return\na negative value if the first argument is less than the second argument, zero if they're equal, and a positive\nvalue otherwise. If omitted, the elements are sorted in ascending, ASCII character order.\n```ts\n[11, 2, 22, 1].sort((a, b) => a - b)\n```", "kind": "text" } ] @@ -5887,7 +5566,7 @@ "kind": "space" }, { - "text": "The zero-based location in the array from which to start removing elements.", + "text": "The zero-based index in the array from which to start removing elements.", "kind": "text" } ] @@ -5989,7 +5668,7 @@ ], "documentation": [ { - "text": "Returns a string representation of an array. The elements are converted to string using their toLocaleString methods.", + "text": "Returns a string representation of the array. The elements are converted to string using their toLocaleString methods.", "kind": "text" } ] @@ -6063,7 +5742,7 @@ ], "documentation": [ { - "text": "Returns a string representation of an array.", + "text": "Returns a string representation of the array.", "kind": "text" } ] @@ -6184,6 +5863,112 @@ ] } ] + }, + { + "name": "valueOf", + "kind": "method", + "kindModifiers": "declare", + "sortText": "11", + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "method", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "Array", + "kind": "localName" + }, + { + "text": "<", + "kind": "punctuation" + }, + { + "text": "T", + "kind": "typeParameterName" + }, + { + "text": ">", + "kind": "punctuation" + }, + { + "text": ".", + "kind": "punctuation" + }, + { + "text": "valueOf", + "kind": "propertyName" + }, + { + "text": "(", + "kind": "punctuation" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "|", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + }, + { + "text": "[", + "kind": "punctuation" + }, + { + "text": "]", + "kind": "punctuation" + } + ], + "documentation": [ + { + "text": "Returns the primitive value of the array.", + "kind": "text" + } + ] } ] } diff --git a/tests/baselines/reference/completionsCommentsClass.baseline b/tests/baselines/reference/completionsCommentsClass.baseline index 9c84a387981c4..a952454d7aedc 100644 --- a/tests/baselines/reference/completionsCommentsClass.baseline +++ b/tests/baselines/reference/completionsCommentsClass.baseline @@ -3404,7 +3404,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommentsClassMembers.baseline b/tests/baselines/reference/completionsCommentsClassMembers.baseline index cf4807c1d83c6..46d19d19a8faa 100644 --- a/tests/baselines/reference/completionsCommentsClassMembers.baseline +++ b/tests/baselines/reference/completionsCommentsClassMembers.baseline @@ -7444,7 +7444,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -14529,7 +14529,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -19367,7 +19367,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -26452,7 +26452,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -30541,7 +30541,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -35786,7 +35786,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -39829,7 +39829,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -45028,7 +45028,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -50273,7 +50273,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -55518,7 +55518,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -60763,7 +60763,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -64847,7 +64847,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -68931,7 +68931,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -73015,7 +73015,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -77099,7 +77099,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -81183,7 +81183,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -85267,7 +85267,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -89800,7 +89800,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -95170,7 +95170,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -99688,7 +99688,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommentsCommentParsing.baseline b/tests/baselines/reference/completionsCommentsCommentParsing.baseline index b7823ca0e0d46..780be629de68b 100644 --- a/tests/baselines/reference/completionsCommentsCommentParsing.baseline +++ b/tests/baselines/reference/completionsCommentsCommentParsing.baseline @@ -6266,7 +6266,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -12506,7 +12506,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -18382,7 +18382,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -24059,7 +24059,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -29862,7 +29862,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -36102,7 +36102,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -42007,7 +42007,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline b/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline index e8b72b51f629b..9bdfc8dabf2af 100644 --- a/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline +++ b/tests/baselines/reference/completionsCommentsFunctionDeclaration.baseline @@ -3802,7 +3802,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -7531,7 +7531,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -11638,7 +11638,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsCommentsFunctionExpression.baseline b/tests/baselines/reference/completionsCommentsFunctionExpression.baseline index dbafae6e08da1..8aac838a478ae 100644 --- a/tests/baselines/reference/completionsCommentsFunctionExpression.baseline +++ b/tests/baselines/reference/completionsCommentsFunctionExpression.baseline @@ -3693,7 +3693,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -8200,7 +8200,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -12155,7 +12155,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] @@ -16446,7 +16446,7 @@ ], "documentation": [ { - "text": "Allows manipulation and formatting of text strings and determination and location of substrings within strings.", + "text": "Allows manipulation and formatting of text strings and determination of location of substrings within strings.", "kind": "text" } ] diff --git a/tests/baselines/reference/completionsStringMethods.baseline b/tests/baselines/reference/completionsStringMethods.baseline index 0ef6b4203714d..ca8e574f6f89a 100644 --- a/tests/baselines/reference/completionsStringMethods.baseline +++ b/tests/baselines/reference/completionsStringMethods.baseline @@ -208,7 +208,7 @@ ], "documentation": [ { - "text": "Returns the Unicode value of the character at the specified location.", + "text": "Returns a non-negative integer less than 65536 (0x10000) that is the code unit value of the character at the specified index.", "kind": "text" } ], @@ -780,7 +780,7 @@ ], "documentation": [ { - "text": "Determines whether two strings are equivalent in the current locale.", + "text": "Determines whether the reference string comes before, after or is equivalent to the specified string in the current locale.\nReturns a negative integer if it comes before, a positive number if it comes after, and 0 if they are equivalent.", "kind": "text" } ], @@ -797,7 +797,7 @@ "kind": "space" }, { - "text": "String to compare to target string", + "text": "The string to compare to.", "kind": "text" } ] @@ -910,7 +910,7 @@ "kind": "space" }, { - "text": "A variable name or string literal containing the regular expression pattern and flags.", + "text": "The regular expression for matching. If the provided value is not a RegExp, it is implicitly\nconverted to a RegExp by using `new RegExp(regexp)`.", "kind": "text" } ] @@ -1058,7 +1058,53 @@ ], "documentation": [ { - "text": "Replaces text in a string, using a regular expression or search string.", + "text": "Replaces one or more occurrences of substrings that match a search string or a regular expression.\nWhen the ", + "kind": "text" + }, + { + "text": "{@linkcode ", + "kind": "link" + }, + { + "text": "searchValue", + "kind": "linkName", + "target": { + "fileName": "lib.d.ts", + "textSpan": { + "start": 19348, + "length": 28 + } + } + }, + { + "text": "}", + "kind": "link" + }, + { + "text": " is a `RegExp`, all matches are replaced if the `g` (global) flag is set\n(or only those matches at the beginning, if the `y` (sticky) flag is also present).\nOtherwise, only the first match of ", + "kind": "text" + }, + { + "text": "{@linkcode ", + "kind": "link" + }, + { + "text": "searchValue", + "kind": "linkName", + "target": { + "fileName": "lib.d.ts", + "textSpan": { + "start": 19348, + "length": 28 + } + } + }, + { + "text": "}", + "kind": "link" + }, + { + "text": " is replaced.", "kind": "text" } ], @@ -1092,53 +1138,7 @@ "kind": "space" }, { - "text": "A string containing the text to replace. When the ", - "kind": "text" - }, - { - "text": "{@linkcode ", - "kind": "link" - }, - { - "text": "searchValue", - "kind": "linkName", - "target": { - "fileName": "lib.d.ts", - "textSpan": { - "start": 18529, - "length": 28 - } - } - }, - { - "text": "}", - "kind": "link" - }, - { - "text": " is a `RegExp`, all matches are replaced if the `g` flag is set (or only those matches at the beginning, if the `y` flag is also present). Otherwise, only the first match of ", - "kind": "text" - }, - { - "text": "{@linkcode ", - "kind": "link" - }, - { - "text": "searchValue", - "kind": "linkName", - "target": { - "fileName": "lib.d.ts", - "textSpan": { - "start": 18529, - "length": 28 - } - } - }, - { - "text": "}", - "kind": "link" - }, - { - "text": " is replaced.", + "text": "The replacement text.", "kind": "text" } ] @@ -1251,7 +1251,7 @@ "kind": "space" }, { - "text": "The regular expression pattern and applicable flags.", + "text": "The regular expression for matching. If the provided value is not a RegExp, it is implicitly\nconverted to a RegExp by using `new RegExp(regexp)`.", "kind": "text" } ] @@ -1380,7 +1380,7 @@ "kind": "space" }, { - "text": "The index to the beginning of the specified portion of stringObj.", + "text": "The index to the beginning of the specified portion of the string.", "kind": "text" } ] @@ -1397,7 +1397,7 @@ "kind": "space" }, { - "text": "The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\nIf this value is not specified, the substring continues to the end of stringObj.", + "text": "The index to the end of the specified portion of the string. The substring includes the characters up to, but not including, the character indicated by end.\nIf this value is not specified, the substring continues to the end of the string.", "kind": "text" } ] @@ -1671,7 +1671,7 @@ ], "documentation": [ { - "text": "Returns the substring at the specified location within a String object.", + "text": "Returns the substring beginning at the specified index within a String object.", "kind": "text" } ], @@ -1688,7 +1688,7 @@ "kind": "space" }, { - "text": "The zero-based index number indicating the beginning of the substring.", + "text": "The zero-based index indicating the beginning of the substring.", "kind": "text" } ] @@ -1705,7 +1705,7 @@ "kind": "space" }, { - "text": "Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned.", + "text": "The zero-based index indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned.", "kind": "text" } ] @@ -2335,7 +2335,7 @@ ], "documentation": [ { - "text": "Gets a substring beginning at the specified location and having the specified length.", + "text": "Gets a substring beginning at the specified index and having the specified length.", "kind": "text" } ], @@ -2361,7 +2361,7 @@ "kind": "space" }, { - "text": "The starting position of the desired substring. The index of the first character in the string is zero.", + "text": "The starting index of the desired substring. The index of the first character in the string is zero.", "kind": "text" } ] diff --git a/tests/baselines/reference/conditionalTypeDoesntSpinForever.symbols b/tests/baselines/reference/conditionalTypeDoesntSpinForever.symbols index b5dcb78015b3f..3e2f1b61b791a 100644 --- a/tests/baselines/reference/conditionalTypeDoesntSpinForever.symbols +++ b/tests/baselines/reference/conditionalTypeDoesntSpinForever.symbols @@ -77,9 +77,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {name: instance as TYPE}) as SO_FAR & {name: TYPE}) as BuildPubSubRecordType >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 21, 45)) >name : Symbol(name, Decl(conditionalTypeDoesntSpinForever.ts, 24, 56)) >instance : Symbol(instance, Decl(conditionalTypeDoesntSpinForever.ts, 23, 19)) @@ -133,9 +133,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 34, 44)) >storedAs : Symbol(storedAs, Decl(conditionalTypeDoesntSpinForever.ts, 37, 56)) >PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString : Symbol(PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString, Decl(conditionalTypeDoesntSpinForever.ts, 4, 28)) @@ -154,9 +154,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 34, 44)) >storedAs : Symbol(storedAs, Decl(conditionalTypeDoesntSpinForever.ts, 40, 56)) >PubSubRecordIsStoredInRedisAsA.redisHash : Symbol(PubSubRecordIsStoredInRedisAsA.redisHash, Decl(conditionalTypeDoesntSpinForever.ts, 3, 44)) @@ -217,9 +217,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {identifier: instance as TYPE}) as SO_FAR & {identifier: TYPE}) as BuildPubSubRecordType >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 51, 51)) >identifier : Symbol(identifier, Decl(conditionalTypeDoesntSpinForever.ts, 54, 56)) >instance : Symbol(instance, Decl(conditionalTypeDoesntSpinForever.ts, 53, 25)) @@ -271,9 +271,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {record: instance as TYPE}) as SO_FAR & {record: TYPE}) as BuildPubSubRecordType >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 63, 47)) >record : Symbol(record, Decl(conditionalTypeDoesntSpinForever.ts, 66, 56)) >instance : Symbol(instance, Decl(conditionalTypeDoesntSpinForever.ts, 65, 21)) @@ -327,9 +327,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) as BuildPubSubRecordType, >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 76, 68)) >maxMsToWaitBeforePublishing : Symbol(maxMsToWaitBeforePublishing, Decl(conditionalTypeDoesntSpinForever.ts, 79, 56)) >instance : Symbol(instance, Decl(conditionalTypeDoesntSpinForever.ts, 78, 36)) @@ -342,9 +342,9 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType, >buildPubSubRecordType : Symbol(buildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 108, 7)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 76, 68)) >maxMsToWaitBeforePublishing : Symbol(maxMsToWaitBeforePublishing, Decl(conditionalTypeDoesntSpinForever.ts, 81, 56)) >BuildPubSubRecordType : Symbol(BuildPubSubRecordType, Decl(conditionalTypeDoesntSpinForever.ts, 98, 4)) @@ -450,9 +450,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >SO_FAR : Symbol(SO_FAR, Decl(conditionalTypeDoesntSpinForever.ts, 108, 33)) >soFar : Symbol(soFar, Decl(conditionalTypeDoesntSpinForever.ts, 108, 41)) >SO_FAR : Symbol(SO_FAR, Decl(conditionalTypeDoesntSpinForever.ts, 108, 33)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) {}, buildNameFieldConstructor(soFar), diff --git a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types index a7b17a7cc6d0a..83bb366ca0913 100644 --- a/tests/baselines/reference/conditionalTypeDoesntSpinForever.types +++ b/tests/baselines/reference/conditionalTypeDoesntSpinForever.types @@ -68,10 +68,10 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {name: instance as TYPE}) as SO_FAR & {name: TYPE}) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {name: instance as TYPE}) as SO_FAR & {name: TYPE} : SO_FAR & { name: TYPE; } ->Object.assign({}, soFar, {name: instance as TYPE}) : SO_FAR & { name: TYPE; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {name: instance as TYPE}) : Writable & Writable<{ name: TYPE; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{name: instance as TYPE} : { name: TYPE; } @@ -120,12 +120,12 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as >buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType & Writable<{ storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }>> >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : Writable & Writable<{ storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString} : { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; } @@ -144,12 +144,12 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as >buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType & Writable<{ storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }>> >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : Writable & Writable<{ storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{storedAs: PubSubRecordIsStoredInRedisAsA.redisHash} : { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; } @@ -212,10 +212,10 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {identifier: instance as TYPE}) as SO_FAR & {identifier: TYPE}) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {identifier: instance as TYPE}) as SO_FAR & {identifier: TYPE} : SO_FAR & { identifier: TYPE; } ->Object.assign({}, soFar, {identifier: instance as TYPE}) : SO_FAR & Record<"record", unknown> & { identifier: TYPE; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {identifier: instance as TYPE}) : Writable> & Writable<{ identifier: TYPE; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR & Record<"record", unknown> >{identifier: instance as TYPE} : { identifier: TYPE; } @@ -264,10 +264,10 @@ export enum PubSubRecordIsStoredInRedisAsA { >buildPubSubRecordType(Object.assign({}, soFar, {record: instance as TYPE}) as SO_FAR & {record: TYPE}) : BuildPubSubRecordType >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType >Object.assign({}, soFar, {record: instance as TYPE}) as SO_FAR & {record: TYPE} : SO_FAR & { record: TYPE; } ->Object.assign({}, soFar, {record: instance as TYPE}) : SO_FAR & { record: TYPE; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {record: instance as TYPE}) : Writable & Writable<{ record: TYPE; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{record: instance as TYPE} : { record: TYPE; } @@ -318,12 +318,12 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) as BuildPubSubRecordType, >buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) : BuildPubSubRecordType & Writable<{ maxMsToWaitBeforePublishing: number; }>> >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance}) : SO_FAR & { maxMsToWaitBeforePublishing: number; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance}) : Writable & Writable<{ maxMsToWaitBeforePublishing: number; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR >{maxMsToWaitBeforePublishing: instance} : { maxMsToWaitBeforePublishing: number; } @@ -337,16 +337,16 @@ export enum PubSubRecordIsStoredInRedisAsA { buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType, >buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType : BuildPubSubRecordType ->buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType +>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType & Writable<{ maxMsToWaitBeforePublishing: 0; }>> >buildPubSubRecordType : (soFar: SO_FAR) => BuildPubSubRecordType ->Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : SO_FAR & { maxMsToWaitBeforePublishing: number; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : Writable & Writable<{ maxMsToWaitBeforePublishing: 0; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >soFar : SO_FAR ->{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: number; } ->maxMsToWaitBeforePublishing : number +>{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: 0; } +>maxMsToWaitBeforePublishing : 0 >0 : 0 >maxMsToWaitBeforePublishing : 0 } @@ -441,9 +441,9 @@ export enum PubSubRecordIsStoredInRedisAsA { >soFar : SO_FAR >Object.assign( {}, buildNameFieldConstructor(soFar), buildIdentifierFieldConstructor(soFar), buildRecordFieldConstructor(soFar), buildStoredAsConstructor(soFar), buildMaxMsToWaitBeforePublishingFieldConstructor(soFar), buildType(soFar) ) as BuildPubSubRecordType : BuildPubSubRecordType >Object.assign( {}, buildNameFieldConstructor(soFar), buildIdentifierFieldConstructor(soFar), buildRecordFieldConstructor(soFar), buildStoredAsConstructor(soFar), buildMaxMsToWaitBeforePublishingFieldConstructor(soFar), buildType(soFar) ) : any ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } {}, >{} : {} diff --git a/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.symbols b/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.symbols index 659edb5ddca3c..981f13e3820d6 100644 --- a/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.symbols +++ b/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.symbols @@ -113,9 +113,9 @@ export const C = styled.div``; >div : Symbol(StyledInterface.div, Decl(index.d.ts, 12, 34)) export default Object.assign(A, { ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >A : Symbol(A, Decl(index.ts, 2, 5)) B, diff --git a/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.types b/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.types index 9d05d21a2fdd6..acc7ad58c4137 100644 --- a/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.types +++ b/tests/baselines/reference/declarationEmitObjectAssignedDefaultExport.types @@ -77,10 +77,10 @@ export const C = styled.div``; >`` : "" export default Object.assign(A, { ->Object.assign(A, { B, C}) : string & import("tests/cases/compiler/node_modules/styled-components/index").StyledComponentBase<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never> & import("tests/cases/compiler/node_modules/styled-components/node_modules/hoist-non-react-statics/index").NonReactStatics<"div"> & { B: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; C: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign(A, { B, C}) : string & import("tests/cases/compiler/node_modules/styled-components/index").StyledComponentBase<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never> & import("tests/cases/compiler/node_modules/styled-components/node_modules/hoist-non-react-statics/index").NonReactStatics<"div"> & Writable<{ B: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; C: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >A : import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never> >{ B, C} : { B: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; C: import("tests/cases/compiler/node_modules/styled-components/index").StyledComponent<"div", import("tests/cases/compiler/node_modules/styled-components/index").DefaultTheme, {}, never>; } diff --git a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.js b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.js index 837fe49b428d3..a387ceede2b8a 100644 --- a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.js +++ b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.js @@ -94,43 +94,43 @@ void p3.result.three; //// [declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.d.ts] export type Key = keyof U; export type Value, U> = U[K]; -export declare const updateIfChanged: (t: T) => ((key: K) => (>(key: K_1) => (>>(key: K_2) => (>>>(key: K_3) => (>>>>(key: K_4) => (>>>>>(key: K_5) => (>>>>>>(key: K_6) => (>>>>>>>(key: K_7) => (>>>>>>>>(key: K_8) => (>>>>>>>>>(key: K_9) => (>>>>>>>>>>(key: K_10) => any & { +export declare const updateIfChanged: (t: T) => ((key: K) => (>(key: K_1) => (>>(key: K_2) => (>>>(key: K_3) => (>>>>(key: K_4) => (>>>>>(key: K_5) => (>>>>>>(key: K_6) => (>>>>>>>(key: K_7) => (>>>>>>>>(key: K_8) => (>>>>>>>>>(key: K_9) => (>>>>>>>>>>(key: K_10) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; -}) & { +}>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; -}) & { +}>) & Writable<{ map: (updater: (u: T) => T) => T; set: (newU: T) => T; -}; +}>; export declare const testRecFun: (parent: T) => { result: T; deeper: (child: U) => { diff --git a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.symbols b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.symbols index 08c4eccca0829..bfbdd6084157c 100644 --- a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.symbols +++ b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.symbols @@ -47,9 +47,9 @@ export const updateIfChanged = (t: T) => { >newU : Symbol(newU, Decl(declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.ts, 8, 21)) return Object.assign( ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >(key: K) => >K : Symbol(K, Decl(declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.ts, 10, 13)) @@ -76,9 +76,9 @@ export const updateIfChanged = (t: T) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); >update : Symbol(update, Decl(declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.ts, 7, 28)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types index 4e4bf5b76933a..74e385e5aa3a3 100644 --- a/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types +++ b/tests/baselines/reference/declarationsWithRecursiveInternalTypesProduceUniqueTypeParams.types @@ -10,13 +10,13 @@ export type Value, U> = U[K]; >Value : Value export const updateIfChanged = (t: T) => { ->updateIfChanged : (t: T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: T) => T) => T; set: (newU: T) => T; } ->(t: T) => { const reduce = (u: U, update: (u: U) => T) => { const set = (newU: U) => Object.is(u, newU) ? t : update(newU); return Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }); }; return reduce(t, (t: T) => t);} : (t: T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: T) => T) => T; set: (newU: T) => T; } +>updateIfChanged : (t: T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: T) => T) => T; set: (newU: T) => T; }> +>(t: T) => { const reduce = (u: U, update: (u: U) => T) => { const set = (newU: U) => Object.is(u, newU) ? t : update(newU); return Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }); }; return reduce(t, (t: T) => t);} : (t: T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: T) => T) => T; set: (newU: T) => T; }> >t : T const reduce = (u: U, update: (u: U) => T) => { ->reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } ->(u: U, update: (u: U) => T) => { const set = (newU: U) => Object.is(u, newU) ? t : update(newU); return Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }); } : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } +>reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> +>(u: U, update: (u: U) => T) => { const set = (newU: U) => Object.is(u, newU) ? t : update(newU); return Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }); } : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> >u : U >update : (u: U) => T >u : U @@ -38,18 +38,18 @@ export const updateIfChanged = (t: T) => { >newU : U return Object.assign( ->Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }) : ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign( >(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }) : ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >(key: K) => ->>(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : (key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; } +>>(key: K) => reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : (key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }> >key : K reduce>(u[key as keyof U] as Value, (v: Value) => { ->reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => (>>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>>) => Value>>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; } ->reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } +>reduce>(u[key as keyof U] as Value, (v: Value) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => (>>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>>) => Value>>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }> +>reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> >u[key as keyof U] as Value : Value >u[key as keyof U] : U[keyof U] >u : U @@ -61,15 +61,15 @@ export const updateIfChanged = (t: T) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); >update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })) : T >update : (u: U) => T ->Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v }) : U & { [x: string]: Value; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v }) : Writable & Writable<{ [x: string]: Value; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Array.isArray(u) ? [] : {} : undefined[] | {} >Array.isArray(u) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >u : U >[] : undefined[] >{} : {} @@ -95,8 +95,8 @@ export const updateIfChanged = (t: T) => { }; return reduce(t, (t: T) => t); ->reduce(t, (t: T) => t) : ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: T) => T) => T; set: (newU: T) => T; } ->reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }) & { map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }) & { map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }) & { map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }) & { map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }) & { map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }) & { map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; } +>reduce(t, (t: T) => t) : ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: T) => T) => T; set: (newU: T) => T; }> +>reduce : (u: U, update: (u: U) => T) => ((key: K) => (>(key: K) => (>>(key: K) => (>>>(key: K) => (>>>>(key: K) => (>>>>>(key: K) => (>>>>>>(key: K) => (>>>>>>>(key: K) => (>>>>>>>>(key: K) => (>>>>>>>>>(key: K) => (>>>>>>>>>>(key: K) => any & Writable<{ map: (updater: (u: Value>>>>>>>>>>) => Value>>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>>) => Value>>>>>>>>>) => T; set: (newU: Value>>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>>) => Value>>>>>>>>) => T; set: (newU: Value>>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>>) => Value>>>>>>>) => T; set: (newU: Value>>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>>) => Value>>>>>>) => T; set: (newU: Value>>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>>) => Value>>>>>) => T; set: (newU: Value>>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>>) => Value>>>>) => T; set: (newU: Value>>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>>) => Value>>>) => T; set: (newU: Value>>>) => T; }>) & Writable<{ map: (updater: (u: Value>>) => Value>>) => T; set: (newU: Value>>) => T; }>) & Writable<{ map: (updater: (u: Value>) => Value>) => T; set: (newU: Value>) => T; }>) & Writable<{ map: (updater: (u: Value) => Value) => T; set: (newU: Value) => T; }>) & Writable<{ map: (updater: (u: U) => U) => T; set: (newU: U) => T; }> >t : T >(t: T) => t : (t: T) => T >t : T diff --git a/tests/baselines/reference/destructuringTuple.errors.txt b/tests/baselines/reference/destructuringTuple.errors.txt index 4587540dc28ea..1652fe820dd43 100644 --- a/tests/baselines/reference/destructuringTuple.errors.txt +++ b/tests/baselines/reference/destructuringTuple.errors.txt @@ -1,8 +1,8 @@ tests/cases/compiler/destructuringTuple.ts(11,7): error TS2461: Type 'number' is not an array type. tests/cases/compiler/destructuringTuple.ts(11,48): error TS2769: No overload matches this call. - Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error. + Overload 1 of 2, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number', gave the following error. Type 'never[]' is not assignable to type 'number'. - Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. + Overload 2 of 2, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. Type 'never[]' is not assignable to type '[]'. Target allows only 0 element(s) but source may have more. tests/cases/compiler/destructuringTuple.ts(11,60): error TS2769: No overload matches this call. @@ -28,9 +28,9 @@ tests/cases/compiler/destructuringTuple.ts(11,60): error TS2769: No overload mat !!! error TS2461: Type 'number' is not an array type. ~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error. +!!! error TS2769: Overload 1 of 2, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number', gave the following error. !!! error TS2769: Type 'never[]' is not assignable to type 'number'. -!!! error TS2769: Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. +!!! error TS2769: Overload 2 of 2, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. !!! error TS2769: Type 'never[]' is not assignable to type '[]'. !!! error TS2769: Target allows only 0 element(s) but source may have more. !!! related TS6502 /.ts/lib.es5.d.ts:--:--: The expected type comes from the return type of this signature. diff --git a/tests/baselines/reference/destructuringTuple.symbols b/tests/baselines/reference/destructuringTuple.symbols index 82e006ca8c194..6c6632a2f1ca1 100644 --- a/tests/baselines/reference/destructuringTuple.symbols +++ b/tests/baselines/reference/destructuringTuple.symbols @@ -21,8 +21,8 @@ declare var receiver: typeof tuple; const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); >oops1 : Symbol(oops1, Decl(destructuringTuple.ts, 10, 7)) ->[1, 2, 3].reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>[1, 2, 3].reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >accu : Symbol(accu, Decl(destructuringTuple.ts, 10, 34)) >el : Symbol(el, Decl(destructuringTuple.ts, 10, 39)) >accu.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) @@ -32,8 +32,8 @@ const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); >oops2 : Symbol(oops2, Decl(destructuringTuple.ts, 12, 7)) ->[1, 2, 3].reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>[1, 2, 3].reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >acc : Symbol(acc, Decl(destructuringTuple.ts, 12, 34)) >e : Symbol(e, Decl(destructuringTuple.ts, 12, 48)) >acc.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) diff --git a/tests/baselines/reference/destructuringTuple.types b/tests/baselines/reference/destructuringTuple.types index 0227d82572ddc..97ab455fcd4d9 100644 --- a/tests/baselines/reference/destructuringTuple.types +++ b/tests/baselines/reference/destructuringTuple.types @@ -25,12 +25,12 @@ declare var receiver: typeof tuple; const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); >oops1 : any >[1, 2, 3].reduce((accu, el) => accu.concat(el), []) : number ->[1, 2, 3].reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>[1, 2, 3].reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >[1, 2, 3] : number[] >1 : 1 >2 : 2 >3 : 3 ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(accu, el) => accu.concat(el) : (accu: [], el: number) => never[] >accu : [] >el : number @@ -44,12 +44,12 @@ const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []); const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []); >oops2 : number >[1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []) : number[] ->[1, 2, 3].reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>[1, 2, 3].reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >[1, 2, 3] : number[] >1 : 1 >2 : 2 >3 : 3 ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(acc: number[], e) => acc.concat(e) : (acc: number[], e: number) => number[] >acc : number[] >e : number diff --git a/tests/baselines/reference/duplicateNumericIndexers.errors.txt b/tests/baselines/reference/duplicateNumericIndexers.errors.txt index 826a48d1c815b..e4a26f4ccb3be 100644 --- a/tests/baselines/reference/duplicateNumericIndexers.errors.txt +++ b/tests/baselines/reference/duplicateNumericIndexers.errors.txt @@ -10,8 +10,8 @@ tests/cases/conformance/types/members/duplicateNumericIndexers.ts(24,5): error T tests/cases/conformance/types/members/duplicateNumericIndexers.ts(25,5): error TS2374: Duplicate index signature for type 'number'. tests/cases/conformance/types/members/duplicateNumericIndexers.ts(29,5): error TS2374: Duplicate index signature for type 'number'. tests/cases/conformance/types/members/duplicateNumericIndexers.ts(30,5): error TS2374: Duplicate index signature for type 'number'. -lib.es5.d.ts(520,5): error TS2374: Duplicate index signature for type 'number'. -lib.es5.d.ts(1484,5): error TS2374: Duplicate index signature for type 'number'. +lib.es5.d.ts(560,5): error TS2374: Duplicate index signature for type 'number'. +lib.es5.d.ts(1533,5): error TS2374: Duplicate index signature for type 'number'. ==== tests/cases/conformance/types/members/duplicateNumericIndexers.ts (12 errors) ==== diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols index db63f98e5ae99..b22564f9455b6 100644 --- a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols @@ -4,7 +4,7 @@ interface Array { >T : Symbol(T, Decl(lib.es5.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.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)) >T : Symbol(T, Decl(lib.es5.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) @@ -21,7 +21,7 @@ interface Array { >T : Symbol(T, Decl(lib.es5.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.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)) >previousValue : Symbol(previousValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 27)) @@ -44,9 +44,9 @@ var a: Array; var r5 = a.reduce((x, y) => x + y); >r5 : Symbol(r5, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 3)) ->a.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>a.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) >a : Symbol(a, Decl(duplicateOverloadInTypeAugmentation1.ts, 6, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) >x : Symbol(x, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 19)) >y : Symbol(y, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 21)) >x : Symbol(x, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 19)) diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types index ab043d9b24cd6..d54d6f9d69910 100644 --- a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types @@ -1,7 +1,7 @@ === tests/cases/compiler/duplicateOverloadInTypeAugmentation1.ts === interface Array { reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, ->reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; (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: 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 >previousValue : T >currentValue : T @@ -12,7 +12,7 @@ interface Array { >initialValue : T reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, ->reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; (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: 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: U, currentValue: T, currentIndex: number, array: T[]) => U >previousValue : U >currentValue : T @@ -28,9 +28,9 @@ var a: Array; var r5 = a.reduce((x, y) => x + y); >r5 : string >a.reduce((x, y) => x + y) : string ->a.reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>a.reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >a : string[] ->reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >(x, y) => x + y : (x: string, y: string) => string >x : string >y : string diff --git a/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types b/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types index c566d1897b08d..cf4beacdfc810 100644 --- a/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types +++ b/tests/baselines/reference/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types @@ -14,9 +14,9 @@ module.exports = 12; Object.defineProperty(module, "exports", { value: "oh no" }); >Object.defineProperty(module, "exports", { value: "oh no" }) : typeof module ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module : typeof module >"exports" : "exports" >{ value: "oh no" } : { value: string; } @@ -59,9 +59,9 @@ B.NS = require("./namespacey"); Object.defineProperty(B, "NS", { value: "why though", writable: true }); >Object.defineProperty(B, "NS", { value: "why though", writable: true }) : typeof B ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >B : typeof B >"NS" : "NS" >{ value: "why though", writable: true } : { value: string; writable: true; } diff --git a/tests/baselines/reference/es2018ObjectAssign.symbols b/tests/baselines/reference/es2018ObjectAssign.symbols index 3ed140cb570d3..3f27f2158d345 100644 --- a/tests/baselines/reference/es2018ObjectAssign.symbols +++ b/tests/baselines/reference/es2018ObjectAssign.symbols @@ -1,9 +1,9 @@ === tests/cases/compiler/es2018ObjectAssign.ts === const test = Object.assign({}, { test: true }); >test : Symbol(test, Decl(es2018ObjectAssign.ts, 0, 5)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >test : Symbol(test, Decl(es2018ObjectAssign.ts, 0, 32)) declare const p: Promise; diff --git a/tests/baselines/reference/es2018ObjectAssign.types b/tests/baselines/reference/es2018ObjectAssign.types index e8cc1927c5caf..7e85abc8fe285 100644 --- a/tests/baselines/reference/es2018ObjectAssign.types +++ b/tests/baselines/reference/es2018ObjectAssign.types @@ -1,10 +1,10 @@ === tests/cases/compiler/es2018ObjectAssign.ts === const test = Object.assign({}, { test: true }); ->test : { test: boolean; } ->Object.assign({}, { test: true }) : { test: boolean; } ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>test : Writable<{ test: boolean; }> +>Object.assign({}, { test: true }) : Writable<{ test: boolean; }> +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >{ test: true } : { test: true; } >test : true diff --git a/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.types b/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.types index 79e54575127f7..8845f1a09b15a 100644 --- a/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.types +++ b/tests/baselines/reference/esNextWeakRefs_IterableWeakMap.types @@ -307,9 +307,9 @@ export class IterableWeakMap implements WeakMap { Object.defineProperties(IterableWeakMap.prototype, { >Object.defineProperties(IterableWeakMap.prototype, { [Symbol.iterator]: { configurable: true, enumerable: false, writable: true, value: Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", )!.value, }, [Symbol.toStringTag]: { configurable: true, enumerable: false, writable: false, value: "IterableWeakMap", },}) : IterableWeakMap ->Object.defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>Object.defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T >Object : ObjectConstructor ->defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T >IterableWeakMap.prototype : IterableWeakMap >IterableWeakMap : typeof IterableWeakMap >prototype : IterableWeakMap @@ -339,9 +339,9 @@ Object.defineProperties(IterableWeakMap.prototype, { >Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", )!.value : any >Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", )! : PropertyDescriptor >Object.getOwnPropertyDescriptor( IterableWeakMap.prototype, "entries", ) : PropertyDescriptor | undefined ->Object.getOwnPropertyDescriptor : (o: any, p: PropertyKey) => PropertyDescriptor | undefined +>Object.getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined >Object : ObjectConstructor ->getOwnPropertyDescriptor : (o: any, p: PropertyKey) => PropertyDescriptor | undefined +>getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined IterableWeakMap.prototype, >IterableWeakMap.prototype : IterableWeakMap diff --git a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types index 3c748f7fd923b..6e19f04737b72 100644 --- a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types +++ b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types @@ -4,9 +4,9 @@ // Excess property error expected here Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }); >Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }) : Window & typeof globalThis ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >window : Window & typeof globalThis >"prop" : "prop" >{ value: "v1.0.0", readonly: false } : { value: string; readonly: boolean; } diff --git a/tests/baselines/reference/fixSignatureCaching.types b/tests/baselines/reference/fixSignatureCaching.types index 0a0d657a64d10..4774dbf8379eb 100644 --- a/tests/baselines/reference/fixSignatureCaching.types +++ b/tests/baselines/reference/fixSignatureCaching.types @@ -1109,9 +1109,9 @@ define(function () { >Array : ArrayConstructor Array.isArray : function (value) { return Object.prototype.toString.call(value) === '[object Array]'; }; ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >function (value) { return Object.prototype.toString.call(value) === '[object Array]'; } : (value: any) => boolean >value : any >Object.prototype.toString.call(value) === '[object Array]' : boolean diff --git a/tests/baselines/reference/flatArrayNoExcessiveStackDepth.types b/tests/baselines/reference/flatArrayNoExcessiveStackDepth.types index ddf44fe2ef378..1956fa05cb3f7 100644 --- a/tests/baselines/reference/flatArrayNoExcessiveStackDepth.types +++ b/tests/baselines/reference/flatArrayNoExcessiveStackDepth.types @@ -7,10 +7,10 @@ declare const foo: unknown[]; const bar = foo.flatMap(bar => bar as Foo); >bar : string[] >foo.flatMap(bar => bar as Foo) : string[] ->foo.flatMap : (callback: (this: This, value: unknown, index: number, array: unknown[]) => U | readonly U[], thisArg?: This | undefined) => U[] +>foo.flatMap : (callback: (value: unknown, index: number, array: unknown[]) => U | readonly U[], thisArg?: any) => U[] >foo : unknown[] ->flatMap : (callback: (this: This, value: unknown, index: number, array: unknown[]) => U | readonly U[], thisArg?: This | undefined) => U[] ->bar => bar as Foo : (this: undefined, bar: unknown) => Foo +>flatMap : (callback: (value: unknown, index: number, array: unknown[]) => U | readonly U[], thisArg?: any) => U[] +>bar => bar as Foo : (bar: unknown) => Foo >bar : unknown >bar as Foo : Foo >bar : unknown diff --git a/tests/baselines/reference/formatToPartsFractionalSecond.types b/tests/baselines/reference/formatToPartsFractionalSecond.types index c50d9994aed81..11ff9f0af7f88 100644 --- a/tests/baselines/reference/formatToPartsFractionalSecond.types +++ b/tests/baselines/reference/formatToPartsFractionalSecond.types @@ -1,7 +1,7 @@ === tests/cases/compiler/formatToPartsFractionalSecond.ts === new Intl.DateTimeFormat().formatToParts().find((val) => val.type === 'fractionalSecond') >new Intl.DateTimeFormat().formatToParts().find((val) => val.type === 'fractionalSecond') : Intl.DateTimeFormatPart ->new Intl.DateTimeFormat().formatToParts().find : { (predicate: (value: Intl.DateTimeFormatPart, index: number, obj: Intl.DateTimeFormatPart[]) => value is S, thisArg?: any): S; (predicate: (value: Intl.DateTimeFormatPart, index: number, obj: Intl.DateTimeFormatPart[]) => unknown, thisArg?: any): Intl.DateTimeFormatPart; } +>new Intl.DateTimeFormat().formatToParts().find : { (predicate: (value: Intl.DateTimeFormatPart, index: number, array: Intl.DateTimeFormatPart[]) => value is S, thisArg?: any): S; (predicate: (value: Intl.DateTimeFormatPart, index: number, array: Intl.DateTimeFormatPart[]) => unknown, thisArg?: any): Intl.DateTimeFormatPart; } >new Intl.DateTimeFormat().formatToParts() : Intl.DateTimeFormatPart[] >new Intl.DateTimeFormat().formatToParts : (date?: number | Date) => Intl.DateTimeFormatPart[] >new Intl.DateTimeFormat() : Intl.DateTimeFormat @@ -9,7 +9,7 @@ new Intl.DateTimeFormat().formatToParts().find((val) => val.type === 'fractional >Intl : typeof Intl >DateTimeFormat : { (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; new (locales?: string | string[], options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat; supportedLocalesOf(locales: string | string[], options?: Intl.DateTimeFormatOptions): string[]; readonly prototype: Intl.DateTimeFormat; } >formatToParts : (date?: number | Date) => Intl.DateTimeFormatPart[] ->find : { (predicate: (value: Intl.DateTimeFormatPart, index: number, obj: Intl.DateTimeFormatPart[]) => value is S, thisArg?: any): S; (predicate: (value: Intl.DateTimeFormatPart, index: number, obj: Intl.DateTimeFormatPart[]) => unknown, thisArg?: any): Intl.DateTimeFormatPart; } +>find : { (predicate: (value: Intl.DateTimeFormatPart, index: number, array: Intl.DateTimeFormatPart[]) => value is S, thisArg?: any): S; (predicate: (value: Intl.DateTimeFormatPart, index: number, array: Intl.DateTimeFormatPart[]) => unknown, thisArg?: any): Intl.DateTimeFormatPart; } >(val) => val.type === 'fractionalSecond' : (val: Intl.DateTimeFormatPart) => boolean >val : Intl.DateTimeFormatPart >val.type === 'fractionalSecond' : boolean diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.symbols b/tests/baselines/reference/genericContextualTypingSpecialization.symbols index 28609346111d9..b8bb442609042 100644 --- a/tests/baselines/reference/genericContextualTypingSpecialization.symbols +++ b/tests/baselines/reference/genericContextualTypingSpecialization.symbols @@ -3,9 +3,9 @@ var b: number[]; >b : Symbol(b, Decl(genericContextualTypingSpecialization.ts, 0, 3)) b.reduce((c, d) => c + d, 0); // should not error on '+' ->b.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>b.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >b : Symbol(b, Decl(genericContextualTypingSpecialization.ts, 0, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(genericContextualTypingSpecialization.ts, 1, 18)) >d : Symbol(d, Decl(genericContextualTypingSpecialization.ts, 1, 20)) >c : Symbol(c, Decl(genericContextualTypingSpecialization.ts, 1, 18)) diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.types b/tests/baselines/reference/genericContextualTypingSpecialization.types index d7d6101050799..8225502034731 100644 --- a/tests/baselines/reference/genericContextualTypingSpecialization.types +++ b/tests/baselines/reference/genericContextualTypingSpecialization.types @@ -4,9 +4,9 @@ var b: number[]; b.reduce((c, d) => c + d, 0); // should not error on '+' >b.reduce((c, d) => c + d, 0) : number ->b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >b : number[] ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(c, d) => c + d : (c: number, d: number) => number >c : number >d : number diff --git a/tests/baselines/reference/genericReduce.symbols b/tests/baselines/reference/genericReduce.symbols index 1ace07b9adf9a..16c9382a6e81f 100644 --- a/tests/baselines/reference/genericReduce.symbols +++ b/tests/baselines/reference/genericReduce.symbols @@ -14,9 +14,9 @@ var b = a.map(s => s.length); var n1 = b.reduce((x, y) => x + y); >n1 : Symbol(n1, Decl(genericReduce.ts, 2, 3)) ->b.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>b.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >b : Symbol(b, Decl(genericReduce.ts, 1, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(genericReduce.ts, 2, 19)) >y : Symbol(y, Decl(genericReduce.ts, 2, 21)) >x : Symbol(x, Decl(genericReduce.ts, 2, 19)) @@ -24,9 +24,9 @@ var n1 = b.reduce((x, y) => x + y); var n2 = b.reduceRight((x, y) => x + y); >n2 : Symbol(n2, Decl(genericReduce.ts, 3, 3)) ->b.reduceRight : Symbol(Array.reduceRight, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>b.reduceRight : Symbol(Array.reduceRight, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >b : Symbol(b, Decl(genericReduce.ts, 1, 3)) ->reduceRight : Symbol(Array.reduceRight, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduceRight : Symbol(Array.reduceRight, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(genericReduce.ts, 3, 24)) >y : Symbol(y, Decl(genericReduce.ts, 3, 26)) >x : Symbol(x, Decl(genericReduce.ts, 3, 24)) @@ -50,9 +50,9 @@ n2.toExponential(2); // should not error if 'n2' is correctly number. var n3 = b.reduce( (x, y) => x + y, ""); // Initial value is of type string >n3 : Symbol(n3, Decl(genericReduce.ts, 10, 3)) ->b.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>b.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >b : Symbol(b, Decl(genericReduce.ts, 1, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(genericReduce.ts, 10, 28)) >y : Symbol(y, Decl(genericReduce.ts, 10, 30)) >x : Symbol(x, Decl(genericReduce.ts, 10, 28)) diff --git a/tests/baselines/reference/genericReduce.types b/tests/baselines/reference/genericReduce.types index 65a069426a7d5..628398f86fdbf 100644 --- a/tests/baselines/reference/genericReduce.types +++ b/tests/baselines/reference/genericReduce.types @@ -22,9 +22,9 @@ var b = a.map(s => s.length); var n1 = b.reduce((x, y) => x + y); >n1 : number >b.reduce((x, y) => x + y) : number ->b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >b : number[] ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(x, y) => x + y : (x: number, y: number) => number >x : number >y : number @@ -35,9 +35,9 @@ var n1 = b.reduce((x, y) => x + y); var n2 = b.reduceRight((x, y) => x + y); >n2 : number >b.reduceRight((x, y) => x + y) : number ->b.reduceRight : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>b.reduceRight : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >b : number[] ->reduceRight : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduceRight : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(x, y) => x + y : (x: number, y: number) => number >x : number >y : number @@ -76,9 +76,9 @@ n2.toExponential(2); // should not error if 'n2' is correctly number. var n3 = b.reduce( (x, y) => x + y, ""); // Initial value is of type string >n3 : string >b.reduce( (x, y) => x + y, "") : string ->b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >b : number[] ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(x, y) => x + y : (x: string, y: number) => string >x : string >y : number diff --git a/tests/baselines/reference/getterSetterNonAccessor.types b/tests/baselines/reference/getterSetterNonAccessor.types index 5f9a658b575f0..b81b5a6dcad1d 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.types +++ b/tests/baselines/reference/getterSetterNonAccessor.types @@ -9,9 +9,9 @@ function setFunc(v){} Object.defineProperty({}, "0", ({ >Object.defineProperty({}, "0", ({ get: getFunc, set: setFunc, configurable: true })) : {} ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >{} : {} >"0" : "0" >({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor diff --git a/tests/baselines/reference/implementArrayInterface.js b/tests/baselines/reference/implementArrayInterface.js index 733a861071bae..5463693971453 100644 --- a/tests/baselines/reference/implementArrayInterface.js +++ b/tests/baselines/reference/implementArrayInterface.js @@ -2,6 +2,7 @@ declare class MyArray implements Array { toString(): string; toLocaleString(): string; + valueOf(): T[]; concat(...items: U[]): T[]; concat(...items: T[]): T[]; join(separator?: string): string; @@ -10,7 +11,7 @@ declare class MyArray implements Array { reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; - sort(compareFn?: (a: T, b: T) => number): this; + sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; @@ -27,6 +28,20 @@ declare class MyArray implements Array { 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; + find(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T | undefined; + findIndex(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): number; + fill(value: T, start?: number, end?: number): T[]; + copyWithin(target: number, start: number, end?: number): T[]; + [Symbol.iterator](): IterableIterator; + entries(): IterableIterator<[number, T]>; + keys(): IterableIterator; + values(): IterableIterator; + [Symbol.unscopables]: any; + includes(searchElement: T, fromIndex?: number): boolean; + flatMap(callback: (value: T, index: number, array: T[]) => U | U[], thisArg?: any): U[] + flat(this: A, depth?: D): FlatArray[] + at(index: number): T | undefined; + length: number; [n: number]: T; diff --git a/tests/baselines/reference/implementArrayInterface.symbols b/tests/baselines/reference/implementArrayInterface.symbols index 4df065b57732a..706682dfaddc2 100644 --- a/tests/baselines/reference/implementArrayInterface.symbols +++ b/tests/baselines/reference/implementArrayInterface.symbols @@ -2,7 +2,7 @@ declare class MyArray implements Array { >MyArray : Symbol(MyArray, Decl(implementArrayInterface.ts, 0, 0)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 3 more) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) toString(): string; @@ -11,206 +11,312 @@ declare class MyArray implements Array { toLocaleString(): string; >toLocaleString : Symbol(MyArray.toLocaleString, Decl(implementArrayInterface.ts, 1, 23)) + valueOf(): T[]; +>valueOf : Symbol(MyArray.valueOf, Decl(implementArrayInterface.ts, 2, 29)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + concat(...items: U[]): T[]; ->concat : Symbol(MyArray.concat, Decl(implementArrayInterface.ts, 2, 29), Decl(implementArrayInterface.ts, 3, 46)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 3, 11)) +>concat : Symbol(MyArray.concat, Decl(implementArrayInterface.ts, 3, 19), Decl(implementArrayInterface.ts, 4, 46)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 4, 11)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->items : Symbol(items, Decl(implementArrayInterface.ts, 3, 26)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 3, 11)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 4, 26)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 4, 11)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) concat(...items: T[]): T[]; ->concat : Symbol(MyArray.concat, Decl(implementArrayInterface.ts, 2, 29), Decl(implementArrayInterface.ts, 3, 46)) ->items : Symbol(items, Decl(implementArrayInterface.ts, 4, 11)) +>concat : Symbol(MyArray.concat, Decl(implementArrayInterface.ts, 3, 19), Decl(implementArrayInterface.ts, 4, 46)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 5, 11)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) join(separator?: string): string; ->join : Symbol(MyArray.join, Decl(implementArrayInterface.ts, 4, 31)) ->separator : Symbol(separator, Decl(implementArrayInterface.ts, 5, 9)) +>join : Symbol(MyArray.join, Decl(implementArrayInterface.ts, 5, 31)) +>separator : Symbol(separator, Decl(implementArrayInterface.ts, 6, 9)) pop(): T; ->pop : Symbol(MyArray.pop, Decl(implementArrayInterface.ts, 5, 37)) +>pop : Symbol(MyArray.pop, Decl(implementArrayInterface.ts, 6, 37)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) push(...items: T[]): number; ->push : Symbol(MyArray.push, Decl(implementArrayInterface.ts, 6, 13)) ->items : Symbol(items, Decl(implementArrayInterface.ts, 7, 9)) +>push : Symbol(MyArray.push, Decl(implementArrayInterface.ts, 7, 13)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 8, 9)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) reverse(): T[]; ->reverse : Symbol(MyArray.reverse, Decl(implementArrayInterface.ts, 7, 32)) +>reverse : Symbol(MyArray.reverse, Decl(implementArrayInterface.ts, 8, 32)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) shift(): T; ->shift : Symbol(MyArray.shift, Decl(implementArrayInterface.ts, 8, 19)) +>shift : Symbol(MyArray.shift, Decl(implementArrayInterface.ts, 9, 19)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) slice(start?: number, end?: number): T[]; ->slice : Symbol(MyArray.slice, Decl(implementArrayInterface.ts, 9, 15)) ->start : Symbol(start, Decl(implementArrayInterface.ts, 10, 10)) ->end : Symbol(end, Decl(implementArrayInterface.ts, 10, 25)) +>slice : Symbol(MyArray.slice, Decl(implementArrayInterface.ts, 10, 15)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 11, 10)) +>end : Symbol(end, Decl(implementArrayInterface.ts, 11, 25)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) - sort(compareFn?: (a: T, b: T) => number): this; ->sort : Symbol(MyArray.sort, Decl(implementArrayInterface.ts, 10, 45)) ->compareFn : Symbol(compareFn, Decl(implementArrayInterface.ts, 11, 9)) ->a : Symbol(a, Decl(implementArrayInterface.ts, 11, 22)) + sort(compareFn?: (a: T, b: T) => number): T[]; +>sort : Symbol(MyArray.sort, Decl(implementArrayInterface.ts, 11, 45)) +>compareFn : Symbol(compareFn, Decl(implementArrayInterface.ts, 12, 9)) +>a : Symbol(a, Decl(implementArrayInterface.ts, 12, 22)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>b : Symbol(b, Decl(implementArrayInterface.ts, 12, 27)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->b : Symbol(b, Decl(implementArrayInterface.ts, 11, 27)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) splice(start: number): T[]; ->splice : Symbol(MyArray.splice, Decl(implementArrayInterface.ts, 11, 51), Decl(implementArrayInterface.ts, 12, 31)) ->start : Symbol(start, Decl(implementArrayInterface.ts, 12, 11)) +>splice : Symbol(MyArray.splice, Decl(implementArrayInterface.ts, 12, 50), Decl(implementArrayInterface.ts, 13, 31)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 13, 11)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) splice(start: number, deleteCount: number, ...items: T[]): T[]; ->splice : Symbol(MyArray.splice, Decl(implementArrayInterface.ts, 11, 51), Decl(implementArrayInterface.ts, 12, 31)) ->start : Symbol(start, Decl(implementArrayInterface.ts, 13, 11)) ->deleteCount : Symbol(deleteCount, Decl(implementArrayInterface.ts, 13, 25)) ->items : Symbol(items, Decl(implementArrayInterface.ts, 13, 46)) +>splice : Symbol(MyArray.splice, Decl(implementArrayInterface.ts, 12, 50), Decl(implementArrayInterface.ts, 13, 31)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 14, 11)) +>deleteCount : Symbol(deleteCount, Decl(implementArrayInterface.ts, 14, 25)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 14, 46)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) unshift(...items: T[]): number; ->unshift : Symbol(MyArray.unshift, Decl(implementArrayInterface.ts, 13, 67)) ->items : Symbol(items, Decl(implementArrayInterface.ts, 14, 12)) +>unshift : Symbol(MyArray.unshift, Decl(implementArrayInterface.ts, 14, 67)) +>items : Symbol(items, Decl(implementArrayInterface.ts, 15, 12)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) indexOf(searchElement: T, fromIndex?: number): number; ->indexOf : Symbol(MyArray.indexOf, Decl(implementArrayInterface.ts, 14, 35)) ->searchElement : Symbol(searchElement, Decl(implementArrayInterface.ts, 16, 12)) +>indexOf : Symbol(MyArray.indexOf, Decl(implementArrayInterface.ts, 15, 35)) +>searchElement : Symbol(searchElement, Decl(implementArrayInterface.ts, 17, 12)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->fromIndex : Symbol(fromIndex, Decl(implementArrayInterface.ts, 16, 29)) +>fromIndex : Symbol(fromIndex, Decl(implementArrayInterface.ts, 17, 29)) lastIndexOf(searchElement: T, fromIndex?: number): number; ->lastIndexOf : Symbol(MyArray.lastIndexOf, Decl(implementArrayInterface.ts, 16, 58)) ->searchElement : Symbol(searchElement, Decl(implementArrayInterface.ts, 17, 16)) +>lastIndexOf : Symbol(MyArray.lastIndexOf, Decl(implementArrayInterface.ts, 17, 58)) +>searchElement : Symbol(searchElement, Decl(implementArrayInterface.ts, 18, 16)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->fromIndex : Symbol(fromIndex, Decl(implementArrayInterface.ts, 17, 33)) +>fromIndex : Symbol(fromIndex, Decl(implementArrayInterface.ts, 18, 33)) every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; ->every : Symbol(MyArray.every, Decl(implementArrayInterface.ts, 17, 62)) ->callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 18, 10)) ->value : Symbol(value, Decl(implementArrayInterface.ts, 18, 23)) +>every : Symbol(MyArray.every, Decl(implementArrayInterface.ts, 18, 62)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 19, 10)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 19, 23)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->index : Symbol(index, Decl(implementArrayInterface.ts, 18, 32)) ->array : Symbol(array, Decl(implementArrayInterface.ts, 18, 47)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 19, 32)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 19, 47)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 18, 71)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 19, 71)) some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; ->some : Symbol(MyArray.some, Decl(implementArrayInterface.ts, 18, 96)) ->callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 19, 9)) ->value : Symbol(value, Decl(implementArrayInterface.ts, 19, 22)) +>some : Symbol(MyArray.some, Decl(implementArrayInterface.ts, 19, 96)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 20, 9)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 20, 22)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->index : Symbol(index, Decl(implementArrayInterface.ts, 19, 31)) ->array : Symbol(array, Decl(implementArrayInterface.ts, 19, 46)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 20, 31)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 20, 46)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 19, 70)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 20, 70)) forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; ->forEach : Symbol(MyArray.forEach, Decl(implementArrayInterface.ts, 19, 95)) ->callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 20, 12)) ->value : Symbol(value, Decl(implementArrayInterface.ts, 20, 25)) +>forEach : Symbol(MyArray.forEach, Decl(implementArrayInterface.ts, 20, 95)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 21, 12)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 21, 25)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->index : Symbol(index, Decl(implementArrayInterface.ts, 20, 34)) ->array : Symbol(array, Decl(implementArrayInterface.ts, 20, 49)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 21, 34)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 21, 49)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 20, 70)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 21, 70)) map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; ->map : Symbol(MyArray.map, Decl(implementArrayInterface.ts, 20, 92)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 21, 8)) ->callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 21, 11)) ->value : Symbol(value, Decl(implementArrayInterface.ts, 21, 24)) ->T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->index : Symbol(index, Decl(implementArrayInterface.ts, 21, 33)) ->array : Symbol(array, Decl(implementArrayInterface.ts, 21, 48)) ->T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 21, 8)) ->thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 21, 66)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 21, 8)) - - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; ->filter : Symbol(MyArray.filter, Decl(implementArrayInterface.ts, 21, 87)) +>map : Symbol(MyArray.map, Decl(implementArrayInterface.ts, 21, 92)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 22, 8)) >callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 22, 11)) >value : Symbol(value, Decl(implementArrayInterface.ts, 22, 24)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) >index : Symbol(index, Decl(implementArrayInterface.ts, 22, 33)) >array : Symbol(array, Decl(implementArrayInterface.ts, 22, 48)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 22, 72)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 22, 8)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 22, 66)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 22, 8)) + + filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; +>filter : Symbol(MyArray.filter, Decl(implementArrayInterface.ts, 22, 87)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 23, 11)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 23, 24)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 23, 33)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 23, 48)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 23, 72)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; ->reduce : Symbol(MyArray.reduce, Decl(implementArrayInterface.ts, 22, 93), Decl(implementArrayInterface.ts, 23, 120)) ->callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 23, 11)) ->previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 23, 24)) +>reduce : Symbol(MyArray.reduce, Decl(implementArrayInterface.ts, 23, 93), Decl(implementArrayInterface.ts, 24, 120)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 24, 11)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 24, 24)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 23, 41)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 24, 41)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 23, 58)) ->array : Symbol(array, Decl(implementArrayInterface.ts, 23, 80)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 24, 58)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 24, 80)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 23, 98)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 24, 98)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; ->reduce : Symbol(MyArray.reduce, Decl(implementArrayInterface.ts, 22, 93), Decl(implementArrayInterface.ts, 23, 120)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) ->callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 24, 14)) ->previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 24, 27)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) ->currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 24, 44)) ->T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 24, 61)) ->array : Symbol(array, Decl(implementArrayInterface.ts, 24, 83)) ->T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) ->initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 24, 101)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 24, 11)) +>reduce : Symbol(MyArray.reduce, Decl(implementArrayInterface.ts, 23, 93), Decl(implementArrayInterface.ts, 24, 120)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 25, 11)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 25, 14)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 25, 27)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 25, 11)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 25, 44)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 25, 61)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 25, 83)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 25, 11)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 25, 101)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 25, 11)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 25, 11)) reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; ->reduceRight : Symbol(MyArray.reduceRight, Decl(implementArrayInterface.ts, 24, 122), Decl(implementArrayInterface.ts, 25, 125)) ->callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 25, 16)) ->previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 25, 29)) +>reduceRight : Symbol(MyArray.reduceRight, Decl(implementArrayInterface.ts, 25, 122), Decl(implementArrayInterface.ts, 26, 125)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 26, 16)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 26, 29)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 25, 46)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 26, 46)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 25, 63)) ->array : Symbol(array, Decl(implementArrayInterface.ts, 25, 85)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 26, 63)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 26, 85)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 25, 103)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 26, 103)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; ->reduceRight : Symbol(MyArray.reduceRight, Decl(implementArrayInterface.ts, 24, 122), Decl(implementArrayInterface.ts, 25, 125)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) ->callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 26, 19)) ->previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 26, 32)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) ->currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 26, 49)) +>reduceRight : Symbol(MyArray.reduceRight, Decl(implementArrayInterface.ts, 25, 122), Decl(implementArrayInterface.ts, 26, 125)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 27, 16)) +>callbackfn : Symbol(callbackfn, Decl(implementArrayInterface.ts, 27, 19)) +>previousValue : Symbol(previousValue, Decl(implementArrayInterface.ts, 27, 32)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 27, 16)) +>currentValue : Symbol(currentValue, Decl(implementArrayInterface.ts, 27, 49)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 27, 66)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 27, 88)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 27, 16)) +>initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 27, 106)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 27, 16)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 27, 16)) + + find(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T | undefined; +>find : Symbol(MyArray.find, Decl(implementArrayInterface.ts, 27, 127)) +>predicate : Symbol(predicate, Decl(implementArrayInterface.ts, 29, 9)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 29, 21)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 29, 30)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 29, 45)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 29, 69)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->currentIndex : Symbol(currentIndex, Decl(implementArrayInterface.ts, 26, 66)) ->array : Symbol(array, Decl(implementArrayInterface.ts, 26, 88)) + + findIndex(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): number; +>findIndex : Symbol(MyArray.findIndex, Decl(implementArrayInterface.ts, 29, 100)) +>predicate : Symbol(predicate, Decl(implementArrayInterface.ts, 30, 14)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 30, 26)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 30, 35)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 30, 50)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 30, 74)) + + fill(value: T, start?: number, end?: number): T[]; +>fill : Symbol(MyArray.fill, Decl(implementArrayInterface.ts, 30, 98)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 31, 9)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 31, 18)) +>end : Symbol(end, Decl(implementArrayInterface.ts, 31, 34)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + copyWithin(target: number, start: number, end?: number): T[]; +>copyWithin : Symbol(MyArray.copyWithin, Decl(implementArrayInterface.ts, 31, 54)) +>target : Symbol(target, Decl(implementArrayInterface.ts, 32, 15)) +>start : Symbol(start, Decl(implementArrayInterface.ts, 32, 30)) +>end : Symbol(end, Decl(implementArrayInterface.ts, 32, 45)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + [Symbol.iterator](): IterableIterator; +>[Symbol.iterator] : Symbol(MyArray[Symbol.iterator], Decl(implementArrayInterface.ts, 32, 65)) +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + entries(): IterableIterator<[number, T]>; +>entries : Symbol(MyArray.entries, Decl(implementArrayInterface.ts, 33, 45)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + keys(): IterableIterator; +>keys : Symbol(MyArray.keys, Decl(implementArrayInterface.ts, 34, 45)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) + + values(): IterableIterator; +>values : Symbol(MyArray.values, Decl(implementArrayInterface.ts, 35, 37)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) + + [Symbol.unscopables]: any; +>[Symbol.unscopables] : Symbol(MyArray[Symbol.unscopables], Decl(implementArrayInterface.ts, 36, 34)) +>Symbol.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + + includes(searchElement: T, fromIndex?: number): boolean; +>includes : Symbol(MyArray.includes, Decl(implementArrayInterface.ts, 37, 30)) +>searchElement : Symbol(searchElement, Decl(implementArrayInterface.ts, 38, 13)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>fromIndex : Symbol(fromIndex, Decl(implementArrayInterface.ts, 38, 30)) + + flatMap(callback: (value: T, index: number, array: T[]) => U | U[], thisArg?: any): U[] +>flatMap : Symbol(MyArray.flatMap, Decl(implementArrayInterface.ts, 38, 60)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 39, 12)) +>callback : Symbol(callback, Decl(implementArrayInterface.ts, 39, 15)) +>value : Symbol(value, Decl(implementArrayInterface.ts, 39, 26)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 39, 35)) +>array : Symbol(array, Decl(implementArrayInterface.ts, 39, 50)) +>T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 39, 12)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 39, 12)) +>thisArg : Symbol(thisArg, Decl(implementArrayInterface.ts, 39, 74)) +>U : Symbol(U, Decl(implementArrayInterface.ts, 39, 12)) + + flat(this: A, depth?: D): FlatArray[] +>flat : Symbol(MyArray.flat, Decl(implementArrayInterface.ts, 39, 94)) +>A : Symbol(A, Decl(implementArrayInterface.ts, 40, 9)) +>D : Symbol(D, Decl(implementArrayInterface.ts, 40, 11)) +>this : Symbol(this, Decl(implementArrayInterface.ts, 40, 34)) +>A : Symbol(A, Decl(implementArrayInterface.ts, 40, 9)) +>depth : Symbol(depth, Decl(implementArrayInterface.ts, 40, 42)) +>D : Symbol(D, Decl(implementArrayInterface.ts, 40, 11)) +>FlatArray : Symbol(FlatArray, Decl(lib.es2019.array.d.ts, --, --)) +>A : Symbol(A, Decl(implementArrayInterface.ts, 40, 9)) +>D : Symbol(D, Decl(implementArrayInterface.ts, 40, 11)) + + at(index: number): T | undefined; +>at : Symbol(MyArray.at, Decl(implementArrayInterface.ts, 40, 72)) +>index : Symbol(index, Decl(implementArrayInterface.ts, 41, 7)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) ->initialValue : Symbol(initialValue, Decl(implementArrayInterface.ts, 26, 106)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) ->U : Symbol(U, Decl(implementArrayInterface.ts, 26, 16)) length: number; ->length : Symbol(MyArray.length, Decl(implementArrayInterface.ts, 26, 127)) +>length : Symbol(MyArray.length, Decl(implementArrayInterface.ts, 41, 37)) [n: number]: T; ->n : Symbol(n, Decl(implementArrayInterface.ts, 30, 5)) +>n : Symbol(n, Decl(implementArrayInterface.ts, 45, 5)) >T : Symbol(T, Decl(implementArrayInterface.ts, 0, 22)) } diff --git a/tests/baselines/reference/implementArrayInterface.types b/tests/baselines/reference/implementArrayInterface.types index 4d0a012a17f5e..821bf27f88e8d 100644 --- a/tests/baselines/reference/implementArrayInterface.types +++ b/tests/baselines/reference/implementArrayInterface.types @@ -8,6 +8,9 @@ declare class MyArray implements Array { toLocaleString(): string; >toLocaleString : () => string + valueOf(): T[]; +>valueOf : () => T[] + concat(...items: U[]): T[]; >concat : { (...items: U[]): T[]; (...items: T[]): T[]; } >items : U[] @@ -38,8 +41,8 @@ declare class MyArray implements Array { >start : number >end : number - sort(compareFn?: (a: T, b: T) => number): this; ->sort : (compareFn?: (a: T, b: T) => number) => this + sort(compareFn?: (a: T, b: T) => number): T[]; +>sort : (compareFn?: (a: T, b: T) => number) => T[] >compareFn : (a: T, b: T) => number >a : T >b : T @@ -144,6 +147,77 @@ declare class MyArray implements Array { >array : T[] >initialValue : U + find(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T | undefined; +>find : (predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => T | undefined +>predicate : (value: T, index: number, array: T[]) => boolean +>value : T +>index : number +>array : T[] +>thisArg : any + + findIndex(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): number; +>findIndex : (predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any) => number +>predicate : (value: T, index: number, array: T[]) => boolean +>value : T +>index : number +>array : T[] +>thisArg : any + + fill(value: T, start?: number, end?: number): T[]; +>fill : (value: T, start?: number, end?: number) => T[] +>value : T +>start : number +>end : number + + copyWithin(target: number, start: number, end?: number): T[]; +>copyWithin : (target: number, start: number, end?: number) => T[] +>target : number +>start : number +>end : number + + [Symbol.iterator](): IterableIterator; +>[Symbol.iterator] : () => IterableIterator +>Symbol.iterator : unique symbol +>Symbol : SymbolConstructor +>iterator : unique symbol + + entries(): IterableIterator<[number, T]>; +>entries : () => IterableIterator<[number, T]> + + keys(): IterableIterator; +>keys : () => IterableIterator + + values(): IterableIterator; +>values : () => IterableIterator + + [Symbol.unscopables]: any; +>[Symbol.unscopables] : any +>Symbol.unscopables : unique symbol +>Symbol : SymbolConstructor +>unscopables : unique symbol + + includes(searchElement: T, fromIndex?: number): boolean; +>includes : (searchElement: T, fromIndex?: number) => boolean +>searchElement : T +>fromIndex : number + + flatMap(callback: (value: T, index: number, array: T[]) => U | U[], thisArg?: any): U[] +>flatMap : (callback: (value: T, index: number, array: T[]) => U | U[], thisArg?: any) => U[] +>callback : (value: T, index: number, array: T[]) => U | U[] +>value : T +>index : number +>array : T[] +>thisArg : any + + flat(this: A, depth?: D): FlatArray[] +>flat : (this: A, depth?: D) => FlatArray[] +>this : A +>depth : D + + at(index: number): T | undefined; +>at : (index: number) => T | undefined +>index : number + length: number; >length : number diff --git a/tests/baselines/reference/importAliasModuleExports.types b/tests/baselines/reference/importAliasModuleExports.types index 2067e8b8d74e4..982fbb7cfba05 100644 --- a/tests/baselines/reference/importAliasModuleExports.types +++ b/tests/baselines/reference/importAliasModuleExports.types @@ -42,9 +42,9 @@ A.prototype.func = function() { this._func = 0; } Object.defineProperty(A.prototype, "def", { value: 0 }); >Object.defineProperty(A.prototype, "def", { value: 0 }) : A ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >A.prototype : A >A : typeof A >prototype : A diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.symbols b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.symbols index 319ae14250127..46d491a663621 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.symbols +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.symbols @@ -124,9 +124,9 @@ function compose(...fns: ((x: T) => T)[]): (x: T) => T { return (x: T) => fns.reduce((prev, fn) => fn(prev), x); >x : Symbol(x, Decl(inferFromGenericFunctionReturnTypes1.ts, 27, 10)) >T : Symbol(T, Decl(inferFromGenericFunctionReturnTypes1.ts, 26, 17)) ->fns.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>fns.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >fns : Symbol(fns, Decl(inferFromGenericFunctionReturnTypes1.ts, 26, 20)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(inferFromGenericFunctionReturnTypes1.ts, 27, 31)) >fn : Symbol(fn, Decl(inferFromGenericFunctionReturnTypes1.ts, 27, 36)) >fn : Symbol(fn, Decl(inferFromGenericFunctionReturnTypes1.ts, 27, 36)) diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.types b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.types index bc2d36c8d0f34..0161623a0e3b2 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.types +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.types @@ -89,9 +89,9 @@ function compose(...fns: ((x: T) => T)[]): (x: T) => T { >(x: T) => fns.reduce((prev, fn) => fn(prev), x) : (x: T) => T >x : T >fns.reduce((prev, fn) => fn(prev), x) : T ->fns.reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T): (x: T) => T; (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } +>fns.reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue?: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } >fns : ((x: T) => T)[] ->reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T): (x: T) => T; (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue?: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } >(prev, fn) => fn(prev) : (prev: T, fn: (x: T) => T) => T >prev : T >fn : (x: T) => T diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.symbols b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.symbols index 379f011d2ebca..6f06d29de8091 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.symbols +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.symbols @@ -292,9 +292,9 @@ function compose(...fns: ((x: T) => T)[]): (x: T) => T { return (x: T) => fns.reduce((prev, fn) => fn(prev), x); >x : Symbol(x, Decl(inferFromGenericFunctionReturnTypes2.ts, 49, 10)) >T : Symbol(T, Decl(inferFromGenericFunctionReturnTypes2.ts, 48, 17)) ->fns.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>fns.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >fns : Symbol(fns, Decl(inferFromGenericFunctionReturnTypes2.ts, 48, 20)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(inferFromGenericFunctionReturnTypes2.ts, 49, 31)) >fn : Symbol(fn, Decl(inferFromGenericFunctionReturnTypes2.ts, 49, 36)) >fn : Symbol(fn, Decl(inferFromGenericFunctionReturnTypes2.ts, 49, 36)) diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.types b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.types index 0c9cff3bf4a17..f8f905982c8e7 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.types +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.types @@ -282,9 +282,9 @@ function compose(...fns: ((x: T) => T)[]): (x: T) => T { >(x: T) => fns.reduce((prev, fn) => fn(prev), x) : (x: T) => T >x : T >fns.reduce((prev, fn) => fn(prev), x) : T ->fns.reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T): (x: T) => T; (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } +>fns.reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue?: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } >fns : ((x: T) => T)[] ->reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T): (x: T) => T; (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue?: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } >(prev, fn) => fn(prev) : (prev: T, fn: (x: T) => T) => T >prev : T >fn : (x: T) => T diff --git a/tests/baselines/reference/instantiationExpressions.types b/tests/baselines/reference/instantiationExpressions.types index 75fe72fc441bc..ff783d6f0532b 100644 --- a/tests/baselines/reference/instantiationExpressions.types +++ b/tests/baselines/reference/instantiationExpressions.types @@ -61,13 +61,13 @@ function f2() { >Array : ArrayConstructor const A1 = Array; // new (...) => string[] ->A1 : { (arrayLength: number): string[]; (...items: string[]): string[]; new (arrayLength: number): string[]; new (...items: string[]): string[]; isArray(arg: any): arg is any[]; readonly prototype: any[]; } ->Array : { (arrayLength: number): string[]; (...items: string[]): string[]; new (arrayLength: number): string[]; new (...items: string[]): string[]; isArray(arg: any): arg is any[]; readonly prototype: any[]; } +>A1 : { (arrayLength: number): string[]; (...items: string[]): string[]; new (arrayLength: number): string[]; new (...items: string[]): string[]; isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; } +>Array : { (arrayLength: number): string[]; (...items: string[]): string[]; new (arrayLength: number): string[]; new (...items: string[]): string[]; isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; } >Array : ArrayConstructor const A2 = Array; // Error ->A2 : { isArray(arg: any): arg is any[]; readonly prototype: any[]; } ->Array : { isArray(arg: any): arg is any[]; readonly prototype: any[]; } +>A2 : { isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; } +>Array : { isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; } >Array : ArrayConstructor } @@ -76,11 +76,11 @@ type T20 = typeof Array<>; // Error >Array : ArrayConstructor type T21 = typeof Array; // new (...) => string[] ->T21 : { (arrayLength: number): string[]; (...items: string[]): string[]; new (arrayLength: number): string[]; new (...items: string[]): string[]; isArray(arg: any): arg is any[]; readonly prototype: any[]; } +>T21 : { (arrayLength: number): string[]; (...items: string[]): string[]; new (arrayLength: number): string[]; new (...items: string[]): string[]; isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; } >Array : ArrayConstructor type T22 = typeof Array; // Error ->T22 : { isArray(arg: any): arg is any[]; readonly prototype: any[]; } +>T22 : { isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; } >Array : ArrayConstructor declare class C { diff --git a/tests/baselines/reference/intersectionTypeInference3.symbols b/tests/baselines/reference/intersectionTypeInference3.symbols index 7c851010e0153..60f9e1bb852ac 100644 --- a/tests/baselines/reference/intersectionTypeInference3.symbols +++ b/tests/baselines/reference/intersectionTypeInference3.symbols @@ -33,14 +33,14 @@ declare const b: Set; const c1 = Array.from(a).concat(Array.from(b)); >c1 : Symbol(c1, Decl(intersectionTypeInference3.ts, 11, 5)) >Array.from(a).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >a : Symbol(a, Decl(intersectionTypeInference3.ts, 8, 13)) >concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >b : Symbol(b, Decl(intersectionTypeInference3.ts, 9, 13)) // Simpler repro diff --git a/tests/baselines/reference/intersectionTypeInference3.types b/tests/baselines/reference/intersectionTypeInference3.types index 27e65f7684ad6..af3287ba23458 100644 --- a/tests/baselines/reference/intersectionTypeInference3.types +++ b/tests/baselines/reference/intersectionTypeInference3.types @@ -26,15 +26,15 @@ const c1 = Array.from(a).concat(Array.from(b)); >Array.from(a).concat(Array.from(b)) : A[] >Array.from(a).concat : { (...items: ConcatArray[]): A[]; (...items: (A | ConcatArray)[]): A[]; } >Array.from(a) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >a : Set >concat : { (...items: ConcatArray[]): A[]; (...items: (A | ConcatArray)[]): A[]; } >Array.from(b) : A[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >b : Set // Simpler repro diff --git a/tests/baselines/reference/intersectionsAndEmptyObjects.symbols b/tests/baselines/reference/intersectionsAndEmptyObjects.symbols index 7158ee012b987..83d3e6abe116b 100644 --- a/tests/baselines/reference/intersectionsAndEmptyObjects.symbols +++ b/tests/baselines/reference/intersectionsAndEmptyObjects.symbols @@ -116,9 +116,9 @@ const intersectDictionaries = ( ): F1 & F2 => Object.assign({}, d1, d2); >F1 : Symbol(F1, Decl(intersectionsAndEmptyObjects.ts, 30, 31)) >F2 : Symbol(F2, Decl(intersectionsAndEmptyObjects.ts, 30, 53)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >d1 : Symbol(d1, Decl(intersectionsAndEmptyObjects.ts, 30, 77)) >d2 : Symbol(d2, Decl(intersectionsAndEmptyObjects.ts, 31, 9)) diff --git a/tests/baselines/reference/intersectionsAndEmptyObjects.types b/tests/baselines/reference/intersectionsAndEmptyObjects.types index fc28f024e45e9..3d6a9caac238b 100644 --- a/tests/baselines/reference/intersectionsAndEmptyObjects.types +++ b/tests/baselines/reference/intersectionsAndEmptyObjects.types @@ -75,10 +75,10 @@ const intersectDictionaries = ( >d2 : F2 ): F1 & F2 => Object.assign({}, d1, d2); ->Object.assign({}, d1, d2) : {} & F1 & F2 ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign({}, d1, d2) : Writable & Writable +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >{} : {} >d1 : F1 >d2 : F2 diff --git a/tests/baselines/reference/isArray.types b/tests/baselines/reference/isArray.types index bc452b12bef01..5cf4c67e3b790 100644 --- a/tests/baselines/reference/isArray.types +++ b/tests/baselines/reference/isArray.types @@ -5,9 +5,9 @@ var maybeArray: number | number[]; if (Array.isArray(maybeArray)) { >Array.isArray(maybeArray) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >maybeArray : number | number[] maybeArray.length; // OK diff --git a/tests/baselines/reference/isArrayConformance.js b/tests/baselines/reference/isArrayConformance.js new file mode 100644 index 0000000000000..e9d7201dce498 --- /dev/null +++ b/tests/baselines/reference/isArrayConformance.js @@ -0,0 +1,107 @@ +//// [isArrayConformance.ts] +function f1(a: any) { + if (Array.isArray(a)) { + a; // Expected: any[] + } +} + +function f2(a: unknown) { + if (Array.isArray(a)) { + a; // Expected: unknown[] + } +} + +function f3(a: string | readonly string[] | number[]) { + if (Array.isArray(a)) { + var b: readonly string[] | number[] = a; // OK + a[0]; // Expected: string | number + } +} + +function f4(a: T) { + if (Array.isArray(a)) { + var b: readonly string[] | number[] = a; // OK + a[0]; // Expected: string | number + } +} + +// Repro from #41808 + +function f5(a: T) { + if (Array.isArray(a)) { + a[0]; // Expected: string + } +} + +function f6(a: (number[] | null | "loading")[]) { + a.filter(Array.isArray); // Expected: number[][] +} + +function f7(a: {} | null) { + if (Array.isArray(a)) { + a; // Expected: unknown[] + } +} + +function f8 | Iterable | readonly string[] | null>(a: T) { + if (Array.isArray(a)) { + var b: readonly string[] | number[] | boolean[] = a; // OK + a[0]; // Expected: string | number | boolean + } +} + +function f9(a: number | null) { + if (Array.isArray(a)) { + a; // Expected: never + } +} + + +//// [isArrayConformance.js] +function f1(a) { + if (Array.isArray(a)) { + a; // Expected: any[] + } +} +function f2(a) { + if (Array.isArray(a)) { + a; // Expected: unknown[] + } +} +function f3(a) { + if (Array.isArray(a)) { + var b = a; // OK + a[0]; // Expected: string | number + } +} +function f4(a) { + if (Array.isArray(a)) { + var b = a; // OK + a[0]; // Expected: string | number + } +} +// Repro from #41808 +function f5(a) { + if (Array.isArray(a)) { + a[0]; // Expected: string + } +} +function f6(a) { + a.filter(Array.isArray); // Expected: number[][] +} +function f7(a) { + if (Array.isArray(a)) { + a; // Expected: unknown[] + } +} +function f8(a) { + if (Array.isArray(a)) { + var b = a; // OK + a[0]; // Expected: string | number | boolean + } +} +function f9(a) { + if (Array.isArray(a)) { + a; // Expected: never + } +} diff --git a/tests/baselines/reference/isArrayConformance.symbols b/tests/baselines/reference/isArrayConformance.symbols new file mode 100644 index 0000000000000..18d043fd002b4 --- /dev/null +++ b/tests/baselines/reference/isArrayConformance.symbols @@ -0,0 +1,156 @@ +=== tests/cases/compiler/isArrayConformance.ts === +function f1(a: any) { +>f1 : Symbol(f1, Decl(isArrayConformance.ts, 0, 0)) +>a : Symbol(a, Decl(isArrayConformance.ts, 0, 12)) + + if (Array.isArray(a)) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 0, 12)) + + a; // Expected: any[] +>a : Symbol(a, Decl(isArrayConformance.ts, 0, 12)) + } +} + +function f2(a: unknown) { +>f2 : Symbol(f2, Decl(isArrayConformance.ts, 4, 1)) +>a : Symbol(a, Decl(isArrayConformance.ts, 6, 12)) + + if (Array.isArray(a)) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 6, 12)) + + a; // Expected: unknown[] +>a : Symbol(a, Decl(isArrayConformance.ts, 6, 12)) + } +} + +function f3(a: string | readonly string[] | number[]) { +>f3 : Symbol(f3, Decl(isArrayConformance.ts, 10, 1)) +>a : Symbol(a, Decl(isArrayConformance.ts, 12, 12)) + + if (Array.isArray(a)) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 12, 12)) + + var b: readonly string[] | number[] = a; // OK +>b : Symbol(b, Decl(isArrayConformance.ts, 14, 5)) +>a : Symbol(a, Decl(isArrayConformance.ts, 12, 12)) + + a[0]; // Expected: string | number +>a : Symbol(a, Decl(isArrayConformance.ts, 12, 12)) + } +} + +function f4(a: T) { +>f4 : Symbol(f4, Decl(isArrayConformance.ts, 17, 1)) +>T : Symbol(T, Decl(isArrayConformance.ts, 19, 12)) +>a : Symbol(a, Decl(isArrayConformance.ts, 19, 61)) +>T : Symbol(T, Decl(isArrayConformance.ts, 19, 12)) + + if (Array.isArray(a)) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 19, 61)) + + var b: readonly string[] | number[] = a; // OK +>b : Symbol(b, Decl(isArrayConformance.ts, 21, 5)) +>a : Symbol(a, Decl(isArrayConformance.ts, 19, 61)) + + a[0]; // Expected: string | number +>a : Symbol(a, Decl(isArrayConformance.ts, 19, 61)) + } +} + +// Repro from #41808 + +function f5(a: T) { +>f5 : Symbol(f5, Decl(isArrayConformance.ts, 24, 1)) +>T : Symbol(T, Decl(isArrayConformance.ts, 28, 12)) +>a : Symbol(a, Decl(isArrayConformance.ts, 28, 53)) +>T : Symbol(T, Decl(isArrayConformance.ts, 28, 12)) + + if (Array.isArray(a)) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 28, 53)) + + a[0]; // Expected: string +>a : Symbol(a, Decl(isArrayConformance.ts, 28, 53)) + } +} + +function f6(a: (number[] | null | "loading")[]) { +>f6 : Symbol(f6, Decl(isArrayConformance.ts, 32, 1)) +>a : Symbol(a, Decl(isArrayConformance.ts, 34, 12)) + + a.filter(Array.isArray); // Expected: number[][] +>a.filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 34, 12)) +>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +} + +function f7(a: {} | null) { +>f7 : Symbol(f7, Decl(isArrayConformance.ts, 36, 1)) +>a : Symbol(a, Decl(isArrayConformance.ts, 38, 12)) + + if (Array.isArray(a)) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 38, 12)) + + a; // Expected: unknown[] +>a : Symbol(a, Decl(isArrayConformance.ts, 38, 12)) + } +} + +function f8 | Iterable | readonly string[] | null>(a: T) { +>f8 : Symbol(f8, Decl(isArrayConformance.ts, 42, 1)) +>T : Symbol(T, Decl(isArrayConformance.ts, 44, 12)) +>ArrayLike : Symbol(ArrayLike, Decl(lib.es5.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 44, 88)) +>T : Symbol(T, Decl(isArrayConformance.ts, 44, 12)) + + if (Array.isArray(a)) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 44, 88)) + + var b: readonly string[] | number[] | boolean[] = a; // OK +>b : Symbol(b, Decl(isArrayConformance.ts, 46, 5)) +>a : Symbol(a, Decl(isArrayConformance.ts, 44, 88)) + + a[0]; // Expected: string | number | boolean +>a : Symbol(a, Decl(isArrayConformance.ts, 44, 88)) + } +} + +function f9(a: number | null) { +>f9 : Symbol(f9, Decl(isArrayConformance.ts, 49, 1)) +>a : Symbol(a, Decl(isArrayConformance.ts, 51, 12)) + + if (Array.isArray(a)) { +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(isArrayConformance.ts, 51, 12)) + + a; // Expected: never +>a : Symbol(a, Decl(isArrayConformance.ts, 51, 12)) + } +} + diff --git a/tests/baselines/reference/isArrayConformance.types b/tests/baselines/reference/isArrayConformance.types new file mode 100644 index 0000000000000..97fb03efb8aa9 --- /dev/null +++ b/tests/baselines/reference/isArrayConformance.types @@ -0,0 +1,169 @@ +=== tests/cases/compiler/isArrayConformance.ts === +function f1(a: any) { +>f1 : (a: any) => void +>a : any + + if (Array.isArray(a)) { +>Array.isArray(a) : boolean +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>Array : ArrayConstructor +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>a : any + + a; // Expected: any[] +>a : any[] + } +} + +function f2(a: unknown) { +>f2 : (a: unknown) => void +>a : unknown + + if (Array.isArray(a)) { +>Array.isArray(a) : boolean +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>Array : ArrayConstructor +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>a : unknown + + a; // Expected: unknown[] +>a : unknown[] + } +} + +function f3(a: string | readonly string[] | number[]) { +>f3 : (a: string | readonly string[] | number[]) => void +>a : string | readonly string[] | number[] + + if (Array.isArray(a)) { +>Array.isArray(a) : boolean +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>Array : ArrayConstructor +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>a : string | readonly string[] | number[] + + var b: readonly string[] | number[] = a; // OK +>b : readonly string[] | number[] +>a : readonly string[] | number[] + + a[0]; // Expected: string | number +>a[0] : string | number +>a : readonly string[] | number[] +>0 : 0 + } +} + +function f4(a: T) { +>f4 : (a: T) => void +>a : T + + if (Array.isArray(a)) { +>Array.isArray(a) : boolean +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>Array : ArrayConstructor +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>a : T + + var b: readonly string[] | number[] = a; // OK +>b : readonly string[] | number[] +>a : T extends any ? Extract ? U[] : unknown[], T> : never + + a[0]; // Expected: string | number +>a[0] : string | number +>a : T extends any ? Extract ? U[] : unknown[], T> : never +>0 : 0 + } +} + +// Repro from #41808 + +function f5(a: T) { +>f5 : (a: T) => void +>a : T + + if (Array.isArray(a)) { +>Array.isArray(a) : boolean +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>Array : ArrayConstructor +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>a : T + + a[0]; // Expected: string +>a[0] : string +>a : T extends any ? Extract ? U[] : unknown[], T> : never +>0 : 0 + } +} + +function f6(a: (number[] | null | "loading")[]) { +>f6 : (a: (number[] | null | "loading")[]) => void +>a : (number[] | "loading")[] +>null : null + + a.filter(Array.isArray); // Expected: number[][] +>a.filter(Array.isArray) : number[][] +>a.filter : { (predicate: (value: number[] | "loading", index: number, array: (number[] | "loading")[]) => value is S, thisArg?: any): S[]; (predicate: (value: number[] | "loading", index: number, array: (number[] | "loading")[]) => unknown, thisArg?: any): (number[] | "loading")[]; } +>a : (number[] | "loading")[] +>filter : { (predicate: (value: number[] | "loading", index: number, array: (number[] | "loading")[]) => value is S, thisArg?: any): S[]; (predicate: (value: number[] | "loading", index: number, array: (number[] | "loading")[]) => unknown, thisArg?: any): (number[] | "loading")[]; } +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>Array : ArrayConstructor +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +} + +function f7(a: {} | null) { +>f7 : (a: {} | null) => void +>a : {} +>null : null + + if (Array.isArray(a)) { +>Array.isArray(a) : boolean +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>Array : ArrayConstructor +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>a : {} + + a; // Expected: unknown[] +>a : unknown[] + } +} + +function f8 | Iterable | readonly string[] | null>(a: T) { +>f8 : | Iterable>(a: T) => void +>null : null +>a : T + + if (Array.isArray(a)) { +>Array.isArray(a) : boolean +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>Array : ArrayConstructor +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>a : T + + var b: readonly string[] | number[] | boolean[] = a; // OK +>b : readonly string[] | number[] | boolean[] +>a : T extends any ? Extract ? U[] : unknown[], T> : never + + a[0]; // Expected: string | number | boolean +>a[0] : string | number | boolean +>a : T extends any ? Extract ? U[] : unknown[], T> : never +>0 : 0 + } +} + +function f9(a: number | null) { +>f9 : (a: number | null) => void +>a : number +>null : null + + if (Array.isArray(a)) { +>Array.isArray(a) : boolean +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>Array : ArrayConstructor +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>a : number + + a; // Expected: never +>a : never + } +} + diff --git a/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types b/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types index 7dbd38d69dffa..834380deb4edf 100644 --- a/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types +++ b/tests/baselines/reference/javascriptDefinePropertyPrototypeNonConstructor.types @@ -5,9 +5,9 @@ function Graphic() { Object.defineProperty(Graphic.prototype, "instance", { >Object.defineProperty(Graphic.prototype, "instance", { get: function() { return this; }}) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Graphic.prototype : any >Graphic : typeof Graphic >prototype : any diff --git a/tests/baselines/reference/javascriptThisAssignmentInStaticBlock.errors.txt b/tests/baselines/reference/javascriptThisAssignmentInStaticBlock.errors.txt index a4729d56ef55b..aed3585e4d8b3 100644 --- a/tests/baselines/reference/javascriptThisAssignmentInStaticBlock.errors.txt +++ b/tests/baselines/reference/javascriptThisAssignmentInStaticBlock.errors.txt @@ -1,6 +1,6 @@ -/src/a.js(10,7): error TS2417: Class static side 'typeof ElementsArray' incorrectly extends base class static side '{ isArray(arg: any): arg is any[]; readonly prototype: any[]; }'. +/src/a.js(10,7): error TS2417: Class static side 'typeof ElementsArray' incorrectly extends base class static side '{ isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; }'. Types of property 'isArray' are incompatible. - Type '(arg: any) => boolean' is not assignable to type '(arg: any) => arg is any[]'. + Type '(arg: any) => boolean' is not assignable to type '(arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never'. Signature '(arg: any): boolean' must be a type predicate. @@ -16,9 +16,9 @@ // GH#46468 class ElementsArray extends Array { ~~~~~~~~~~~~~ -!!! error TS2417: Class static side 'typeof ElementsArray' incorrectly extends base class static side '{ isArray(arg: any): arg is any[]; readonly prototype: any[]; }'. +!!! error TS2417: Class static side 'typeof ElementsArray' incorrectly extends base class static side '{ isArray(arg: T): arg is T extends any ? Extract ? U[] : unknown[], T> : never; readonly prototype: any[]; }'. !!! error TS2417: Types of property 'isArray' are incompatible. -!!! error TS2417: Type '(arg: any) => boolean' is not assignable to type '(arg: any) => arg is any[]'. +!!! error TS2417: Type '(arg: any) => boolean' is not assignable to type '(arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never'. !!! error TS2417: Signature '(arg: any): boolean' must be a type predicate. static { const superisArray = super.isArray; diff --git a/tests/baselines/reference/javascriptThisAssignmentInStaticBlock.types b/tests/baselines/reference/javascriptThisAssignmentInStaticBlock.types index bbb41f4ea47fd..8556a3b246a20 100644 --- a/tests/baselines/reference/javascriptThisAssignmentInStaticBlock.types +++ b/tests/baselines/reference/javascriptThisAssignmentInStaticBlock.types @@ -25,17 +25,17 @@ class ElementsArray extends Array { static { const superisArray = super.isArray; ->superisArray : (arg: any) => arg is any[] ->super.isArray : (arg: any) => arg is any[] +>superisArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never +>super.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >super : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never const customIsArray = (arg)=> superisArray(arg); >customIsArray : (arg: any) => boolean >(arg)=> superisArray(arg) : (arg: any) => boolean >arg : any >superisArray(arg) : boolean ->superisArray : (arg: any) => arg is any[] +>superisArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >arg : any this.isArray = customIsArray; diff --git a/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types b/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types index e175b0527772f..00acd0d924652 100644 --- a/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types +++ b/tests/baselines/reference/jsCheckObjectDefineThisNoCrash.types @@ -6,9 +6,9 @@ class C { // Neither of the following should be recognized as declarations yet Object.defineProperty(this, "_prop", { value: {} }); >Object.defineProperty(this, "_prop", { value: {} }) : this ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >this : this >"_prop" : "_prop" >{ value: {} } : { value: {}; } @@ -17,9 +17,9 @@ class C { Object.defineProperty(this._prop, "num", { value: 12 }); >Object.defineProperty(this._prop, "num", { value: 12 }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >this._prop : any >this : this >_prop : any diff --git a/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types b/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types index fc664ec5d19a6..3bbfde8ecf84d 100644 --- a/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types +++ b/tests/baselines/reference/jsDeclarationsExportDefinePropertyEmit.types @@ -1,9 +1,9 @@ === tests/cases/conformance/jsdoc/declarations/index.js === Object.defineProperty(module.exports, "a", { value: function a() {} }); >Object.defineProperty(module.exports, "a", { value: function a() {} }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -15,9 +15,9 @@ Object.defineProperty(module.exports, "a", { value: function a() {} }); Object.defineProperty(module.exports, "b", { value: function b() {} }); >Object.defineProperty(module.exports, "b", { value: function b() {} }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -29,9 +29,9 @@ Object.defineProperty(module.exports, "b", { value: function b() {} }); Object.defineProperty(module.exports.b, "cat", { value: "cat" }); >Object.defineProperty(module.exports.b, "cat", { value: "cat" }) : () => void ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports.b : () => void >module.exports : typeof module.exports >module : { exports: typeof module.exports; } @@ -56,9 +56,9 @@ function d(a, b) { return /** @type {*} */(null); } Object.defineProperty(module.exports, "d", { value: d }); >Object.defineProperty(module.exports, "d", { value: d }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -83,9 +83,9 @@ function e(a, b) { return /** @type {*} */(null); } Object.defineProperty(module.exports, "e", { value: e }); >Object.defineProperty(module.exports, "e", { value: e }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -107,9 +107,9 @@ function f(a) { } Object.defineProperty(module.exports, "f", { value: f }); >Object.defineProperty(module.exports, "f", { value: f }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -120,9 +120,9 @@ Object.defineProperty(module.exports, "f", { value: f }); Object.defineProperty(module.exports.f, "self", { value: module.exports.f }); >Object.defineProperty(module.exports.f, "self", { value: module.exports.f }) : (a: T) => T ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports.f : (a: T) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } @@ -158,9 +158,9 @@ function g(a, b) { } Object.defineProperty(module.exports, "g", { value: g }); >Object.defineProperty(module.exports, "g", { value: g }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -191,9 +191,9 @@ function hh(a, b) { } Object.defineProperty(module.exports, "h", { value: hh }); >Object.defineProperty(module.exports, "h", { value: hh }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -204,9 +204,9 @@ Object.defineProperty(module.exports, "h", { value: hh }); Object.defineProperty(module.exports, "i", { value: function i(){} }); >Object.defineProperty(module.exports, "i", { value: function i(){} }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -218,9 +218,9 @@ Object.defineProperty(module.exports, "i", { value: function i(){} }); Object.defineProperty(module.exports, "ii", { value: module.exports.i }); >Object.defineProperty(module.exports, "ii", { value: module.exports.i }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -236,9 +236,9 @@ Object.defineProperty(module.exports, "ii", { value: module.exports.i }); // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings Object.defineProperty(module.exports, "jj", { value: module.exports.j }); >Object.defineProperty(module.exports, "jj", { value: module.exports.j }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -253,9 +253,9 @@ Object.defineProperty(module.exports, "jj", { value: module.exports.j }); Object.defineProperty(module.exports, "j", { value: function j() {} }); >Object.defineProperty(module.exports, "j", { value: function j() {} }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports diff --git a/tests/baselines/reference/jsDeclarationsGetterSetter.types b/tests/baselines/reference/jsDeclarationsGetterSetter.types index 146600cc4151e..aa064fb2d5be8 100644 --- a/tests/baselines/reference/jsDeclarationsGetterSetter.types +++ b/tests/baselines/reference/jsDeclarationsGetterSetter.types @@ -42,9 +42,9 @@ export class D {} Object.defineProperty(D.prototype, "x", { >Object.defineProperty(D.prototype, "x", { get() { return 12; }}) : D ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >D.prototype : D >D : typeof D >prototype : D @@ -64,9 +64,9 @@ export class E {} Object.defineProperty(E.prototype, "x", { >Object.defineProperty(E.prototype, "x", { /** * @param {number} _arg */ set(_arg) {}}) : E ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >E.prototype : E >E : typeof E >prototype : E @@ -87,9 +87,9 @@ export class F {} Object.defineProperty(F.prototype, "x", { >Object.defineProperty(F.prototype, "x", { get() { return 12; }, /** * @param {number} _arg */ set(_arg) {}}) : F ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >F.prototype : F >F : typeof F >prototype : F diff --git a/tests/baselines/reference/jsExpandoObjectDefineProperty.types b/tests/baselines/reference/jsExpandoObjectDefineProperty.types index fb25ede2da462..d1c059915ea2e 100644 --- a/tests/baselines/reference/jsExpandoObjectDefineProperty.types +++ b/tests/baselines/reference/jsExpandoObjectDefineProperty.types @@ -5,9 +5,9 @@ var chrome = {} Object.defineProperty(chrome, 'devtools', { value: {}, enumerable: true }) >Object.defineProperty(chrome, 'devtools', { value: {}, enumerable: true }) : typeof chrome ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >chrome : typeof chrome >'devtools' : "devtools" >{ value: {}, enumerable: true } : { value: {}; enumerable: true; } diff --git a/tests/baselines/reference/jsFileESModuleWithEnumTag.types b/tests/baselines/reference/jsFileESModuleWithEnumTag.types index 4ecc2d0fdd6a5..57bf39e14d499 100644 --- a/tests/baselines/reference/jsFileESModuleWithEnumTag.types +++ b/tests/baselines/reference/jsFileESModuleWithEnumTag.types @@ -34,9 +34,9 @@ ChangeDetectionStrategy[ChangeDetectionStrategy.Default] = 'Default'; Object.defineProperty(ChangeDetectionStrategy, "aField", {value: 42}); >Object.defineProperty(ChangeDetectionStrategy, "aField", {value: 42}) : { OnPush: number; Default: number; } ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >ChangeDetectionStrategy : { OnPush: number; Default: number; } >"aField" : "aField" >{value: 42} : { value: number; } diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 13df0c25c6a12..379c641e5849d 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -58,10 +58,10 @@ type K00 = keyof any; // string >K00 : string | number | symbol type K01 = keyof string; // "toString" | "charAt" | ... ->K01 : number | "length" | "toString" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" | "valueOf" +>K01 : number | "length" | "toString" | "valueOf" | "concat" | "slice" | "indexOf" | "lastIndexOf" | "charAt" | "charCodeAt" | "localeCompare" | "match" | "replace" | "search" | "split" | "substring" | "toLowerCase" | "toLocaleLowerCase" | "toUpperCase" | "toLocaleUpperCase" | "trim" | "substr" type K02 = keyof number; // "toString" | "toFixed" | "toExponential" | ... ->K02 : "toString" | "toLocaleString" | "toFixed" | "toExponential" | "toPrecision" | "valueOf" +>K02 : "toString" | "toLocaleString" | "valueOf" | "toFixed" | "toExponential" | "toPrecision" type K03 = keyof boolean; // "valueOf" >K03 : "valueOf" @@ -98,7 +98,7 @@ type K14 = keyof Object; // "constructor" | "toString" | ... >K14 : keyof Object type K15 = keyof E; // "toString" | "toFixed" | "toExponential" | ... ->K15 : "toString" | "toLocaleString" | "toFixed" | "toExponential" | "toPrecision" | "valueOf" +>K15 : "toString" | "toLocaleString" | "valueOf" | "toFixed" | "toExponential" | "toPrecision" type K16 = keyof [string, number]; // "0" | "1" | "length" | "toString" | ... >K16 : keyof [string, number] diff --git a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types index 7f6c8d2c42ada..f04edbf31e6c5 100644 --- a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types +++ b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport3.types @@ -32,9 +32,9 @@ const _str = "my-fake-sym"; Object.defineProperty(module.exports, _sym, { value: "ok" }); >Object.defineProperty(module.exports, _sym, { value: "ok" }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports @@ -45,9 +45,9 @@ Object.defineProperty(module.exports, _sym, { value: "ok" }); Object.defineProperty(module.exports, _str, { value: "ok" }); >Object.defineProperty(module.exports, _str, { value: "ok" }) : typeof module.exports ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >module.exports : typeof module.exports >module : { exports: typeof module.exports; } >exports : typeof module.exports diff --git a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types index 754ff5f67dbfe..fb697a9cfdc79 100644 --- a/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types +++ b/tests/baselines/reference/lateBoundAssignmentDeclarationSupport6.types @@ -51,9 +51,9 @@ F.prototype.defsAClass = true; Object.defineProperty(F.prototype, _str, {value: "ok"}); >Object.defineProperty(F.prototype, _str, {value: "ok"}) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >F.prototype : any >F : typeof F >prototype : any @@ -64,9 +64,9 @@ Object.defineProperty(F.prototype, _str, {value: "ok"}); Object.defineProperty(F.prototype, _sym, {value: "ok"}); >Object.defineProperty(F.prototype, _sym, {value: "ok"}) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >F.prototype : any >F : typeof F >prototype : any diff --git a/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types index fd3858baebc68..75764453653dc 100644 --- a/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types +++ b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types @@ -66,9 +66,9 @@ function f2() { >a4 : (string | false) | (string | false)[] >Array.isArray(elOrA) ? elOrA : [elOrA] : (string | false)[] >Array.isArray(elOrA) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >elOrA : (string | false) | (string | false)[] >elOrA : (string | false)[] >[elOrA] : (string | false)[] @@ -83,9 +83,9 @@ function f2() { >...Array.isArray(elOrA) ? elOrA : [elOrA] : string | false >Array.isArray(elOrA) ? elOrA : [elOrA] : (string | false)[] >Array.isArray(elOrA) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >elOrA : (string | false) | (string | false)[] >elOrA : (string | false)[] >[elOrA] : (string | false)[] diff --git a/tests/baselines/reference/malformedTags.types b/tests/baselines/reference/malformedTags.types index c3af959586790..e8a922a56cbf0 100644 --- a/tests/baselines/reference/malformedTags.types +++ b/tests/baselines/reference/malformedTags.types @@ -6,7 +6,7 @@ */ var isArray = Array.isArray; >isArray : Function ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never diff --git a/tests/baselines/reference/mapConstructorOnReadonlyTuple.js b/tests/baselines/reference/mapConstructorOnReadonlyTuple.js index af2a3b20b4cb8..4e158e568e477 100644 --- a/tests/baselines/reference/mapConstructorOnReadonlyTuple.js +++ b/tests/baselines/reference/mapConstructorOnReadonlyTuple.js @@ -1,7 +1,10 @@ //// [mapConstructorOnReadonlyTuple.ts] -const pairs = [['1', 1], ['2', 2]] as const -new Map(pairs); +const pairs = [[{}, 1], [{}, 2]] as const; +new Map(pairs); +new WeakMap(pairs); + //// [mapConstructorOnReadonlyTuple.js] -const pairs = [['1', 1], ['2', 2]]; +const pairs = [[{}, 1], [{}, 2]]; new Map(pairs); +new WeakMap(pairs); diff --git a/tests/baselines/reference/mapConstructorOnReadonlyTuple.symbols b/tests/baselines/reference/mapConstructorOnReadonlyTuple.symbols index 29426a8ec8ddb..c577de5c9fd04 100644 --- a/tests/baselines/reference/mapConstructorOnReadonlyTuple.symbols +++ b/tests/baselines/reference/mapConstructorOnReadonlyTuple.symbols @@ -1,5 +1,5 @@ === tests/cases/compiler/mapConstructorOnReadonlyTuple.ts === -const pairs = [['1', 1], ['2', 2]] as const +const pairs = [[{}, 1], [{}, 2]] as const; >pairs : Symbol(pairs, Decl(mapConstructorOnReadonlyTuple.ts, 0, 5)) >const : Symbol(const) @@ -7,3 +7,7 @@ new Map(pairs); >Map : Symbol(Map, Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) >pairs : Symbol(pairs, Decl(mapConstructorOnReadonlyTuple.ts, 0, 5)) +new WeakMap(pairs); +>WeakMap : Symbol(WeakMap, Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>pairs : Symbol(pairs, Decl(mapConstructorOnReadonlyTuple.ts, 0, 5)) + diff --git a/tests/baselines/reference/mapConstructorOnReadonlyTuple.types b/tests/baselines/reference/mapConstructorOnReadonlyTuple.types index 44fc38fa797ab..8a024a3df84ab 100644 --- a/tests/baselines/reference/mapConstructorOnReadonlyTuple.types +++ b/tests/baselines/reference/mapConstructorOnReadonlyTuple.types @@ -1,17 +1,22 @@ === tests/cases/compiler/mapConstructorOnReadonlyTuple.ts === -const pairs = [['1', 1], ['2', 2]] as const ->pairs : readonly [readonly ["1", 1], readonly ["2", 2]] ->[['1', 1], ['2', 2]] as const : readonly [readonly ["1", 1], readonly ["2", 2]] ->[['1', 1], ['2', 2]] : readonly [readonly ["1", 1], readonly ["2", 2]] ->['1', 1] : readonly ["1", 1] ->'1' : "1" +const pairs = [[{}, 1], [{}, 2]] as const; +>pairs : readonly [readonly [{}, 1], readonly [{}, 2]] +>[[{}, 1], [{}, 2]] as const : readonly [readonly [{}, 1], readonly [{}, 2]] +>[[{}, 1], [{}, 2]] : readonly [readonly [{}, 1], readonly [{}, 2]] +>[{}, 1] : readonly [{}, 1] +>{} : {} >1 : 1 ->['2', 2] : readonly ["2", 2] ->'2' : "2" +>[{}, 2] : readonly [{}, 2] +>{} : {} >2 : 2 new Map(pairs); ->new Map(pairs) : Map<"1" | "2", 1 | 2> +>new Map(pairs) : Map<{}, 1 | 2> >Map : MapConstructor ->pairs : readonly [readonly ["1", 1], readonly ["2", 2]] +>pairs : readonly [readonly [{}, 1], readonly [{}, 2]] + +new WeakMap(pairs); +>new WeakMap(pairs) : WeakMap<{}, 1 | 2> +>WeakMap : WeakMapConstructor +>pairs : readonly [readonly [{}, 1], readonly [{}, 2]] diff --git a/tests/baselines/reference/mappedTypeAsClauses.types b/tests/baselines/reference/mappedTypeAsClauses.types index 31ee234f7daf4..0af2ab2f79eec 100644 --- a/tests/baselines/reference/mappedTypeAsClauses.types +++ b/tests/baselines/reference/mappedTypeAsClauses.types @@ -33,10 +33,10 @@ type TP1 = TypeFromDefs<{ name: 'a', type: string } | { name: 'b', type: number // No array or tuple type mapping when 'as N' clause present type TA1 = Getters; ->TA1 : { getConcat: () => { (...items: ConcatArray[]): string[]; (...items: (string | ConcatArray)[]): string[]; }; getIndexOf: () => (searchElement: string, fromIndex?: number | undefined) => number; getLastIndexOf: () => (searchElement: string, fromIndex?: number | undefined) => number; getSlice: () => (start?: number | undefined, end?: number | undefined) => string[]; getLength: () => number; getToString: () => () => string; getToLocaleString: () => () => string; getPop: () => () => string | undefined; getPush: () => (...items: string[]) => number; getJoin: () => (separator?: string | undefined) => string; getReverse: () => () => string[]; getShift: () => () => string | undefined; getSort: () => (compareFn?: ((a: string, b: string) => number) | undefined) => string[]; getSplice: () => { (start: number, deleteCount?: number | undefined): string[]; (start: number, deleteCount: number, ...items: string[]): string[]; }; getUnshift: () => (...items: string[]) => number; getEvery: () => { (predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean; }; getSome: () => (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean; getForEach: () => (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void; getMap: () => (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]; getFilter: () => { (predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[]; (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[]; }; getReduce: () => { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; }; getReduceRight: () => { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; }; } +>TA1 : { getConcat: () => { (...items: ConcatArray[]): string[]; (...items: (string | ConcatArray)[]): string[]; }; getIndexOf: () => (searchElement: string, fromIndex?: number | undefined) => number; getLastIndexOf: () => (searchElement: string, fromIndex?: number | undefined) => number; getSlice: () => (start?: number | undefined, end?: number | undefined) => string[]; getLength: () => number; getToString: () => () => string; getToLocaleString: () => () => string; getValueOf: () => () => string[]; getPop: () => () => string | undefined; getPush: () => (...items: string[]) => number; getJoin: () => (separator?: string | undefined) => string; getReverse: () => () => string[]; getShift: () => () => string | undefined; getSort: () => (compareFn?: ((a: string, b: string) => number) | undefined) => string[]; getSplice: () => { (start: number, deleteCount?: number | undefined): string[]; (start: number, deleteCount: number, ...items: string[]): string[]; }; getUnshift: () => (...items: string[]) => number; getEvery: () => { (predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): boolean; }; getSome: () => (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any) => boolean; getForEach: () => (callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any) => void; getMap: () => (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[]; getFilter: () => { (predicate: (value: string, index: number, array: string[]) => value is S, thisArg?: any): S[]; (predicate: (value: string, index: number, array: string[]) => unknown, thisArg?: any): string[]; }; getReduce: () => { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string | undefined): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; }; getReduceRight: () => { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string | undefined): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; }; } type TA2 = Getters<[number, boolean]>; ->TA2 : { getConcat: () => { (...items: ConcatArray[]): (number | boolean)[]; (...items: (number | boolean | ConcatArray)[]): (number | boolean)[]; }; getIndexOf: () => (searchElement: number | boolean, fromIndex?: number | undefined) => number; getLastIndexOf: () => (searchElement: number | boolean, fromIndex?: number | undefined) => number; getSlice: () => (start?: number | undefined, end?: number | undefined) => (number | boolean)[]; getLength: () => 2; getToString: () => () => string; getToLocaleString: () => () => string; getPop: () => () => number | boolean | undefined; getPush: () => (...items: (number | boolean)[]) => number; getJoin: () => (separator?: string | undefined) => string; getReverse: () => () => (number | boolean)[]; getShift: () => () => number | boolean | undefined; getSort: () => (compareFn?: ((a: number | boolean, b: number | boolean) => number) | undefined) => [number, boolean]; getSplice: () => { (start: number, deleteCount?: number | undefined): (number | boolean)[]; (start: number, deleteCount: number, ...items: (number | boolean)[]): (number | boolean)[]; }; getUnshift: () => (...items: (number | boolean)[]) => number; getEvery: () => { (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => unknown, thisArg?: any): boolean; }; getSome: () => (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => unknown, thisArg?: any) => boolean; getForEach: () => (callbackfn: (value: number | boolean, index: number, array: (number | boolean)[]) => void, thisArg?: any) => void; getMap: () => (callbackfn: (value: number | boolean, index: number, array: (number | boolean)[]) => U, thisArg?: any) => U[]; getFilter: () => { (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => value is S, thisArg?: any): S[]; (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => unknown, thisArg?: any): (number | boolean)[]; }; getReduce: () => { (callbackfn: (previousValue: number | boolean, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => number | boolean): number | boolean; (callbackfn: (previousValue: number | boolean, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => number | boolean, initialValue: number | boolean): number | boolean; (callbackfn: (previousValue: U, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => U, initialValue: U): U; }; getReduceRight: () => { (callbackfn: (previousValue: number | boolean, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => number | boolean): number | boolean; (callbackfn: (previousValue: number | boolean, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => number | boolean, initialValue: number | boolean): number | boolean; (callbackfn: (previousValue: U, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => U, initialValue: U): U; }; get0: () => number; get1: () => boolean; } +>TA2 : { getConcat: () => { (...items: ConcatArray[]): (number | boolean)[]; (...items: (number | boolean | ConcatArray)[]): (number | boolean)[]; }; getIndexOf: () => (searchElement: number | boolean, fromIndex?: number | undefined) => number; getLastIndexOf: () => (searchElement: number | boolean, fromIndex?: number | undefined) => number; getSlice: () => (start?: number | undefined, end?: number | undefined) => (number | boolean)[]; getLength: () => 2; getToString: () => () => string; getToLocaleString: () => () => string; getValueOf: () => () => (number | boolean)[]; getPop: () => () => number | boolean | undefined; getPush: () => (...items: (number | boolean)[]) => number; getJoin: () => (separator?: string | undefined) => string; getReverse: () => () => (number | boolean)[]; getShift: () => () => number | boolean | undefined; getSort: () => (compareFn?: ((a: number | boolean, b: number | boolean) => number) | undefined) => (number | boolean)[]; getSplice: () => { (start: number, deleteCount?: number | undefined): (number | boolean)[]; (start: number, deleteCount: number, ...items: (number | boolean)[]): (number | boolean)[]; }; getUnshift: () => (...items: (number | boolean)[]) => number; getEvery: () => { (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => unknown, thisArg?: any): boolean; }; getSome: () => (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => unknown, thisArg?: any) => boolean; getForEach: () => (callbackfn: (value: number | boolean, index: number, array: (number | boolean)[]) => void, thisArg?: any) => void; getMap: () => (callbackfn: (value: number | boolean, index: number, array: (number | boolean)[]) => U, thisArg?: any) => U[]; getFilter: () => { (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => value is S, thisArg?: any): S[]; (predicate: (value: number | boolean, index: number, array: (number | boolean)[]) => unknown, thisArg?: any): (number | boolean)[]; }; getReduce: () => { (callbackfn: (previousValue: number | boolean, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => number | boolean, initialValue?: number | boolean | undefined): number | boolean; (callbackfn: (previousValue: U, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => U, initialValue: U): U; }; getReduceRight: () => { (callbackfn: (previousValue: number | boolean, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => number | boolean, initialValue?: number | boolean | undefined): number | boolean; (callbackfn: (previousValue: U, currentValue: number | boolean, currentIndex: number, array: (number | boolean)[]) => U, initialValue: U): U; }; get0: () => number; get1: () => boolean; } // Filtering using 'as N' clause diff --git a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt index bbb76e12da4b2..5508729019e78 100644 --- a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt +++ b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty.ts(3,1): error TS2741: Property 'length' is missing in type '{ [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [iterator]: () => IterableIterator; [unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; }' but required in type 'number[]'. +tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty.ts(3,1): error TS2741: Property 'length' is missing in type '{ [x: number]: number; toString: () => string; toLocaleString: () => string; valueOf: () => number[]; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [iterator]: () => IterableIterator; [unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; }' but required in type 'number[]'. ==== tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty.ts (1 errors) ==== @@ -6,6 +6,6 @@ tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty.ts(3,1): error T declare let src2: { [K in keyof number[] as Exclude]: (number[])[K] }; tgt2 = src2; // Should error ~~~~ -!!! error TS2741: Property 'length' is missing in type '{ [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [iterator]: () => IterableIterator; [unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; }' but required in type 'number[]'. +!!! error TS2741: Property 'length' is missing in type '{ [x: number]: number; toString: () => string; toLocaleString: () => string; valueOf: () => number[]; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [iterator]: () => IterableIterator; [unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; }' but required in type 'number[]'. !!! related TS2728 /.ts/lib.es5.d.ts:--:--: 'length' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.types b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.types index 40ddb9112fd5a..49d3bd0270aba 100644 --- a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.types +++ b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.types @@ -3,10 +3,10 @@ declare let tgt2: number[]; >tgt2 : number[] declare let src2: { [K in keyof number[] as Exclude]: (number[])[K] }; ->src2 : { [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } +>src2 : { [x: number]: number; toString: () => string; toLocaleString: () => string; valueOf: () => number[]; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } tgt2 = src2; // Should error ->tgt2 = src2 : { [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } +>tgt2 = src2 : { [x: number]: number; toString: () => string; toLocaleString: () => string; valueOf: () => number[]; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } >tgt2 : number[] ->src2 : { [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } +>src2 : { [x: number]: number; toString: () => string; toLocaleString: () => string; valueOf: () => number[]; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } diff --git a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.types b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.types index 7e1aa73fabbed..1dad1c4fcc6ea 100644 --- a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.types +++ b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.types @@ -1,8 +1,8 @@ === tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty2.ts === export const thing = (null as any as { [K in keyof number[] as Exclude]: (number[])[K] }); ->thing : { [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } ->(null as any as { [K in keyof number[] as Exclude]: (number[])[K] }) : { [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } ->null as any as { [K in keyof number[] as Exclude]: (number[])[K] } : { [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } +>thing : { [x: number]: number; toString: () => string; toLocaleString: () => string; valueOf: () => number[]; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } +>(null as any as { [K in keyof number[] as Exclude]: (number[])[K] }) : { [x: number]: number; toString: () => string; toLocaleString: () => string; valueOf: () => number[]; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } +>null as any as { [K in keyof number[] as Exclude]: (number[])[K] } : { [x: number]: number; toString: () => string; toLocaleString: () => string; valueOf: () => number[]; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (value: number, index: number, array: number[]) => U | readonly U[], thisArg?: any) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; [Symbol.unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; } >null as any : any >null : null diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.types b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.types index 1f8f0c5cb63fd..2562d0f8b9322 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.types +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingWellknownSymbolWithOutES6WellknownSymbolLib.types @@ -7,9 +7,9 @@ function f(x: number, y: number, z: number) { return Array.from(arguments); >Array.from(arguments) : any[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLike): T[]; (source: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLike): T[]; (source: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >arguments : IArguments } diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.symbols b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.symbols index e6990000e2b96..e3de35a53b016 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.symbols +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.symbols @@ -7,9 +7,9 @@ function f(x: number, y: number, z: number) { >z : Symbol(z, Decl(modularizeLibrary_NoErrorDuplicateLibOptions1.ts, 1, 32)) return Array.from(arguments); ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >arguments : Symbol(arguments) } diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index a7512bc94ab71..323aea8b976dc 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -8,9 +8,9 @@ function f(x: number, y: number, z: number) { return Array.from(arguments); >Array.from(arguments) : any[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >arguments : IArguments } diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.symbols b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.symbols index 98c20e30f6163..37051fd7fc3bc 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.symbols +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.symbols @@ -7,9 +7,9 @@ function f(x: number, y: number, z: number) { >z : Symbol(z, Decl(modularizeLibrary_NoErrorDuplicateLibOptions2.ts, 1, 32)) return Array.from(arguments); ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >arguments : Symbol(arguments) } diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index 4aad64cf7fec3..1d2b1fa7e7298 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -8,9 +8,9 @@ function f(x: number, y: number, z: number) { return Array.from(arguments); >Array.from(arguments) : any[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >arguments : IArguments } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.symbols b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.symbols index 0f213813411f3..b45bb8e5389dc 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.symbols +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.symbols @@ -7,9 +7,9 @@ function f(x: number, y: number, z: number) { >z : Symbol(z, Decl(modularizeLibrary_TargetES5UsingES6Lib.ts, 1, 32)) return Array.from(arguments); ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >arguments : Symbol(arguments) } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index 45ea713ea17c3..ba6a417569b0e 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -8,9 +8,9 @@ function f(x: number, y: number, z: number) { return Array.from(arguments); >Array.from(arguments) : any[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >arguments : IArguments } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.symbols b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.symbols index 634ec17844df6..b9acb8df534a3 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.symbols +++ b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.symbols @@ -7,9 +7,9 @@ function f(x: number, y: number, z: number) { >z : Symbol(z, Decl(modularizeLibrary_TargetES6UsingES6Lib.ts, 1, 32)) return Array.from(arguments); ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >arguments : Symbol(arguments) } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types index ba55dc465e84a..6affffb77edd1 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types @@ -8,9 +8,9 @@ function f(x: number, y: number, z: number) { return Array.from(arguments); >Array.from(arguments) : any[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >arguments : IArguments } diff --git a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types index d624c1ac259ad..394b8a4174b56 100644 --- a/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types +++ b/tests/baselines/reference/modularizeLibrary_UsingES5LibAndES6ArrayLib.types @@ -8,9 +8,9 @@ function f(x: number, y: number, z: number) { return Array.from(arguments); >Array.from(arguments) : any[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLike): T[]; (source: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLike): T[]; (source: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >arguments : IArguments } diff --git a/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types b/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types index d754962ab8689..9bfe173c253d9 100644 --- a/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types +++ b/tests/baselines/reference/modularizeLibrary_UsingES5LibES6ArrayLibES6WellknownSymbolLib.types @@ -7,9 +7,9 @@ function f(x: number, y: number, z: number) { return Array.from(arguments); >Array.from(arguments) : any[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLike): T[]; (source: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLike): T[]; (source: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >arguments : IArguments } diff --git a/tests/baselines/reference/narrowingAssignmentReadonlyRespectsAssertion.symbols b/tests/baselines/reference/narrowingAssignmentReadonlyRespectsAssertion.symbols index 8b7fcfebae44f..268a658b8f0c7 100644 --- a/tests/baselines/reference/narrowingAssignmentReadonlyRespectsAssertion.symbols +++ b/tests/baselines/reference/narrowingAssignmentReadonlyRespectsAssertion.symbols @@ -91,9 +91,9 @@ function testFunc() { const reversedVal1 = val1.slice().reverse(); >reversedVal1 : Symbol(reversedVal1, Decl(narrowingAssignmentReadonlyRespectsAssertion.ts, 29, 15)) >val1.slice().reverse : Symbol(Array.reverse, Decl(lib.es5.d.ts, --, --)) ->val1.slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) +>val1.slice : Symbol(ReadonlyArray.slice, Decl(lib.es5.d.ts, --, --)) >val1 : Symbol(val1, Decl(narrowingAssignmentReadonlyRespectsAssertion.ts, 26, 26)) ->slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) +>slice : Symbol(ReadonlyArray.slice, Decl(lib.es5.d.ts, --, --)) >reverse : Symbol(Array.reverse, Decl(lib.es5.d.ts, --, --)) console.log(reversedVal1); diff --git a/tests/baselines/reference/narrowingAssignmentReadonlyRespectsAssertion.types b/tests/baselines/reference/narrowingAssignmentReadonlyRespectsAssertion.types index 9fd13d661027a..c3e1a48cc0aa2 100644 --- a/tests/baselines/reference/narrowingAssignmentReadonlyRespectsAssertion.types +++ b/tests/baselines/reference/narrowingAssignmentReadonlyRespectsAssertion.types @@ -100,28 +100,28 @@ function testFunc() { if (Array.isArray(val1)) { >Array.isArray(val1) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >val1 : string | number | readonly (string | number)[] // This should retain val1 as being an array const reversedVal1 = val1.slice().reverse(); ->reversedVal1 : any[] ->val1.slice().reverse() : any[] ->val1.slice().reverse : () => any[] ->val1.slice() : any[] ->val1.slice : (start?: number, end?: number) => any[] ->val1 : any[] ->slice : (start?: number, end?: number) => any[] ->reverse : () => any[] +>reversedVal1 : (string | number)[] +>val1.slice().reverse() : (string | number)[] +>val1.slice().reverse : () => (string | number)[] +>val1.slice() : (string | number)[] +>val1.slice : (start?: number, end?: number) => (string | number)[] +>val1 : readonly (string | number)[] +>slice : (start?: number, end?: number) => (string | number)[] +>reverse : () => (string | number)[] console.log(reversedVal1); >console.log(reversedVal1) : void >console.log : (...data: any[]) => void >console : Console >log : (...data: any[]) => void ->reversedVal1 : any[] +>reversedVal1 : (string | number)[] } else { console.log(val1); @@ -129,7 +129,7 @@ function testFunc() { >console.log : (...data: any[]) => void >console : Console >log : (...data: any[]) => void ->val1 : string | number | readonly (string | number)[] +>val1 : string | number } console.log(val2); >console.log(val2) : void diff --git a/tests/baselines/reference/neverInference.symbols b/tests/baselines/reference/neverInference.symbols index b5e22441b9fd5..4f0dbbba9961d 100644 --- a/tests/baselines/reference/neverInference.symbols +++ b/tests/baselines/reference/neverInference.symbols @@ -91,9 +91,9 @@ declare function f2(as1: a[], as2: a[], cmp: (a1: a, a2: a) => number): void; f2(Array.from([0]), [], (a1, a2) => a1 - a2); >f2 : Symbol(f2, Decl(neverInference.ts, 21, 60)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >a1 : Symbol(a1, Decl(neverInference.ts, 26, 25)) >a2 : Symbol(a2, Decl(neverInference.ts, 26, 28)) >a1 : Symbol(a1, Decl(neverInference.ts, 26, 25)) @@ -101,9 +101,9 @@ f2(Array.from([0]), [], (a1, a2) => a1 - a2); f2(Array.from([]), [0], (a1, a2) => a1 - a2); >f2 : Symbol(f2, Decl(neverInference.ts, 21, 60)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >a1 : Symbol(a1, Decl(neverInference.ts, 27, 25)) >a2 : Symbol(a2, Decl(neverInference.ts, 27, 28)) >a1 : Symbol(a1, Decl(neverInference.ts, 27, 25)) diff --git a/tests/baselines/reference/neverInference.types b/tests/baselines/reference/neverInference.types index d6b0da3c3d6e9..cf5e8bc19cb9a 100644 --- a/tests/baselines/reference/neverInference.types +++ b/tests/baselines/reference/neverInference.types @@ -71,9 +71,9 @@ f2(Array.from([0]), [], (a1, a2) => a1 - a2); >f2(Array.from([0]), [], (a1, a2) => a1 - a2) : void >f2 : (as1: a[], as2: a[], cmp: (a1: a, a2: a) => number) => void >Array.from([0]) : number[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >[0] : number[] >0 : 0 >[] : never[] @@ -88,9 +88,9 @@ f2(Array.from([]), [0], (a1, a2) => a1 - a2); >f2(Array.from([]), [0], (a1, a2) => a1 - a2) : void >f2 : (as1: a[], as2: a[], cmp: (a1: a, a2: a) => number) => void >Array.from([]) : never[] ->Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T[]; (iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (source: ArrayLikeOrIterable): T[]; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >[] : never[] >[0] : number[] >0 : 0 diff --git a/tests/baselines/reference/noIterationTypeErrorsInCFA.types b/tests/baselines/reference/noIterationTypeErrorsInCFA.types index 9d0122627ffae..e411e9e5b26ab 100644 --- a/tests/baselines/reference/noIterationTypeErrorsInCFA.types +++ b/tests/baselines/reference/noIterationTypeErrorsInCFA.types @@ -10,9 +10,9 @@ export function doRemove(dds: F | F[]) { if (!Array.isArray(dds)) { >!Array.isArray(dds) : boolean >Array.isArray(dds) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >dds : F | F[] dds = [dds] diff --git a/tests/baselines/reference/objectFromEntries.types b/tests/baselines/reference/objectFromEntries.types index 9812b4ae90c4b..a8921ba8418c4 100644 --- a/tests/baselines/reference/objectFromEntries.types +++ b/tests/baselines/reference/objectFromEntries.types @@ -1,10 +1,10 @@ === tests/cases/compiler/objectFromEntries.ts === const o = Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]); ->o : { [k: string]: number; } ->Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]) : { [k: string]: number; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>o : { [k: string]: number; [k: number]: number; [k: symbol]: number; } +>Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]) : { [k: string]: number; [k: number]: number; [k: symbol]: number; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >[['a', 1], ['b', 2], ['c', 3]] : [string, number][] >['a', 1] : [string, number] >'a' : "a" @@ -17,20 +17,20 @@ const o = Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]); >3 : 3 const o2 = Object.fromEntries(new URLSearchParams()); ->o2 : { [k: string]: string; } ->Object.fromEntries(new URLSearchParams()) : { [k: string]: string; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>o2 : { [k: string]: string; [k: number]: string; [k: symbol]: string; } +>Object.fromEntries(new URLSearchParams()) : { [k: string]: string; [k: number]: string; [k: symbol]: string; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >new URLSearchParams() : URLSearchParams >URLSearchParams : { new (init?: string | URLSearchParams | string[][] | Record): URLSearchParams; prototype: URLSearchParams; toString(): string; } const o3 = Object.fromEntries(new Map([[Symbol("key"), "value"]])); ->o3 : { [k: string]: string; } ->Object.fromEntries(new Map([[Symbol("key"), "value"]])) : { [k: string]: string; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>o3 : { [k: string]: string; [k: number]: string; [k: symbol]: string; } +>Object.fromEntries(new Map([[Symbol("key"), "value"]])) : { [k: string]: string; [k: number]: string; [k: symbol]: string; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >new Map([[Symbol("key"), "value"]]) : Map >Map : MapConstructor >[[Symbol("key"), "value"]] : [symbol, string][] @@ -60,9 +60,9 @@ const frozenArray = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); const o4 = Object.fromEntries(frozenArray); >o4 : any >Object.fromEntries(frozenArray) : any ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >frozenArray : readonly (string | number)[][] const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); @@ -83,10 +83,10 @@ const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', >3 : 3 const o5 = Object.fromEntries(frozenArray2); ->o5 : { [k: string]: number; } ->Object.fromEntries(frozenArray2) : { [k: string]: number; } ->Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>o5 : { [k: string]: number; [k: number]: number; [k: symbol]: number; } +>Object.fromEntries(frozenArray2) : { [k: string]: number; [k: number]: number; [k: symbol]: number; } +>Object.fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor ->fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } +>fromEntries : { (entries: Iterable): { [k: string]: T; [k: number]: T; [k: symbol]: T; }; (entries: Iterable): any; } >frozenArray2 : readonly [string, number][] diff --git a/tests/baselines/reference/objectLitGetterSetter.types b/tests/baselines/reference/objectLitGetterSetter.types index 54c587890f8ac..f70bb3d8a3c9f 100644 --- a/tests/baselines/reference/objectLitGetterSetter.types +++ b/tests/baselines/reference/objectLitGetterSetter.types @@ -5,9 +5,9 @@ Object.defineProperty(obj, "accProperty", ({ >Object.defineProperty(obj, "accProperty", ({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } })) : {} ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >obj : {} >"accProperty" : "accProperty" >({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor diff --git a/tests/baselines/reference/objectMethodNullability.errors.txt b/tests/baselines/reference/objectMethodNullability.errors.txt new file mode 100644 index 0000000000000..570b7e758ea56 --- /dev/null +++ b/tests/baselines/reference/objectMethodNullability.errors.txt @@ -0,0 +1,135 @@ +tests/cases/compiler/objectMethodNullability.ts(3,15): error TS2769: No overload matches this call. + Overload 1 of 5, '(target: {}): {}', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. + Overload 2 of 5, '(target: {}, ...sources: any[]): any', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(4,15): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'. +tests/cases/compiler/objectMethodNullability.ts(5,25): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(6,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(7,16): error TS2769: No overload matches this call. + Overload 1 of 2, '(o: { [s: string]: unknown; } | ArrayLike): [string, unknown][]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{ [s: string]: unknown; } | ArrayLike'. + Overload 2 of 2, '(o: {}): [string, any][]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(8,33): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(9,34): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(10,28): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(11,30): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(12,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(13,15): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(14,13): error TS2769: No overload matches this call. + Overload 1 of 2, '(o: {}): string[]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. + Overload 2 of 2, '(o: object): string[]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(15,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(16,15): error TS2769: No overload matches this call. + Overload 1 of 2, '(o: ArrayLike | { [s: string]: unknown; }): unknown[]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'ArrayLike | { [s: string]: unknown; }'. + Overload 2 of 2, '(o: {}): any[]', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type '{}'. +tests/cases/compiler/objectMethodNullability.ts(18,15): error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(19,25): error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. +tests/cases/compiler/objectMethodNullability.ts(20,23): error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. + + +==== tests/cases/compiler/objectMethodNullability.ts (17 errors) ==== + // All of the following should produce an error: + + Object.assign(undefined); + ~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 5, '(target: {}): {}', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. +!!! error TS2769: Overload 2 of 5, '(target: {}, ...sources: any[]): any', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.create(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object | null'. + Object.defineProperties(undefined, {}); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object'. + Object.defineProperty(undefined, "foo", {}); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'object'. + Object.entries(undefined); + ~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(o: { [s: string]: unknown; } | ArrayLike): [string, unknown][]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{ [s: string]: unknown; } | ArrayLike'. +!!! error TS2769: Overload 2 of 2, '(o: {}): [string, any][]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getOwnPropertyDescriptor(undefined, "foo"); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getOwnPropertyDescriptors(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getOwnPropertyNames(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getOwnPropertySymbols(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.getPrototypeOf(undefined); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.hasOwn(undefined, "foo"); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.keys(undefined); + ~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(o: {}): string[]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. +!!! error TS2769: Overload 2 of 2, '(o: object): string[]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'object'. + Object.setPrototypeOf(undefined, {}); + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type '{}'. + Object.values(undefined); + ~~~~~~~~~ +!!! error TS2769: No overload matches this call. +!!! error TS2769: Overload 1 of 2, '(o: ArrayLike | { [s: string]: unknown; }): unknown[]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'ArrayLike | { [s: string]: unknown; }'. +!!! error TS2769: Overload 2 of 2, '(o: {}): any[]', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type '{}'. + + Object.create(0); + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. + Object.defineProperties(0, {}); + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. + Object.defineProperty(0, "foo", {}); + ~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'object'. + + // While the following should not: + + Object.assign(0); + Object.entries(0); + Object.getOwnPropertyDescriptor(0, "foo"); + Object.getOwnPropertyDescriptors(0); + Object.getOwnPropertyNames(0); + Object.getOwnPropertySymbols(0); + Object.getPrototypeOf(0); + Object.hasOwn(0, "foo"); + Object.keys(0); + Object.setPrototypeOf(0, {}); + Object.values(0); + + Object.freeze(undefined); + Object.isExtensible(undefined); + Object.isFrozen(undefined); + Object.isSealed(undefined); + Object.preventExtensions(undefined); + Object.seal(undefined); + + Object.freeze(0); + Object.isExtensible(0); + Object.isFrozen(0); + Object.isSealed(0); + Object.preventExtensions(0); + Object.seal(0); + \ No newline at end of file diff --git a/tests/baselines/reference/objectMethodNullability.js b/tests/baselines/reference/objectMethodNullability.js new file mode 100644 index 0000000000000..0fbc2117922b2 --- /dev/null +++ b/tests/baselines/reference/objectMethodNullability.js @@ -0,0 +1,95 @@ +//// [objectMethodNullability.ts] +// All of the following should produce an error: + +Object.assign(undefined); +Object.create(undefined); +Object.defineProperties(undefined, {}); +Object.defineProperty(undefined, "foo", {}); +Object.entries(undefined); +Object.getOwnPropertyDescriptor(undefined, "foo"); +Object.getOwnPropertyDescriptors(undefined); +Object.getOwnPropertyNames(undefined); +Object.getOwnPropertySymbols(undefined); +Object.getPrototypeOf(undefined); +Object.hasOwn(undefined, "foo"); +Object.keys(undefined); +Object.setPrototypeOf(undefined, {}); +Object.values(undefined); + +Object.create(0); +Object.defineProperties(0, {}); +Object.defineProperty(0, "foo", {}); + +// While the following should not: + +Object.assign(0); +Object.entries(0); +Object.getOwnPropertyDescriptor(0, "foo"); +Object.getOwnPropertyDescriptors(0); +Object.getOwnPropertyNames(0); +Object.getOwnPropertySymbols(0); +Object.getPrototypeOf(0); +Object.hasOwn(0, "foo"); +Object.keys(0); +Object.setPrototypeOf(0, {}); +Object.values(0); + +Object.freeze(undefined); +Object.isExtensible(undefined); +Object.isFrozen(undefined); +Object.isSealed(undefined); +Object.preventExtensions(undefined); +Object.seal(undefined); + +Object.freeze(0); +Object.isExtensible(0); +Object.isFrozen(0); +Object.isSealed(0); +Object.preventExtensions(0); +Object.seal(0); + + +//// [objectMethodNullability.js] +"use strict"; +// All of the following should produce an error: +Object.assign(undefined); +Object.create(undefined); +Object.defineProperties(undefined, {}); +Object.defineProperty(undefined, "foo", {}); +Object.entries(undefined); +Object.getOwnPropertyDescriptor(undefined, "foo"); +Object.getOwnPropertyDescriptors(undefined); +Object.getOwnPropertyNames(undefined); +Object.getOwnPropertySymbols(undefined); +Object.getPrototypeOf(undefined); +Object.hasOwn(undefined, "foo"); +Object.keys(undefined); +Object.setPrototypeOf(undefined, {}); +Object.values(undefined); +Object.create(0); +Object.defineProperties(0, {}); +Object.defineProperty(0, "foo", {}); +// While the following should not: +Object.assign(0); +Object.entries(0); +Object.getOwnPropertyDescriptor(0, "foo"); +Object.getOwnPropertyDescriptors(0); +Object.getOwnPropertyNames(0); +Object.getOwnPropertySymbols(0); +Object.getPrototypeOf(0); +Object.hasOwn(0, "foo"); +Object.keys(0); +Object.setPrototypeOf(0, {}); +Object.values(0); +Object.freeze(undefined); +Object.isExtensible(undefined); +Object.isFrozen(undefined); +Object.isSealed(undefined); +Object.preventExtensions(undefined); +Object.seal(undefined); +Object.freeze(0); +Object.isExtensible(0); +Object.isFrozen(0); +Object.isSealed(0); +Object.preventExtensions(0); +Object.seal(0); diff --git a/tests/baselines/reference/objectMethodNullability.symbols b/tests/baselines/reference/objectMethodNullability.symbols new file mode 100644 index 0000000000000..ee25962e68871 --- /dev/null +++ b/tests/baselines/reference/objectMethodNullability.symbols @@ -0,0 +1,225 @@ +=== tests/cases/compiler/objectMethodNullability.ts === +// All of the following should produce an error: + +Object.assign(undefined); +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.create(undefined); +>Object.create : Symbol(ObjectConstructor.create, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>create : Symbol(ObjectConstructor.create, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.defineProperties(undefined, {}); +>Object.defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.defineProperty(undefined, "foo", {}); +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.entries(undefined); +>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getOwnPropertyDescriptor(undefined, "foo"); +>Object.getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getOwnPropertyDescriptors(undefined); +>Object.getOwnPropertyDescriptors : Symbol(ObjectConstructor.getOwnPropertyDescriptors, Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyDescriptors : Symbol(ObjectConstructor.getOwnPropertyDescriptors, Decl(lib.es2017.object.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getOwnPropertyNames(undefined); +>Object.getOwnPropertyNames : Symbol(ObjectConstructor.getOwnPropertyNames, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyNames : Symbol(ObjectConstructor.getOwnPropertyNames, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getOwnPropertySymbols(undefined); +>Object.getOwnPropertySymbols : Symbol(ObjectConstructor.getOwnPropertySymbols, Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertySymbols : Symbol(ObjectConstructor.getOwnPropertySymbols, Decl(lib.es2015.core.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.getPrototypeOf(undefined); +>Object.getPrototypeOf : Symbol(ObjectConstructor.getPrototypeOf, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getPrototypeOf : Symbol(ObjectConstructor.getPrototypeOf, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.hasOwn(undefined, "foo"); +>Object.hasOwn : Symbol(ObjectConstructor.hasOwn, Decl(lib.es2022.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>hasOwn : Symbol(ObjectConstructor.hasOwn, Decl(lib.es2022.object.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.keys(undefined); +>Object.keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.setPrototypeOf(undefined, {}); +>Object.setPrototypeOf : Symbol(ObjectConstructor.setPrototypeOf, Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>setPrototypeOf : Symbol(ObjectConstructor.setPrototypeOf, Decl(lib.es2015.core.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.values(undefined); +>Object.values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.create(0); +>Object.create : Symbol(ObjectConstructor.create, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>create : Symbol(ObjectConstructor.create, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.defineProperties(0, {}); +>Object.defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperties : Symbol(ObjectConstructor.defineProperties, Decl(lib.es5.d.ts, --, --)) + +Object.defineProperty(0, "foo", {}); +>Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) + +// While the following should not: + +Object.assign(0); +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) + +Object.entries(0); +>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) + +Object.getOwnPropertyDescriptor(0, "foo"); +>Object.getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyDescriptor : Symbol(ObjectConstructor.getOwnPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) + +Object.getOwnPropertyDescriptors(0); +>Object.getOwnPropertyDescriptors : Symbol(ObjectConstructor.getOwnPropertyDescriptors, Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyDescriptors : Symbol(ObjectConstructor.getOwnPropertyDescriptors, Decl(lib.es2017.object.d.ts, --, --)) + +Object.getOwnPropertyNames(0); +>Object.getOwnPropertyNames : Symbol(ObjectConstructor.getOwnPropertyNames, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertyNames : Symbol(ObjectConstructor.getOwnPropertyNames, Decl(lib.es5.d.ts, --, --)) + +Object.getOwnPropertySymbols(0); +>Object.getOwnPropertySymbols : Symbol(ObjectConstructor.getOwnPropertySymbols, Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getOwnPropertySymbols : Symbol(ObjectConstructor.getOwnPropertySymbols, Decl(lib.es2015.core.d.ts, --, --)) + +Object.getPrototypeOf(0); +>Object.getPrototypeOf : Symbol(ObjectConstructor.getPrototypeOf, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>getPrototypeOf : Symbol(ObjectConstructor.getPrototypeOf, Decl(lib.es5.d.ts, --, --)) + +Object.hasOwn(0, "foo"); +>Object.hasOwn : Symbol(ObjectConstructor.hasOwn, Decl(lib.es2022.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>hasOwn : Symbol(ObjectConstructor.hasOwn, Decl(lib.es2022.object.d.ts, --, --)) + +Object.keys(0); +>Object.keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) + +Object.setPrototypeOf(0, {}); +>Object.setPrototypeOf : Symbol(ObjectConstructor.setPrototypeOf, Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>setPrototypeOf : Symbol(ObjectConstructor.setPrototypeOf, Decl(lib.es2015.core.d.ts, --, --)) + +Object.values(0); +>Object.values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --)) + +Object.freeze(undefined); +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.isExtensible(undefined); +>Object.isExtensible : Symbol(ObjectConstructor.isExtensible, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isExtensible : Symbol(ObjectConstructor.isExtensible, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.isFrozen(undefined); +>Object.isFrozen : Symbol(ObjectConstructor.isFrozen, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isFrozen : Symbol(ObjectConstructor.isFrozen, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.isSealed(undefined); +>Object.isSealed : Symbol(ObjectConstructor.isSealed, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isSealed : Symbol(ObjectConstructor.isSealed, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.preventExtensions(undefined); +>Object.preventExtensions : Symbol(ObjectConstructor.preventExtensions, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>preventExtensions : Symbol(ObjectConstructor.preventExtensions, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.seal(undefined); +>Object.seal : Symbol(ObjectConstructor.seal, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>seal : Symbol(ObjectConstructor.seal, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +Object.freeze(0); +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.isExtensible(0); +>Object.isExtensible : Symbol(ObjectConstructor.isExtensible, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isExtensible : Symbol(ObjectConstructor.isExtensible, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.isFrozen(0); +>Object.isFrozen : Symbol(ObjectConstructor.isFrozen, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isFrozen : Symbol(ObjectConstructor.isFrozen, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.isSealed(0); +>Object.isSealed : Symbol(ObjectConstructor.isSealed, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isSealed : Symbol(ObjectConstructor.isSealed, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +Object.preventExtensions(0); +>Object.preventExtensions : Symbol(ObjectConstructor.preventExtensions, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>preventExtensions : Symbol(ObjectConstructor.preventExtensions, Decl(lib.es5.d.ts, --, --)) + +Object.seal(0); +>Object.seal : Symbol(ObjectConstructor.seal, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>seal : Symbol(ObjectConstructor.seal, Decl(lib.es5.d.ts, --, --)) + diff --git a/tests/baselines/reference/objectMethodNullability.types b/tests/baselines/reference/objectMethodNullability.types new file mode 100644 index 0000000000000..8a9d71816061b --- /dev/null +++ b/tests/baselines/reference/objectMethodNullability.types @@ -0,0 +1,297 @@ +=== tests/cases/compiler/objectMethodNullability.ts === +// All of the following should produce an error: + +Object.assign(undefined); +>Object.assign(undefined) : {} +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } +>Object : ObjectConstructor +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } +>undefined : undefined + +Object.create(undefined); +>Object.create(undefined) : any +>Object.create : { (o: object | null): any; (o: object | null, properties: PropertyDescriptorMap & ThisType): any; } +>Object : ObjectConstructor +>create : { (o: object | null): any; (o: object | null, properties: PropertyDescriptorMap & ThisType): any; } +>undefined : undefined + +Object.defineProperties(undefined, {}); +>Object.defineProperties(undefined, {}) : object +>Object.defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>Object : ObjectConstructor +>defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>undefined : undefined +>{} : {} + +Object.defineProperty(undefined, "foo", {}); +>Object.defineProperty(undefined, "foo", {}) : object +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>undefined : undefined +>"foo" : "foo" +>{} : {} + +Object.entries(undefined); +>Object.entries(undefined) : [string, unknown][] +>Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>Object : ObjectConstructor +>entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>undefined : undefined + +Object.getOwnPropertyDescriptor(undefined, "foo"); +>Object.getOwnPropertyDescriptor(undefined, "foo") : PropertyDescriptor | undefined +>Object.getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined +>Object : ObjectConstructor +>getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined +>undefined : undefined +>"foo" : "foo" + +Object.getOwnPropertyDescriptors(undefined); +>Object.getOwnPropertyDescriptors(undefined) : {} & PropertyDescriptorMap +>Object.getOwnPropertyDescriptors : (o: T) => { [P in keyof T]: TypedPropertyDescriptor; } & PropertyDescriptorMap +>Object : ObjectConstructor +>getOwnPropertyDescriptors : (o: T) => { [P in keyof T]: TypedPropertyDescriptor; } & PropertyDescriptorMap +>undefined : undefined + +Object.getOwnPropertyNames(undefined); +>Object.getOwnPropertyNames(undefined) : string[] +>Object.getOwnPropertyNames : (o: {}) => string[] +>Object : ObjectConstructor +>getOwnPropertyNames : (o: {}) => string[] +>undefined : undefined + +Object.getOwnPropertySymbols(undefined); +>Object.getOwnPropertySymbols(undefined) : symbol[] +>Object.getOwnPropertySymbols : (o: {}) => symbol[] +>Object : ObjectConstructor +>getOwnPropertySymbols : (o: {}) => symbol[] +>undefined : undefined + +Object.getPrototypeOf(undefined); +>Object.getPrototypeOf(undefined) : any +>Object.getPrototypeOf : (o: {}) => any +>Object : ObjectConstructor +>getPrototypeOf : (o: {}) => any +>undefined : undefined + +Object.hasOwn(undefined, "foo"); +>Object.hasOwn(undefined, "foo") : boolean +>Object.hasOwn : (o: {}, v: PropertyKey) => boolean +>Object : ObjectConstructor +>hasOwn : (o: {}, v: PropertyKey) => boolean +>undefined : undefined +>"foo" : "foo" + +Object.keys(undefined); +>Object.keys(undefined) : string[] +>Object.keys : { (o: object): string[]; (o: {}): string[]; } +>Object : ObjectConstructor +>keys : { (o: object): string[]; (o: {}): string[]; } +>undefined : undefined + +Object.setPrototypeOf(undefined, {}); +>Object.setPrototypeOf(undefined, {}) : any +>Object.setPrototypeOf : (o: {}, proto: object | null) => any +>Object : ObjectConstructor +>setPrototypeOf : (o: {}, proto: object | null) => any +>undefined : undefined +>{} : {} + +Object.values(undefined); +>Object.values(undefined) : unknown[] +>Object.values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } +>Object : ObjectConstructor +>values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } +>undefined : undefined + +Object.create(0); +>Object.create(0) : any +>Object.create : { (o: object | null): any; (o: object | null, properties: PropertyDescriptorMap & ThisType): any; } +>Object : ObjectConstructor +>create : { (o: object | null): any; (o: object | null, properties: PropertyDescriptorMap & ThisType): any; } +>0 : 0 + +Object.defineProperties(0, {}); +>Object.defineProperties(0, {}) : object +>Object.defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>Object : ObjectConstructor +>defineProperties : (o: T, properties: PropertyDescriptorMap & ThisType) => T +>0 : 0 +>{} : {} + +Object.defineProperty(0, "foo", {}); +>Object.defineProperty(0, "foo", {}) : object +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>0 : 0 +>"foo" : "foo" +>{} : {} + +// While the following should not: + +Object.assign(0); +>Object.assign(0) : 0 +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } +>Object : ObjectConstructor +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } +>0 : 0 + +Object.entries(0); +>Object.entries(0) : [string, any][] +>Object.entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>Object : ObjectConstructor +>entries : { (o: { [s: string]: T; } | ArrayLike): [string, T][]; (o: {}): [string, any][]; } +>0 : 0 + +Object.getOwnPropertyDescriptor(0, "foo"); +>Object.getOwnPropertyDescriptor(0, "foo") : PropertyDescriptor | undefined +>Object.getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined +>Object : ObjectConstructor +>getOwnPropertyDescriptor : (o: {}, p: PropertyKey) => PropertyDescriptor | undefined +>0 : 0 +>"foo" : "foo" + +Object.getOwnPropertyDescriptors(0); +>Object.getOwnPropertyDescriptors(0) : number & PropertyDescriptorMap +>Object.getOwnPropertyDescriptors : (o: T) => { [P in keyof T]: TypedPropertyDescriptor; } & PropertyDescriptorMap +>Object : ObjectConstructor +>getOwnPropertyDescriptors : (o: T) => { [P in keyof T]: TypedPropertyDescriptor; } & PropertyDescriptorMap +>0 : 0 + +Object.getOwnPropertyNames(0); +>Object.getOwnPropertyNames(0) : string[] +>Object.getOwnPropertyNames : (o: {}) => string[] +>Object : ObjectConstructor +>getOwnPropertyNames : (o: {}) => string[] +>0 : 0 + +Object.getOwnPropertySymbols(0); +>Object.getOwnPropertySymbols(0) : symbol[] +>Object.getOwnPropertySymbols : (o: {}) => symbol[] +>Object : ObjectConstructor +>getOwnPropertySymbols : (o: {}) => symbol[] +>0 : 0 + +Object.getPrototypeOf(0); +>Object.getPrototypeOf(0) : any +>Object.getPrototypeOf : (o: {}) => any +>Object : ObjectConstructor +>getPrototypeOf : (o: {}) => any +>0 : 0 + +Object.hasOwn(0, "foo"); +>Object.hasOwn(0, "foo") : boolean +>Object.hasOwn : (o: {}, v: PropertyKey) => boolean +>Object : ObjectConstructor +>hasOwn : (o: {}, v: PropertyKey) => boolean +>0 : 0 +>"foo" : "foo" + +Object.keys(0); +>Object.keys(0) : string[] +>Object.keys : { (o: object): string[]; (o: {}): string[]; } +>Object : ObjectConstructor +>keys : { (o: object): string[]; (o: {}): string[]; } +>0 : 0 + +Object.setPrototypeOf(0, {}); +>Object.setPrototypeOf(0, {}) : any +>Object.setPrototypeOf : (o: {}, proto: object | null) => any +>Object : ObjectConstructor +>setPrototypeOf : (o: {}, proto: object | null) => any +>0 : 0 +>{} : {} + +Object.values(0); +>Object.values(0) : any[] +>Object.values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } +>Object : ObjectConstructor +>values : { (o: { [s: string]: T; } | ArrayLike): T[]; (o: {}): any[]; } +>0 : 0 + +Object.freeze(undefined); +>Object.freeze(undefined) : undefined +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object : ObjectConstructor +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>undefined : undefined + +Object.isExtensible(undefined); +>Object.isExtensible(undefined) : false +>Object.isExtensible : { (o: object): boolean; (o: any): false; } +>Object : ObjectConstructor +>isExtensible : { (o: object): boolean; (o: any): false; } +>undefined : undefined + +Object.isFrozen(undefined); +>Object.isFrozen(undefined) : true +>Object.isFrozen : { (o: object): boolean; (o: any): true; } +>Object : ObjectConstructor +>isFrozen : { (o: object): boolean; (o: any): true; } +>undefined : undefined + +Object.isSealed(undefined); +>Object.isSealed(undefined) : true +>Object.isSealed : { (o: object): boolean; (o: any): true; } +>Object : ObjectConstructor +>isSealed : { (o: object): boolean; (o: any): true; } +>undefined : undefined + +Object.preventExtensions(undefined); +>Object.preventExtensions(undefined) : undefined +>Object.preventExtensions : (o: T) => T +>Object : ObjectConstructor +>preventExtensions : (o: T) => T +>undefined : undefined + +Object.seal(undefined); +>Object.seal(undefined) : undefined +>Object.seal : (o: T) => T +>Object : ObjectConstructor +>seal : (o: T) => T +>undefined : undefined + +Object.freeze(0); +>Object.freeze(0) : number +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object : ObjectConstructor +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>0 : 0 + +Object.isExtensible(0); +>Object.isExtensible(0) : false +>Object.isExtensible : { (o: object): boolean; (o: any): false; } +>Object : ObjectConstructor +>isExtensible : { (o: object): boolean; (o: any): false; } +>0 : 0 + +Object.isFrozen(0); +>Object.isFrozen(0) : true +>Object.isFrozen : { (o: object): boolean; (o: any): true; } +>Object : ObjectConstructor +>isFrozen : { (o: object): boolean; (o: any): true; } +>0 : 0 + +Object.isSealed(0); +>Object.isSealed(0) : true +>Object.isSealed : { (o: object): boolean; (o: any): true; } +>Object : ObjectConstructor +>isSealed : { (o: object): boolean; (o: any): true; } +>0 : 0 + +Object.preventExtensions(0); +>Object.preventExtensions(0) : 0 +>Object.preventExtensions : (o: T) => T +>Object : ObjectConstructor +>preventExtensions : (o: T) => T +>0 : 0 + +Object.seal(0); +>Object.seal(0) : 0 +>Object.seal : (o: T) => T +>Object : ObjectConstructor +>seal : (o: T) => T +>0 : 0 + diff --git a/tests/baselines/reference/parserUsingConstructorAsIdentifier.types b/tests/baselines/reference/parserUsingConstructorAsIdentifier.types index 0034fa0e136e5..29122ff0c0f67 100644 --- a/tests/baselines/reference/parserUsingConstructorAsIdentifier.types +++ b/tests/baselines/reference/parserUsingConstructorAsIdentifier.types @@ -90,9 +90,9 @@ Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true }); >Object.defineProperty(constructor.prototype, "constructor", { value: constructor, writable: true, configurable: true, enumerable: true }) : any ->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor ->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >constructor.prototype : any >constructor : any >prototype : any diff --git a/tests/baselines/reference/parserharness.symbols b/tests/baselines/reference/parserharness.symbols index 62604cadf5a19..3f2bb0a26409d 100644 --- a/tests/baselines/reference/parserharness.symbols +++ b/tests/baselines/reference/parserharness.symbols @@ -4754,7 +4754,7 @@ module Harness { var minDistFromStart = entries.map(x => x.editRange.minChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromStart : Symbol(minDistFromStart, Decl(parserharness.ts, 1595, 15)) ->entries.map(x => x.editRange.minChar).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries.map(x => x.editRange.minChar).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >entries.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) @@ -4762,7 +4762,7 @@ module Harness { >x.editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) >x : Symbol(x, Decl(parserharness.ts, 1595, 47)) >editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1595, 81)) >current : Symbol(current, Decl(parserharness.ts, 1595, 86)) >Math.min : Symbol(Math.min, Decl(lib.es5.d.ts, --, --)) @@ -4773,7 +4773,7 @@ module Harness { var minDistFromEnd = entries.map(x => x.length - x.editRange.limChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromEnd : Symbol(minDistFromEnd, Decl(parserharness.ts, 1596, 15)) ->entries.map(x => x.length - x.editRange.limChar).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries.map(x => x.length - x.editRange.limChar).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >entries.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) @@ -4784,7 +4784,7 @@ module Harness { >x.editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) >x : Symbol(x, Decl(parserharness.ts, 1596, 45)) >editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1596, 90)) >current : Symbol(current, Decl(parserharness.ts, 1596, 95)) >Math.min : Symbol(Math.min, Decl(lib.es5.d.ts, --, --)) @@ -4795,7 +4795,7 @@ module Harness { var aggDelta = entries.map(x => x.editRange.delta).reduce((prev, current) => prev + current); >aggDelta : Symbol(aggDelta, Decl(parserharness.ts, 1597, 15)) ->entries.map(x => x.editRange.delta).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries.map(x => x.editRange.delta).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >entries.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) >map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) @@ -4803,7 +4803,7 @@ module Harness { >x.editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) >x : Symbol(x, Decl(parserharness.ts, 1597, 39)) >editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1597, 71)) >current : Symbol(current, Decl(parserharness.ts, 1597, 76)) >prev : Symbol(prev, Decl(parserharness.ts, 1597, 71)) diff --git a/tests/baselines/reference/parserharness.types b/tests/baselines/reference/parserharness.types index 498e9bf7ea7ce..3e6dce1ecf480 100644 --- a/tests/baselines/reference/parserharness.types +++ b/tests/baselines/reference/parserharness.types @@ -3068,13 +3068,13 @@ module Harness { >(Array.isArray && Array.isArray(arg)) || arg instanceof Array : boolean >(Array.isArray && Array.isArray(arg)) : boolean >Array.isArray && Array.isArray(arg) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array.isArray(arg) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >arg : any >arg instanceof Array : boolean >arg : any @@ -6476,7 +6476,7 @@ module Harness { var minDistFromStart = entries.map(x => x.editRange.minChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromStart : any >entries.map(x => x.editRange.minChar).reduce((prev, current) => Math.min(prev, current)) : any ->entries.map(x => x.editRange.minChar).reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>entries.map(x => x.editRange.minChar).reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >entries.map(x => x.editRange.minChar) : any[] >entries.map : (callbackfn: (value: { length: number; editRange: TypeScript.ScriptEditRange; }, index: number, array: { length: number; editRange: TypeScript.ScriptEditRange; }[]) => U, thisArg?: any) => U[] >entries : { length: number; editRange: TypeScript.ScriptEditRange; }[] @@ -6488,7 +6488,7 @@ module Harness { >x : { length: number; editRange: TypeScript.ScriptEditRange; } >editRange : TypeScript.ScriptEditRange >minChar : any ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >(prev, current) => Math.min(prev, current) : (prev: any, current: any) => number >prev : any >current : any @@ -6502,7 +6502,7 @@ module Harness { var minDistFromEnd = entries.map(x => x.length - x.editRange.limChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromEnd : number >entries.map(x => x.length - x.editRange.limChar).reduce((prev, current) => Math.min(prev, current)) : number ->entries.map(x => x.length - x.editRange.limChar).reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>entries.map(x => x.length - x.editRange.limChar).reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >entries.map(x => x.length - x.editRange.limChar) : number[] >entries.map : (callbackfn: (value: { length: number; editRange: TypeScript.ScriptEditRange; }, index: number, array: { length: number; editRange: TypeScript.ScriptEditRange; }[]) => U, thisArg?: any) => U[] >entries : { length: number; editRange: TypeScript.ScriptEditRange; }[] @@ -6518,7 +6518,7 @@ module Harness { >x : { length: number; editRange: TypeScript.ScriptEditRange; } >editRange : TypeScript.ScriptEditRange >limChar : any ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(prev, current) => Math.min(prev, current) : (prev: number, current: number) => number >prev : number >current : number @@ -6532,7 +6532,7 @@ module Harness { var aggDelta = entries.map(x => x.editRange.delta).reduce((prev, current) => prev + current); >aggDelta : any >entries.map(x => x.editRange.delta).reduce((prev, current) => prev + current) : any ->entries.map(x => x.editRange.delta).reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>entries.map(x => x.editRange.delta).reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >entries.map(x => x.editRange.delta) : any[] >entries.map : (callbackfn: (value: { length: number; editRange: TypeScript.ScriptEditRange; }, index: number, array: { length: number; editRange: TypeScript.ScriptEditRange; }[]) => U, thisArg?: any) => U[] >entries : { length: number; editRange: TypeScript.ScriptEditRange; }[] @@ -6544,7 +6544,7 @@ module Harness { >x : { length: number; editRange: TypeScript.ScriptEditRange; } >editRange : TypeScript.ScriptEditRange >delta : any ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >(prev, current) => prev + current : (prev: any, current: any) => any >prev : any >current : any diff --git a/tests/baselines/reference/partiallyDiscriminantedUnions.types b/tests/baselines/reference/partiallyDiscriminantedUnions.types index bc2ee1bf23586..d64531417ac2a 100644 --- a/tests/baselines/reference/partiallyDiscriminantedUnions.types +++ b/tests/baselines/reference/partiallyDiscriminantedUnions.types @@ -77,9 +77,9 @@ function isShape(s : Shapes): s is Shape { return !Array.isArray(s); >!Array.isArray(s) : boolean >Array.isArray(s) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >s : Shapes } diff --git a/tests/baselines/reference/recursiveTypeReferences1.symbols b/tests/baselines/reference/recursiveTypeReferences1.symbols index db0d7ca297136..ad0c60e40dfff 100644 --- a/tests/baselines/reference/recursiveTypeReferences1.symbols +++ b/tests/baselines/reference/recursiveTypeReferences1.symbols @@ -398,12 +398,12 @@ function cons(hs: HTMLHeadingElement[]): Tree { >Tree : Symbol(Tree, Decl(recursiveTypeReferences1.ts, 94, 19)) return hs ->hs .reduce((hss, h) => { const hs = hss.pop()!; return hs.length === 0 || level(h) > level(hs[0]) ? concat(hss, [concat(hs, [h])]) : concat(hss, [hs, [h]]); }, [[]]) .reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->hs .reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>hs .reduce((hss, h) => { const hs = hss.pop()!; return hs.length === 0 || level(h) > level(hs[0]) ? concat(hss, [concat(hs, [h])]) : concat(hss, [hs, [h]]); }, [[]]) .reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>hs .reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >hs : Symbol(hs, Decl(recursiveTypeReferences1.ts, 110, 14)) .reduce((hss, h) => { ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >HTMLHeadingElement : Symbol(HTMLHeadingElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --)) >hss : Symbol(hss, Decl(recursiveTypeReferences1.ts, 112, 37)) >h : Symbol(h, Decl(recursiveTypeReferences1.ts, 112, 41)) @@ -435,7 +435,7 @@ function cons(hs: HTMLHeadingElement[]): Tree { }, [[]]) .reduce((node, hs) => ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Tree : Symbol(Tree, Decl(recursiveTypeReferences1.ts, 94, 19)) >node : Symbol(node, Decl(recursiveTypeReferences1.ts, 118, 19)) >hs : Symbol(hs, Decl(recursiveTypeReferences1.ts, 118, 24)) diff --git a/tests/baselines/reference/recursiveTypeReferences1.types b/tests/baselines/reference/recursiveTypeReferences1.types index bbdcdfeb82708..ee2c8a1b47e93 100644 --- a/tests/baselines/reference/recursiveTypeReferences1.types +++ b/tests/baselines/reference/recursiveTypeReferences1.types @@ -486,13 +486,13 @@ function cons(hs: HTMLHeadingElement[]): Tree { return hs >hs .reduce((hss, h) => { const hs = hss.pop()!; return hs.length === 0 || level(h) > level(hs[0]) ? concat(hss, [concat(hs, [h])]) : concat(hss, [hs, [h]]); }, [[]]) .reduce((node, hs) => hs.length === 0 ? node : concat(node, [[hs.shift()!, cons(hs)]]) , []) : Tree ->hs .reduce((hss, h) => { const hs = hss.pop()!; return hs.length === 0 || level(h) > level(hs[0]) ? concat(hss, [concat(hs, [h])]) : concat(hss, [hs, [h]]); }, [[]]) .reduce : { (callbackfn: (previousValue: HTMLHeadingElement[], currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => HTMLHeadingElement[]): HTMLHeadingElement[]; (callbackfn: (previousValue: HTMLHeadingElement[], currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => HTMLHeadingElement[], initialValue: HTMLHeadingElement[]): HTMLHeadingElement[]; (callbackfn: (previousValue: U, currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => U, initialValue: U): U; } +>hs .reduce((hss, h) => { const hs = hss.pop()!; return hs.length === 0 || level(h) > level(hs[0]) ? concat(hss, [concat(hs, [h])]) : concat(hss, [hs, [h]]); }, [[]]) .reduce : { (callbackfn: (previousValue: HTMLHeadingElement[], currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => HTMLHeadingElement[], initialValue?: HTMLHeadingElement[] | undefined): HTMLHeadingElement[]; (callbackfn: (previousValue: U, currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => U, initialValue: U): U; } >hs .reduce((hss, h) => { const hs = hss.pop()!; return hs.length === 0 || level(h) > level(hs[0]) ? concat(hss, [concat(hs, [h])]) : concat(hss, [hs, [h]]); }, [[]]) : HTMLHeadingElement[][] ->hs .reduce : { (callbackfn: (previousValue: HTMLHeadingElement, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => HTMLHeadingElement): HTMLHeadingElement; (callbackfn: (previousValue: HTMLHeadingElement, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => HTMLHeadingElement, initialValue: HTMLHeadingElement): HTMLHeadingElement; (callbackfn: (previousValue: U, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => U, initialValue: U): U; } +>hs .reduce : { (callbackfn: (previousValue: HTMLHeadingElement, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => HTMLHeadingElement, initialValue?: HTMLHeadingElement | undefined): HTMLHeadingElement; (callbackfn: (previousValue: U, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => U, initialValue: U): U; } >hs : HTMLHeadingElement[] .reduce((hss, h) => { ->reduce : { (callbackfn: (previousValue: HTMLHeadingElement, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => HTMLHeadingElement): HTMLHeadingElement; (callbackfn: (previousValue: HTMLHeadingElement, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => HTMLHeadingElement, initialValue: HTMLHeadingElement): HTMLHeadingElement; (callbackfn: (previousValue: U, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: HTMLHeadingElement, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => HTMLHeadingElement, initialValue?: HTMLHeadingElement | undefined): HTMLHeadingElement; (callbackfn: (previousValue: U, currentValue: HTMLHeadingElement, currentIndex: number, array: HTMLHeadingElement[]) => U, initialValue: U): U; } >(hss, h) => { const hs = hss.pop()!; return hs.length === 0 || level(h) > level(hs[0]) ? concat(hss, [concat(hs, [h])]) : concat(hss, [hs, [h]]); } : (hss: HTMLHeadingElement[][], h: HTMLHeadingElement) => any >hss : HTMLHeadingElement[][] >h : HTMLHeadingElement @@ -548,7 +548,7 @@ function cons(hs: HTMLHeadingElement[]): Tree { >[] : never[] .reduce((node, hs) => ->reduce : { (callbackfn: (previousValue: HTMLHeadingElement[], currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => HTMLHeadingElement[]): HTMLHeadingElement[]; (callbackfn: (previousValue: HTMLHeadingElement[], currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => HTMLHeadingElement[], initialValue: HTMLHeadingElement[]): HTMLHeadingElement[]; (callbackfn: (previousValue: U, currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: HTMLHeadingElement[], currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => HTMLHeadingElement[], initialValue?: HTMLHeadingElement[] | undefined): HTMLHeadingElement[]; (callbackfn: (previousValue: U, currentValue: HTMLHeadingElement[], currentIndex: number, array: HTMLHeadingElement[][]) => U, initialValue: U): U; } >(node, hs) => hs.length === 0 ? node : concat(node, [[hs.shift()!, cons(hs)]]) : (node: Tree, hs: HTMLHeadingElement[]) => any >node : Tree >hs : HTMLHeadingElement[] diff --git a/tests/baselines/reference/recursiveTypeRelations.symbols b/tests/baselines/reference/recursiveTypeRelations.symbols index 02ab8184b9e52..55b4939e45714 100644 --- a/tests/baselines/reference/recursiveTypeRelations.symbols +++ b/tests/baselines/reference/recursiveTypeRelations.symbols @@ -89,12 +89,12 @@ export function css(styles: S, ...classNam >arg : Symbol(arg, Decl(recursiveTypeRelations.ts, 18, 30)) return Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { ->Object.keys(arg).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.keys(arg).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object.keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >keys : Symbol(ObjectConstructor.keys, Decl(lib.es5.d.ts, --, --)) >arg : Symbol(arg, Decl(recursiveTypeRelations.ts, 18, 30)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >ClassNameObject : Symbol(ClassNameObject) >obj : Symbol(obj, Decl(recursiveTypeRelations.ts, 26, 55)) >ClassNameObject : Symbol(ClassNameObject) diff --git a/tests/baselines/reference/recursiveTypeRelations.types b/tests/baselines/reference/recursiveTypeRelations.types index d632e0c097336..aaafd380ad509 100644 --- a/tests/baselines/reference/recursiveTypeRelations.types +++ b/tests/baselines/reference/recursiveTypeRelations.types @@ -70,13 +70,13 @@ export function css(styles: S, ...classNam return Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { >Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; }, {}) : string ->Object.keys(arg).reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>Object.keys(arg).reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >Object.keys(arg) : string[] >Object.keys : (o: object) => string[] >Object : ObjectConstructor >keys : (o: object) => string[] >arg : ClassNameObjectMap ->reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >(obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; } : (obj: ClassNameObject, key: keyof S) => ClassNameObject >obj : ClassNameObject >key : keyof S diff --git a/tests/baselines/reference/restElementWithNumberPropertyName.types b/tests/baselines/reference/restElementWithNumberPropertyName.types index 3764ac6dca41e..4144c6ef46a30 100644 --- a/tests/baselines/reference/restElementWithNumberPropertyName.types +++ b/tests/baselines/reference/restElementWithNumberPropertyName.types @@ -1,7 +1,7 @@ === tests/cases/compiler/restElementWithNumberPropertyName.ts === const { 0: a, ...b } = [0, 1, 2]; >a : number ->b : { [n: number]: number; 0: number; 1: number; 2: number; length: 3; toString(): string; toLocaleString(): string; pop(): number; push(...items: number[]): number; concat(...items: ConcatArray[]): number[]; concat(...items: (number | ConcatArray)[]): number[]; join(separator?: string): string; reverse(): number[]; shift(): number; slice(start?: number, end?: number): number[]; sort(compareFn?: (a: number, b: number) => number): [number, number, number]; splice(start: number, deleteCount?: number): number[]; splice(start: number, deleteCount: number, ...items: number[]): number[]; unshift(...items: number[]): number; indexOf(searchElement: number, fromIndex?: number): number; lastIndexOf(searchElement: number, fromIndex?: number): number; every(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; some(predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; forEach(callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any): void; map(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; filter(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>b : { [n: number]: number; 0: number; 1: number; 2: number; length: 3; toString(): string; toLocaleString(): string; valueOf(): number[]; pop(): number; push(...items: number[]): number; concat(...items: ConcatArray[]): number[]; concat(...items: (number | ConcatArray)[]): number[]; join(separator?: string): string; reverse(): number[]; shift(): number; slice(start?: number, end?: number): number[]; sort(compareFn?: (a: number, b: number) => number): number[]; splice(start: number, deleteCount?: number): number[]; splice(start: number, deleteCount: number, ...items: number[]): number[]; unshift(...items: number[]): number; indexOf(searchElement: number, fromIndex?: number): number; lastIndexOf(searchElement: number, fromIndex?: number): number; every(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; some(predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; forEach(callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any): void; map(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; filter(predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >[0, 1, 2] : [number, number, number] >0 : 0 >1 : 1 diff --git a/tests/baselines/reference/restInvalidArgumentType.types b/tests/baselines/reference/restInvalidArgumentType.types index 119b0394726da..bd9f41dc69d0b 100644 --- a/tests/baselines/reference/restInvalidArgumentType.types +++ b/tests/baselines/reference/restInvalidArgumentType.types @@ -71,7 +71,7 @@ function f(p1: T, p2: T[]) { >p1 : T var {...r2} = p2; // OK ->r2 : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; pop(): T; push(...items: T[]): number; concat(...items: ConcatArray[]): T[]; concat(...items: (T | ConcatArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; some(predicate: (value: T, index: number, array: T[]) => unknown, 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(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): 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): T; 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; } +>r2 : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; valueOf(): T[]; pop(): T; push(...items: T[]): number; concat(...items: ConcatArray[]): T[]; concat(...items: (T | ConcatArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; some(predicate: (value: T, index: number, array: T[]) => unknown, 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(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: T, index: number, array: T[]) => unknown, 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; } >p2 : T[] var {...r3} = t; // Error, generic type paramter diff --git a/tests/baselines/reference/restParameterWithBindingPattern3.types b/tests/baselines/reference/restParameterWithBindingPattern3.types index 392cb1cd90a3e..c5e58b3b3f94a 100644 --- a/tests/baselines/reference/restParameterWithBindingPattern3.types +++ b/tests/baselines/reference/restParameterWithBindingPattern3.types @@ -31,5 +31,5 @@ function e(...{0: a = 1, 1: b = true, ...rest: rest}: [boolean, string, number]) >b : string >true : true >rest : any ->rest : { [n: number]: string | number | boolean; 0: boolean; 1: string; 2: number; length: 3; toString(): string; toLocaleString(): string; pop(): string | number | boolean; push(...items: (string | number | boolean)[]): number; concat(...items: ConcatArray[]): (string | number | boolean)[]; concat(...items: (string | number | boolean | ConcatArray)[]): (string | number | boolean)[]; join(separator?: string): string; reverse(): (string | number | boolean)[]; shift(): string | number | boolean; slice(start?: number, end?: number): (string | number | boolean)[]; sort(compareFn?: (a: string | number | boolean, b: string | number | boolean) => number): [boolean, string, number]; splice(start: number, deleteCount?: number): (string | number | boolean)[]; splice(start: number, deleteCount: number, ...items: (string | number | boolean)[]): (string | number | boolean)[]; unshift(...items: (string | number | boolean)[]): number; indexOf(searchElement: string | number | boolean, fromIndex?: number): number; lastIndexOf(searchElement: string | number | boolean, fromIndex?: number): number; every(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => unknown, thisArg?: any): boolean; some(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => unknown, thisArg?: any): boolean; forEach(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => void, thisArg?: any): void; map(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => U, thisArg?: any): U[]; filter(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => unknown, thisArg?: any): (string | number | boolean)[]; reduce(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean): string | number | boolean; reduce(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean, initialValue: string | number | boolean): string | number | boolean; reduce(callbackfn: (previousValue: U, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean): string | number | boolean; reduceRight(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean, initialValue: string | number | boolean): string | number | boolean; reduceRight(callbackfn: (previousValue: U, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => U, initialValue: U): U; } +>rest : { [n: number]: string | number | boolean; 0: boolean; 1: string; 2: number; length: 3; toString(): string; toLocaleString(): string; valueOf(): (string | number | boolean)[]; pop(): string | number | boolean; push(...items: (string | number | boolean)[]): number; concat(...items: ConcatArray[]): (string | number | boolean)[]; concat(...items: (string | number | boolean | ConcatArray)[]): (string | number | boolean)[]; join(separator?: string): string; reverse(): (string | number | boolean)[]; shift(): string | number | boolean; slice(start?: number, end?: number): (string | number | boolean)[]; sort(compareFn?: (a: string | number | boolean, b: string | number | boolean) => number): (string | number | boolean)[]; splice(start: number, deleteCount?: number): (string | number | boolean)[]; splice(start: number, deleteCount: number, ...items: (string | number | boolean)[]): (string | number | boolean)[]; unshift(...items: (string | number | boolean)[]): number; indexOf(searchElement: string | number | boolean, fromIndex?: number): number; lastIndexOf(searchElement: string | number | boolean, fromIndex?: number): number; every(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => unknown, thisArg?: any): boolean; some(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => unknown, thisArg?: any): boolean; forEach(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => void, thisArg?: any): void; map(callbackfn: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => U, thisArg?: any): U[]; filter(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: string | number | boolean, index: number, array: (string | number | boolean)[]) => unknown, thisArg?: any): (string | number | boolean)[]; reduce(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean, initialValue?: string | number | boolean): string | number | boolean; reduce(callbackfn: (previousValue: U, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: string | number | boolean, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => string | number | boolean, initialValue?: string | number | boolean): string | number | boolean; reduceRight(callbackfn: (previousValue: U, currentValue: string | number | boolean, currentIndex: number, array: (string | number | boolean)[]) => U, initialValue: U): U; } diff --git a/tests/baselines/reference/restPropertyWithBindingPattern.types b/tests/baselines/reference/restPropertyWithBindingPattern.types index 988d9b3c7afdc..d2dbe624a43fb 100644 --- a/tests/baselines/reference/restPropertyWithBindingPattern.types +++ b/tests/baselines/reference/restPropertyWithBindingPattern.types @@ -17,14 +17,14 @@ ({...[]} = {}); >({...[]} = {}) : {} >{...[]} = {} : {} ->{...[]} : { [n: number]: never; length: 0; toString(): string; toLocaleString(): string; pop(): never; push(...items: never[]): number; concat(...items: ConcatArray[]): never[]; concat(...items: ConcatArray[]): never[]; join(separator?: string): string; reverse(): never[]; shift(): never; slice(start?: number, end?: number): never[]; sort(compareFn?: (a: never, b: never) => number): []; splice(start: number, deleteCount?: number): never[]; splice(start: number, deleteCount: number, ...items: never[]): never[]; unshift(...items: never[]): number; indexOf(searchElement: never, fromIndex?: number): number; lastIndexOf(searchElement: never, fromIndex?: number): number; every(predicate: (value: never, index: number, array: never[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): boolean; some(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): boolean; forEach(callbackfn: (value: never, index: number, array: never[]) => void, thisArg?: any): void; map(callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any): U[]; filter(predicate: (value: never, index: number, array: never[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): never[]; reduce(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never): never; reduce(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never, initialValue: never): never; reduce(callbackfn: (previousValue: U, currentValue: never, currentIndex: number, array: never[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never): never; reduceRight(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never, initialValue: never): never; reduceRight(callbackfn: (previousValue: U, currentValue: never, currentIndex: number, array: never[]) => U, initialValue: U): U; } +>{...[]} : { [n: number]: never; length: 0; toString(): string; toLocaleString(): string; valueOf(): never[]; pop(): never; push(...items: never[]): number; concat(...items: ConcatArray[]): never[]; concat(...items: ConcatArray[]): never[]; join(separator?: string): string; reverse(): never[]; shift(): never; slice(start?: number, end?: number): never[]; sort(compareFn?: (a: never, b: never) => number): never[]; splice(start: number, deleteCount?: number): never[]; splice(start: number, deleteCount: number, ...items: never[]): never[]; unshift(...items: never[]): number; indexOf(searchElement: never, fromIndex?: number): number; lastIndexOf(searchElement: never, fromIndex?: number): number; every(predicate: (value: never, index: number, array: never[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): boolean; some(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): boolean; forEach(callbackfn: (value: never, index: number, array: never[]) => void, thisArg?: any): void; map(callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any): U[]; filter(predicate: (value: never, index: number, array: never[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): never[]; reduce(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never, initialValue?: never): never; reduce(callbackfn: (previousValue: U, currentValue: never, currentIndex: number, array: never[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never, initialValue?: never): never; reduceRight(callbackfn: (previousValue: U, currentValue: never, currentIndex: number, array: never[]) => U, initialValue: U): U; } >[] : [] >{} : {} ({...([])} = {}); >({...([])} = {}) : {} >{...([])} = {} : {} ->{...([])} : { [n: number]: never; length: 0; toString(): string; toLocaleString(): string; pop(): never; push(...items: never[]): number; concat(...items: ConcatArray[]): never[]; concat(...items: ConcatArray[]): never[]; join(separator?: string): string; reverse(): never[]; shift(): never; slice(start?: number, end?: number): never[]; sort(compareFn?: (a: never, b: never) => number): []; splice(start: number, deleteCount?: number): never[]; splice(start: number, deleteCount: number, ...items: never[]): never[]; unshift(...items: never[]): number; indexOf(searchElement: never, fromIndex?: number): number; lastIndexOf(searchElement: never, fromIndex?: number): number; every(predicate: (value: never, index: number, array: never[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): boolean; some(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): boolean; forEach(callbackfn: (value: never, index: number, array: never[]) => void, thisArg?: any): void; map(callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any): U[]; filter(predicate: (value: never, index: number, array: never[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): never[]; reduce(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never): never; reduce(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never, initialValue: never): never; reduce(callbackfn: (previousValue: U, currentValue: never, currentIndex: number, array: never[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never): never; reduceRight(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never, initialValue: never): never; reduceRight(callbackfn: (previousValue: U, currentValue: never, currentIndex: number, array: never[]) => U, initialValue: U): U; } +>{...([])} : { [n: number]: never; length: 0; toString(): string; toLocaleString(): string; valueOf(): never[]; pop(): never; push(...items: never[]): number; concat(...items: ConcatArray[]): never[]; concat(...items: ConcatArray[]): never[]; join(separator?: string): string; reverse(): never[]; shift(): never; slice(start?: number, end?: number): never[]; sort(compareFn?: (a: never, b: never) => number): never[]; splice(start: number, deleteCount?: number): never[]; splice(start: number, deleteCount: number, ...items: never[]): never[]; unshift(...items: never[]): number; indexOf(searchElement: never, fromIndex?: number): number; lastIndexOf(searchElement: never, fromIndex?: number): number; every(predicate: (value: never, index: number, array: never[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): boolean; some(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): boolean; forEach(callbackfn: (value: never, index: number, array: never[]) => void, thisArg?: any): void; map(callbackfn: (value: never, index: number, array: never[]) => U, thisArg?: any): U[]; filter(predicate: (value: never, index: number, array: never[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: never, index: number, array: never[]) => unknown, thisArg?: any): never[]; reduce(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never, initialValue?: never): never; reduce(callbackfn: (previousValue: U, currentValue: never, currentIndex: number, array: never[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: never, currentValue: never, currentIndex: number, array: never[]) => never, initialValue?: never): never; reduceRight(callbackfn: (previousValue: U, currentValue: never, currentIndex: number, array: never[]) => U, initialValue: U): U; } >([]) : [] >[] : [] >{} : {} diff --git a/tests/baselines/reference/returnTypeParameterWithModules.symbols b/tests/baselines/reference/returnTypeParameterWithModules.symbols index f147c3f79a23e..6c709d4c15255 100644 --- a/tests/baselines/reference/returnTypeParameterWithModules.symbols +++ b/tests/baselines/reference/returnTypeParameterWithModules.symbols @@ -13,11 +13,11 @@ module M1 { return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]); >Array.prototype.reduce.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) ->Array.prototype.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Array.prototype.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.es5.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >prototype : Symbol(ArrayConstructor.prototype, Decl(lib.es5.d.ts, --, --)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) >ar : Symbol(ar, Decl(returnTypeParameterWithModules.ts, 1, 30)) >e : Symbol(e, Decl(returnTypeParameterWithModules.ts, 1, 36)) diff --git a/tests/baselines/reference/returnTypeParameterWithModules.types b/tests/baselines/reference/returnTypeParameterWithModules.types index d3601048bce91..3ca98948a17e1 100644 --- a/tests/baselines/reference/returnTypeParameterWithModules.types +++ b/tests/baselines/reference/returnTypeParameterWithModules.types @@ -11,11 +11,11 @@ module M1 { return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]); >Array.prototype.reduce.apply(ar, e ? [f, e] : [f]) : any >Array.prototype.reduce.apply : (this: Function, thisArg: any, argArray?: any) => any ->Array.prototype.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>Array.prototype.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >Array.prototype : any[] >Array : ArrayConstructor >prototype : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >apply : (this: Function, thisArg: any, argArray?: any) => any >ar : any >e ? [f, e] : [f] : any[] diff --git a/tests/baselines/reference/spreadBooleanRespectsFreshness.types b/tests/baselines/reference/spreadBooleanRespectsFreshness.types index 3ccc42b24e3ce..09b488c73af59 100644 --- a/tests/baselines/reference/spreadBooleanRespectsFreshness.types +++ b/tests/baselines/reference/spreadBooleanRespectsFreshness.types @@ -22,9 +22,9 @@ foo1 = [...Array.isArray(foo2) ? foo2 : [foo2]]; >...Array.isArray(foo2) ? foo2 : [foo2] : FooBase >Array.isArray(foo2) ? foo2 : [foo2] : FooArray >Array.isArray(foo2) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >foo2 : Foo >foo2 : FooArray >[foo2] : FooBase[] diff --git a/tests/baselines/reference/spreadInvalidArgumentType.types b/tests/baselines/reference/spreadInvalidArgumentType.types index 7698e240abbc3..77c14bdb5d09c 100644 --- a/tests/baselines/reference/spreadInvalidArgumentType.types +++ b/tests/baselines/reference/spreadInvalidArgumentType.types @@ -73,8 +73,8 @@ function f(p1: T, p2: T[]) { >p1 : T var o2 = { ...p2 }; // OK ->o2 : { [x: number]: T; length: number; toString(): string; toLocaleString(): string; pop(): T; push(...items: T[]): number; concat(...items: ConcatArray[]): T[]; concat(...items: (T | ConcatArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; some(predicate: (value: T, index: number, array: T[]) => unknown, 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(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): 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): T; 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; } ->{ ...p2 } : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; pop(): T; push(...items: T[]): number; concat(...items: ConcatArray[]): T[]; concat(...items: (T | ConcatArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; some(predicate: (value: T, index: number, array: T[]) => unknown, 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(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): 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): T; 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; } +>o2 : { [x: number]: T; length: number; toString(): string; toLocaleString(): string; valueOf(): T[]; pop(): T; push(...items: T[]): number; concat(...items: ConcatArray[]): T[]; concat(...items: (T | ConcatArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; some(predicate: (value: T, index: number, array: T[]) => unknown, 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(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: T, index: number, array: T[]) => unknown, 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; } +>{ ...p2 } : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; valueOf(): T[]; pop(): T; push(...items: T[]): number; concat(...items: ConcatArray[]): T[]; concat(...items: (T | ConcatArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean; some(predicate: (value: T, index: number, array: T[]) => unknown, 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(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: T, index: number, array: T[]) => unknown, 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; } >p2 : T[] var o3 = { ...t }; // OK, generic type paramter diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt index b0137d9300be9..c569bdb829ac3 100644 --- a/tests/baselines/reference/strictBindCallApply1.errors.txt +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -1,11 +1,4 @@ -tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2769: No overload matches this call. - Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. - Argument of type 'number' is not assignable to parameter of type 'string'. - Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. - The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. - Types of parameters 'b' and 'args' are incompatible. - Type 'number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,35): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(17,15): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(18,35): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(19,44): error TS2554: Expected 3 arguments, but got 4. @@ -14,22 +7,12 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(22,32): error TS2345: tests/cases/conformance/functions/strictBindCallApply1.ts(23,37): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(24,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. Source has 3 element(s) but target allows only 2. -tests/cases/conformance/functions/strictBindCallApply1.ts(41,11): error TS2769: No overload matches this call. - Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. - Argument of type 'number' is not assignable to parameter of type 'string'. - Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. - The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. - Types of parameters 'b' and 'args' are incompatible. - Type 'number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/functions/strictBindCallApply1.ts(42,11): error TS2769: No overload matches this call. - Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,29): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,22): error TS2769: No overload matches this call. + Overload 1 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. + Argument of type 'undefined' is not assignable to parameter of type 'C'. + Overload 2 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. Argument of type 'undefined' is not assignable to parameter of type 'C'. - Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. - The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. - Types of parameters 'a' and 'args' are incompatible. - Type 'string | number' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. tests/cases/conformance/functions/strictBindCallApply1.ts(48,17): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(49,29): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(50,38): error TS2554: Expected 3 arguments, but got 4. @@ -40,16 +23,7 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(55,31): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(56,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. Source has 3 element(s) but target allows only 2. tests/cases/conformance/functions/strictBindCallApply1.ts(57,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. -tests/cases/conformance/functions/strictBindCallApply1.ts(62,11): error TS2769: No overload matches this call. - Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. - Argument of type 'number' is not assignable to parameter of type 'string'. - Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. - The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. - Types of construct signatures are incompatible. - Type 'new (a: number, b: string) => C' is not assignable to type 'new (...args: (10 | 20)[]) => C'. - Types of parameters 'b' and 'args' are incompatible. - Type 'number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(62,33): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(65,3): error TS2554: Expected 3 arguments, but got 2. tests/cases/conformance/functions/strictBindCallApply1.ts(66,15): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. tests/cases/conformance/functions/strictBindCallApply1.ts(67,24): error TS2554: Expected 3 arguments, but got 4. @@ -59,20 +33,20 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(71,17): error TS2322: tests/cases/conformance/functions/strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'. Source has 3 element(s) but target allows only 2. tests/cases/conformance/functions/strictBindCallApply1.ts(76,5): error TS2769: No overload matches this call. - Overload 1 of 6, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error. + Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error. Argument of type '2' is not assignable to parameter of type '1'. - Overload 2 of 6, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1, ...args: unknown[]): (...args: unknown[]) => void', gave the following error. + Overload 2 of 2, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1): (...args: unknown[]) => void', gave the following error. The 'this' context of type '(this: 1, ...args: T) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'. Types of parameters 'args' and 'args' are incompatible. Type 'unknown[]' is not assignable to type 'T'. 'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown[]'. tests/cases/conformance/functions/strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call. - Overload 1 of 6, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error. + Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error. Argument of type '2' is not assignable to parameter of type '1'. - Overload 2 of 6, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1, ...args: unknown[]): (...args: unknown[]) => void', gave the following error. - The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'. - Types of parameters 'args' and 'args' are incompatible. - Type 'unknown[]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'. + Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error. + The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, args_0: unknown) => void'. + Types of parameters 'args' and 'args_0' are incompatible. + Type '[unknown]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'. ==== tests/cases/conformance/functions/strictBindCallApply1.ts (26 errors) ==== @@ -87,15 +61,8 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(81,5): error TS2769: N let f01 = foo.bind(undefined, 10); let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 6, '(this: (this: undefined, arg0: 10, arg1: string) => string, thisArg: undefined, arg0: 10, arg1: string): () => string', gave the following error. -!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -!!! error TS2769: Overload 2 of 6, '(this: (this: undefined, ...args: (10 | 20)[]) => string, thisArg: undefined, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. -!!! error TS2769: The 'this' context of type '(a: number, b: string) => string' is not assignable to method's 'this' of type '(this: undefined, ...args: (10 | 20)[]) => string'. -!!! error TS2769: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2769: Type 'number' is not assignable to type 'string'. -!!! error TS2769: Type 'number' is not assignable to type 'string'. + ~~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. let f04 = overloaded.bind(undefined); // typeof overloaded let f05 = generic.bind(undefined); // typeof generic @@ -140,25 +107,15 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(81,5): error TS2769: N let f11 = c.foo.bind(c, 10); let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 6, '(this: (this: C, arg0: 10, arg1: string) => string, thisArg: C, arg0: 10, arg1: string): () => string', gave the following error. -!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -!!! error TS2769: Overload 2 of 6, '(this: (this: C, ...args: (10 | 20)[]) => string, thisArg: C, ...args: (10 | 20)[]): (...args: (10 | 20)[]) => string', gave the following error. -!!! error TS2769: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (10 | 20)[]) => string'. -!!! error TS2769: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2769: Type 'number' is not assignable to type 'string'. -!!! error TS2769: Type 'number' is not assignable to type 'string'. + ~~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. let f14 = c.foo.bind(undefined); // Error - ~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 6, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +!!! error TS2769: Overload 1 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. +!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'. +!!! error TS2769: Overload 2 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error. !!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'. -!!! error TS2769: Overload 2 of 6, '(this: (this: C, ...args: (string | number)[]) => string, thisArg: C, ...args: (string | number)[]): (...args: (string | number)[]) => string', gave the following error. -!!! error TS2769: The 'this' context of type '(this: C, a: number, b: string) => string' is not assignable to method's 'this' of type '(this: C, ...args: (string | number)[]) => string'. -!!! error TS2769: Types of parameters 'a' and 'args' are incompatible. -!!! error TS2769: Type 'string | number' is not assignable to type 'number'. -!!! error TS2769: Type 'string' is not assignable to type 'number'. let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded let f16 = c.generic.bind(c); // typeof C.prototype.generic @@ -197,17 +154,8 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(81,5): error TS2769: N let f21 = C.bind(undefined, 10); let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 6, '(this: new (arg0: 10, arg1: string) => C, thisArg: any, arg0: 10, arg1: string): new () => C', gave the following error. -!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'string'. -!!! error TS2769: Overload 2 of 6, '(this: new (...args: (10 | 20)[]) => C, thisArg: any, ...args: (10 | 20)[]): new (...args: (10 | 20)[]) => C', gave the following error. -!!! error TS2769: The 'this' context of type 'typeof C' is not assignable to method's 'this' of type 'new (...args: (10 | 20)[]) => C'. -!!! error TS2769: Types of construct signatures are incompatible. -!!! error TS2769: Type 'new (a: number, b: string) => C' is not assignable to type 'new (...args: (10 | 20)[]) => C'. -!!! error TS2769: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2769: Type 'number' is not assignable to type 'string'. -!!! error TS2769: Type 'number' is not assignable to type 'string'. + ~~ +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. C.call(c, 10, "hello"); C.call(c, 10); // Error @@ -238,9 +186,9 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(81,5): error TS2769: N callback.bind(2); // Error ~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 6, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error. +!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error. !!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'. -!!! error TS2769: Overload 2 of 6, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1, ...args: unknown[]): (...args: unknown[]) => void', gave the following error. +!!! error TS2769: Overload 2 of 2, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1): (...args: unknown[]) => void', gave the following error. !!! error TS2769: The 'this' context of type '(this: 1, ...args: T) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'. !!! error TS2769: Types of parameters 'args' and 'args' are incompatible. !!! error TS2769: Type 'unknown[]' is not assignable to type 'T'. @@ -252,12 +200,12 @@ tests/cases/conformance/functions/strictBindCallApply1.ts(81,5): error TS2769: N callback.bind(2); // Error ~~~~~~~~~~~~~~~~ !!! error TS2769: No overload matches this call. -!!! error TS2769: Overload 1 of 6, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error. +!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error. !!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'. -!!! error TS2769: Overload 2 of 6, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1, ...args: unknown[]): (...args: unknown[]) => void', gave the following error. -!!! error TS2769: The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'. -!!! error TS2769: Types of parameters 'args' and 'args' are incompatible. -!!! error TS2769: Type 'unknown[]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'. +!!! error TS2769: Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error. +!!! error TS2769: The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, args_0: unknown) => void'. +!!! error TS2769: Types of parameters 'args' and 'args_0' are incompatible. +!!! error TS2769: Type '[unknown]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'. } // Repro from #32964 diff --git a/tests/baselines/reference/strictBindCallApply1.symbols b/tests/baselines/reference/strictBindCallApply1.symbols index b35c0e19a082d..76a01f2008357 100644 --- a/tests/baselines/reference/strictBindCallApply1.symbols +++ b/tests/baselines/reference/strictBindCallApply1.symbols @@ -21,44 +21,44 @@ declare function generic(x: T): T; let f00 = foo.bind(undefined); >f00 : Symbol(f00, Decl(strictBindCallApply1.ts, 7, 3)) ->foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f01 = foo.bind(undefined, 10); >f01 : Symbol(f01, Decl(strictBindCallApply1.ts, 8, 3)) ->foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f02 = foo.bind(undefined, 10, "hello"); >f02 : Symbol(f02, Decl(strictBindCallApply1.ts, 9, 3)) ->foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f03 = foo.bind(undefined, 10, 20); // Error >f03 : Symbol(f03, Decl(strictBindCallApply1.ts, 10, 3)) ->foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f04 = overloaded.bind(undefined); // typeof overloaded >f04 : Symbol(f04, Decl(strictBindCallApply1.ts, 12, 3)) ->overloaded.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>overloaded.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >overloaded : Symbol(overloaded, Decl(strictBindCallApply1.ts, 0, 51), Decl(strictBindCallApply1.ts, 2, 47)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f05 = generic.bind(undefined); // typeof generic >f05 : Symbol(f05, Decl(strictBindCallApply1.ts, 13, 3)) ->generic.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>generic.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >generic : Symbol(generic, Decl(strictBindCallApply1.ts, 3, 47)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let c00 = foo.call(undefined, 10, "hello"); @@ -161,65 +161,65 @@ declare let obj: {}; let f10 = c.foo.bind(c); >f10 : Symbol(f10, Decl(strictBindCallApply1.ts, 37, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let f11 = c.foo.bind(c, 10); >f11 : Symbol(f11, Decl(strictBindCallApply1.ts, 38, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let f12 = c.foo.bind(c, 10, "hello"); >f12 : Symbol(f12, Decl(strictBindCallApply1.ts, 39, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let f13 = c.foo.bind(c, 10, 20); // Error >f13 : Symbol(f13, Decl(strictBindCallApply1.ts, 40, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let f14 = c.foo.bind(undefined); // Error >f14 : Symbol(f14, Decl(strictBindCallApply1.ts, 41, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 26, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded >f15 : Symbol(f15, Decl(strictBindCallApply1.ts, 43, 3)) ->c.overloaded.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c.overloaded.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c.overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) >overloaded : Symbol(C.overloaded, Decl(strictBindCallApply1.ts, 27, 63), Decl(strictBindCallApply1.ts, 28, 34), Decl(strictBindCallApply1.ts, 29, 34)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let f16 = c.generic.bind(c); // typeof C.prototype.generic >f16 : Symbol(f16, Decl(strictBindCallApply1.ts, 44, 3)) ->c.generic.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>c.generic.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c.generic : Symbol(C.generic, Decl(strictBindCallApply1.ts, 30, 53)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) >generic : Symbol(C.generic, Decl(strictBindCallApply1.ts, 30, 53)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 34, 11)) let c10 = c.foo.call(c, 10, "hello"); @@ -314,30 +314,30 @@ let a14 = c.foo.apply(undefined, [10, "hello"]); // Error let f20 = C.bind(undefined); >f20 : Symbol(f20, Decl(strictBindCallApply1.ts, 58, 3)) ->C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) ->bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f21 = C.bind(undefined, 10); >f21 : Symbol(f21, Decl(strictBindCallApply1.ts, 59, 3)) ->C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) ->bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f22 = C.bind(undefined, 10, "hello"); >f22 : Symbol(f22, Decl(strictBindCallApply1.ts, 60, 3)) ->C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) ->bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) let f23 = C.bind(undefined, 10, 20); // Error >f23 : Symbol(f23, Decl(strictBindCallApply1.ts, 61, 3)) ->C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >C : Symbol(C, Decl(strictBindCallApply1.ts, 23, 50)) ->bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >undefined : Symbol(undefined) C.call(c, 10, "hello"); @@ -397,14 +397,14 @@ function bar(callback: (this: 1, ...args: T) => void) { >T : Symbol(T, Decl(strictBindCallApply1.ts, 73, 13)) callback.bind(1); ->callback.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>callback.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >callback : Symbol(callback, Decl(strictBindCallApply1.ts, 73, 34)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) callback.bind(2); // Error ->callback.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>callback.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >callback : Symbol(callback, Decl(strictBindCallApply1.ts, 73, 34)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } function baz(callback: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void) { @@ -416,14 +416,14 @@ function baz(callback: (this: 1, ...args: T extends 1 ? [unknow >T : Symbol(T, Decl(strictBindCallApply1.ts, 78, 13)) callback.bind(1); ->callback.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>callback.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >callback : Symbol(callback, Decl(strictBindCallApply1.ts, 78, 30)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) callback.bind(2); // Error ->callback.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>callback.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >callback : Symbol(callback, Decl(strictBindCallApply1.ts, 78, 30)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } // Repro from #32964 @@ -433,11 +433,11 @@ class Foo { constructor() { this.fn.bind(this); ->this.fn.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>this.fn.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this.fn : Symbol(Foo.fn, Decl(strictBindCallApply1.ts, 87, 5)) >this : Symbol(Foo, Decl(strictBindCallApply1.ts, 81, 1)) >fn : Symbol(Foo.fn, Decl(strictBindCallApply1.ts, 87, 5)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this : Symbol(Foo, Decl(strictBindCallApply1.ts, 81, 1)) } @@ -453,11 +453,11 @@ class Bar { constructor() { this.fn.bind(this); ->this.fn.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>this.fn.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this.fn : Symbol(Bar.fn, Decl(strictBindCallApply1.ts, 95, 5)) >this : Symbol(Bar, Decl(strictBindCallApply1.ts, 90, 1)) >fn : Symbol(Bar.fn, Decl(strictBindCallApply1.ts, 95, 5)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this : Symbol(Bar, Decl(strictBindCallApply1.ts, 90, 1)) } diff --git a/tests/baselines/reference/strictBindCallApply1.types b/tests/baselines/reference/strictBindCallApply1.types index e401d684492e2..fb28579f72853 100644 --- a/tests/baselines/reference/strictBindCallApply1.types +++ b/tests/baselines/reference/strictBindCallApply1.types @@ -19,26 +19,26 @@ declare function generic(x: T): T; let f00 = foo.bind(undefined); >f00 : (a: number, b: string) => string >foo.bind(undefined) : (a: number, b: string) => string ->foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >foo : (a: number, b: string) => string ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >undefined : undefined let f01 = foo.bind(undefined, 10); >f01 : (b: string) => string >foo.bind(undefined, 10) : (b: string) => string ->foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >foo : (a: number, b: string) => string ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >undefined : undefined >10 : 10 let f02 = foo.bind(undefined, 10, "hello"); >f02 : () => string >foo.bind(undefined, 10, "hello") : () => string ->foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >foo : (a: number, b: string) => string ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >undefined : undefined >10 : 10 >"hello" : "hello" @@ -46,9 +46,9 @@ let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error >f03 : () => string >foo.bind(undefined, 10, 20) : () => string ->foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >foo : (a: number, b: string) => string ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >undefined : undefined >10 : 10 >20 : 20 @@ -56,17 +56,17 @@ let f03 = foo.bind(undefined, 10, 20); // Error let f04 = overloaded.bind(undefined); // typeof overloaded >f04 : { (s: string): number; (n: number): string; } >overloaded.bind(undefined) : { (s: string): number; (n: number): string; } ->overloaded.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>overloaded.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >overloaded : { (s: string): number; (n: number): string; } ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >undefined : undefined let f05 = generic.bind(undefined); // typeof generic >f05 : (x: T) => T >generic.bind(undefined) : (x: T) => T ->generic.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>generic.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >generic : (x: T) => T ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >undefined : undefined let c00 = foo.call(undefined, 10, "hello"); @@ -196,32 +196,32 @@ declare let obj: {}; let f10 = c.foo.bind(c); >f10 : (a: number, b: string) => string >c.foo.bind(c) : (a: number, b: string) => string ->c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c : C let f11 = c.foo.bind(c, 10); >f11 : (b: string) => string >c.foo.bind(c, 10) : (b: string) => string ->c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c : C >10 : 10 let f12 = c.foo.bind(c, 10, "hello"); >f12 : () => string >c.foo.bind(c, 10, "hello") : () => string ->c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c : C >10 : 10 >"hello" : "hello" @@ -229,11 +229,11 @@ let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error >f13 : () => string >c.foo.bind(c, 10, 20) : () => string ->c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c : C >10 : 10 >20 : 20 @@ -241,31 +241,31 @@ let f13 = c.foo.bind(c, 10, 20); // Error let f14 = c.foo.bind(undefined); // Error >f14 : (a: number, b: string) => string >c.foo.bind(undefined) : (a: number, b: string) => string ->c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.foo.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >undefined : undefined let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded >f15 : { (s: string): number; (n: number): string; } >c.overloaded.bind(c) : { (s: string): number; (n: number): string; } ->c.overloaded.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.overloaded.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c.overloaded : { (s: string): number; (n: number): string; } >c : C >overloaded : { (s: string): number; (n: number): string; } ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c : C let f16 = c.generic.bind(c); // typeof C.prototype.generic >f16 : (x: T) => T >c.generic.bind(c) : (x: T) => T ->c.generic.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>c.generic.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c.generic : (x: T) => T >c : C >generic : (x: T) => T ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >c : C let c10 = c.foo.call(c, 10, "hello"); @@ -396,26 +396,26 @@ let a14 = c.foo.apply(undefined, [10, "hello"]); // Error let f20 = C.bind(undefined); >f20 : typeof C >C.bind(undefined) : typeof C ->C.bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>C.bind : { (this: T, thisArg: any): T; (this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R; } >C : typeof C ->bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>bind : { (this: T, thisArg: any): T; (this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R; } >undefined : undefined let f21 = C.bind(undefined, 10); >f21 : new (b: string) => C >C.bind(undefined, 10) : new (b: string) => C ->C.bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>C.bind : { (this: T, thisArg: any): T; (this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R; } >C : typeof C ->bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>bind : { (this: T, thisArg: any): T; (this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R; } >undefined : undefined >10 : 10 let f22 = C.bind(undefined, 10, "hello"); >f22 : new () => C >C.bind(undefined, 10, "hello") : new () => C ->C.bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>C.bind : { (this: T, thisArg: any): T; (this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R; } >C : typeof C ->bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>bind : { (this: T, thisArg: any): T; (this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R; } >undefined : undefined >10 : 10 >"hello" : "hello" @@ -423,9 +423,9 @@ let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error >f23 : new () => C >C.bind(undefined, 10, 20) : new () => C ->C.bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>C.bind : { (this: T, thisArg: any): T; (this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R; } >C : typeof C ->bind : { (this: T, thisArg: any): T; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } +>bind : { (this: T, thisArg: any): T; (this: new (...args: [...A, ...B]) => R, thisArg: any, ...args: A): new (...args: B) => R; } >undefined : undefined >10 : 10 >20 : 20 @@ -514,16 +514,16 @@ function bar(callback: (this: 1, ...args: T) => void) { callback.bind(1); >callback.bind(1) : (...args: T) => void ->callback.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>callback.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >callback : (this: 1, ...args: T) => void ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >1 : 1 callback.bind(2); // Error >callback.bind(2) : (...args: T) => void ->callback.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>callback.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >callback : (this: 1, ...args: T) => void ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >2 : 2 } @@ -535,16 +535,16 @@ function baz(callback: (this: 1, ...args: T extends 1 ? [unknow callback.bind(1); >callback.bind(1) : (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void ->callback.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>callback.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >callback : (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >1 : 1 callback.bind(2); // Error >callback.bind(2) : (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void ->callback.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>callback.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >callback : (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >2 : 2 } @@ -555,11 +555,11 @@ class Foo { constructor() { this.fn.bind(this); >this.fn.bind(this) : (...args: T) => void ->this.fn.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>this.fn.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >this.fn : (...args: T) => void >this : this >fn : (...args: T) => void ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >this : this } @@ -574,11 +574,11 @@ class Bar { constructor() { this.fn.bind(this); >this.fn.bind(this) : (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void ->this.fn.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>this.fn.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >this.fn : (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void >this : this >fn : (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >this : this } diff --git a/tests/baselines/reference/strictBindCallApply2.symbols b/tests/baselines/reference/strictBindCallApply2.symbols index 015a796fb5186..213ef3e46622e 100644 --- a/tests/baselines/reference/strictBindCallApply2.symbols +++ b/tests/baselines/reference/strictBindCallApply2.symbols @@ -17,8 +17,8 @@ type Test = ThisParameterType; const fb = fn.bind({ blub: "blub" }); >fb : Symbol(fb, Decl(strictBindCallApply2.ts, 7, 5)) ->fn.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>fn.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >fn : Symbol(fn, Decl(strictBindCallApply2.ts, 2, 31)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >blub : Symbol(blub, Decl(strictBindCallApply2.ts, 7, 20)) diff --git a/tests/baselines/reference/strictBindCallApply2.types b/tests/baselines/reference/strictBindCallApply2.types index 6abb106e66b2f..29f52b62bd952 100644 --- a/tests/baselines/reference/strictBindCallApply2.types +++ b/tests/baselines/reference/strictBindCallApply2.types @@ -15,9 +15,9 @@ type Test = ThisParameterType; const fb = fn.bind({ blub: "blub" }); >fb : () => void >fn.bind({ blub: "blub" }) : () => void ->fn.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>fn.bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >fn : (this: Foo) => void ->bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } +>bind : { (this: T, thisArg: ThisParameterType): OmitThisParameter; (this: (this: T, ...args: [...A, ...B]) => R, thisArg: T, ...args: A): (...args: B) => R; } >{ blub: "blub" } : { blub: string; } >blub : string >"blub" : "blub" diff --git a/tests/baselines/reference/thisInFunctionCall.types b/tests/baselines/reference/thisInFunctionCall.types index 4b5455d4d15f9..d60b4f4cc70c1 100644 --- a/tests/baselines/reference/thisInFunctionCall.types +++ b/tests/baselines/reference/thisInFunctionCall.types @@ -22,11 +22,11 @@ class Test { this.data.find(function (d) { >this.data.find(function (d) { return d === this.data.length }) : number ->this.data.find : { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; } +>this.data.find : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; } >this.data : number[] >this : this >data : number[] ->find : { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; } +>find : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; } >function (d) { return d === this.data.length } : (d: number) => boolean >d : number @@ -109,11 +109,11 @@ class Test { this.data.find( >this.data.find( /** @this {Test} */ function (d) { return d === this.data.length }, this) : number ->this.data.find : { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; } +>this.data.find : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; } >this.data : number[] >this : this >data : number[] ->find : { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; } +>find : { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number; } /** @this {Test} */ function (d) { diff --git a/tests/baselines/reference/typedArrays.symbols b/tests/baselines/reference/typedArrays.symbols index fb6457929e4b2..23c24f3e22d84 100644 --- a/tests/baselines/reference/typedArrays.symbols +++ b/tests/baselines/reference/typedArrays.symbols @@ -166,65 +166,65 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { typedArrays[0] = Int8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[1] = Uint8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[2] = Int16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[3] = Uint16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[4] = Int32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[5] = Uint32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[6] = Float32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[7] = Float64Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[8] = Uint8ClampedArray.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) return typedArrays; @@ -241,65 +241,65 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { typedArrays[0] = Int8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[1] = Uint8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[2] = Int16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[3] = Uint16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[4] = Int32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[5] = Uint32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[6] = Float32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[7] = Float64Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[8] = Uint8ClampedArray.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) return typedArrays; @@ -460,73 +460,73 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) typedArrays[0] = Int8Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 40)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 57)) typedArrays[1] = Uint8Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 40)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 57)) typedArrays[2] = Int16Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 40)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 57)) typedArrays[3] = Uint16Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 40)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 57)) typedArrays[4] = Int32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 40)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 57)) typedArrays[5] = Uint32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 40)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 57)) typedArrays[6] = Float32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 40)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 57)) typedArrays[7] = Float64Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 40)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 57)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 40)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 57)) @@ -547,73 +547,73 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n typedArrays[0] = Int8Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 58)) typedArrays[1] = Uint8Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 58)) typedArrays[2] = Int16Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 58)) typedArrays[3] = Uint16Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 58)) typedArrays[4] = Int32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 58)) typedArrays[5] = Uint32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 58)) typedArrays[6] = Float32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 58)) typedArrays[7] = Float64Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 58)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 58)) @@ -635,81 +635,81 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v typedArrays[0] = Int8Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 136, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 135, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 135, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 135, 98)) typedArrays[1] = Uint8Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 136, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 135, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 135, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 135, 98)) typedArrays[2] = Int16Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 136, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 135, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 135, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 135, 98)) typedArrays[3] = Uint16Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 136, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 135, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 135, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 135, 98)) typedArrays[4] = Int32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 136, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 135, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 135, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 135, 98)) typedArrays[5] = Uint32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 136, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 135, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 135, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 135, 98)) typedArrays[6] = Float32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 136, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 135, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 135, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 135, 98)) typedArrays[7] = Float64Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 136, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 135, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 135, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 135, 98)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 136, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 135, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 135, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 135, 98)) @@ -735,81 +735,81 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe typedArrays[0] = Int8Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 151, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 150, 42)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 150, 59)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 150, 92)) typedArrays[1] = Uint8Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 151, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 150, 42)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 150, 59)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 150, 92)) typedArrays[2] = Int16Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 151, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 150, 42)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 150, 59)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 150, 92)) typedArrays[3] = Uint16Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 151, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 150, 42)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 150, 59)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 150, 92)) typedArrays[4] = Int32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 151, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 150, 42)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 150, 59)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 150, 92)) typedArrays[5] = Uint32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 151, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 150, 42)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 150, 59)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 150, 92)) typedArrays[6] = Float32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 151, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 150, 42)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 150, 59)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 150, 92)) typedArrays[7] = Float64Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 151, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 150, 42)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 150, 59)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 150, 92)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 151, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 150, 42)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 150, 59)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 150, 92)) diff --git a/tests/baselines/reference/typedArrays.types b/tests/baselines/reference/typedArrays.types index 5cd4879be7e66..004557862b1d2 100644 --- a/tests/baselines/reference/typedArrays.types +++ b/tests/baselines/reference/typedArrays.types @@ -273,9 +273,9 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays : any[] >0 : 0 >Int8Array.from(obj) : Int8Array ->Int8Array.from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>Int8Array.from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor ->from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >obj : number[] typedArrays[1] = Uint8Array.from(obj); @@ -284,9 +284,9 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays : any[] >1 : 1 >Uint8Array.from(obj) : Uint8Array ->Uint8Array.from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>Uint8Array.from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >obj : number[] typedArrays[2] = Int16Array.from(obj); @@ -295,9 +295,9 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays : any[] >2 : 2 >Int16Array.from(obj) : Int16Array ->Int16Array.from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>Int16Array.from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor ->from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >obj : number[] typedArrays[3] = Uint16Array.from(obj); @@ -306,9 +306,9 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays : any[] >3 : 3 >Uint16Array.from(obj) : Uint16Array ->Uint16Array.from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>Uint16Array.from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >obj : number[] typedArrays[4] = Int32Array.from(obj); @@ -317,9 +317,9 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays : any[] >4 : 4 >Int32Array.from(obj) : Int32Array ->Int32Array.from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>Int32Array.from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor ->from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >obj : number[] typedArrays[5] = Uint32Array.from(obj); @@ -328,9 +328,9 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays : any[] >5 : 5 >Uint32Array.from(obj) : Uint32Array ->Uint32Array.from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>Uint32Array.from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >obj : number[] typedArrays[6] = Float32Array.from(obj); @@ -339,9 +339,9 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays : any[] >6 : 6 >Float32Array.from(obj) : Float32Array ->Float32Array.from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>Float32Array.from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor ->from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >obj : number[] typedArrays[7] = Float64Array.from(obj); @@ -350,9 +350,9 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays : any[] >7 : 7 >Float64Array.from(obj) : Float64Array ->Float64Array.from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>Float64Array.from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor ->from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >obj : number[] typedArrays[8] = Uint8ClampedArray.from(obj); @@ -361,9 +361,9 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { >typedArrays : any[] >8 : 8 >Uint8ClampedArray.from(obj) : Uint8ClampedArray ->Uint8ClampedArray.from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>Uint8ClampedArray.from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >obj : number[] return typedArrays; @@ -384,9 +384,9 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] >0 : 0 >Int8Array.from(obj) : Int8Array ->Int8Array.from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>Int8Array.from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor ->from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >obj : ArrayLike typedArrays[1] = Uint8Array.from(obj); @@ -395,9 +395,9 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] >1 : 1 >Uint8Array.from(obj) : Uint8Array ->Uint8Array.from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>Uint8Array.from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >obj : ArrayLike typedArrays[2] = Int16Array.from(obj); @@ -406,9 +406,9 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] >2 : 2 >Int16Array.from(obj) : Int16Array ->Int16Array.from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>Int16Array.from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor ->from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >obj : ArrayLike typedArrays[3] = Uint16Array.from(obj); @@ -417,9 +417,9 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] >3 : 3 >Uint16Array.from(obj) : Uint16Array ->Uint16Array.from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>Uint16Array.from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >obj : ArrayLike typedArrays[4] = Int32Array.from(obj); @@ -428,9 +428,9 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] >4 : 4 >Int32Array.from(obj) : Int32Array ->Int32Array.from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>Int32Array.from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor ->from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >obj : ArrayLike typedArrays[5] = Uint32Array.from(obj); @@ -439,9 +439,9 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] >5 : 5 >Uint32Array.from(obj) : Uint32Array ->Uint32Array.from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>Uint32Array.from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >obj : ArrayLike typedArrays[6] = Float32Array.from(obj); @@ -450,9 +450,9 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] >6 : 6 >Float32Array.from(obj) : Float32Array ->Float32Array.from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>Float32Array.from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor ->from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >obj : ArrayLike typedArrays[7] = Float64Array.from(obj); @@ -461,9 +461,9 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] >7 : 7 >Float64Array.from(obj) : Float64Array ->Float64Array.from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>Float64Array.from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor ->from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >obj : ArrayLike typedArrays[8] = Uint8ClampedArray.from(obj); @@ -472,9 +472,9 @@ function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >typedArrays : any[] >8 : 8 >Uint8ClampedArray.from(obj) : Uint8ClampedArray ->Uint8ClampedArray.from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>Uint8ClampedArray.from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >obj : ArrayLike return typedArrays; @@ -755,9 +755,9 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) >typedArrays : any[] >0 : 0 >Int8Array.from(obj, mapFn) : Int8Array ->Int8Array.from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>Int8Array.from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor ->from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number @@ -767,9 +767,9 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) >typedArrays : any[] >1 : 1 >Uint8Array.from(obj, mapFn) : Uint8Array ->Uint8Array.from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>Uint8Array.from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number @@ -779,9 +779,9 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) >typedArrays : any[] >2 : 2 >Int16Array.from(obj, mapFn) : Int16Array ->Int16Array.from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>Int16Array.from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor ->from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number @@ -791,9 +791,9 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) >typedArrays : any[] >3 : 3 >Uint16Array.from(obj, mapFn) : Uint16Array ->Uint16Array.from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>Uint16Array.from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number @@ -803,9 +803,9 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) >typedArrays : any[] >4 : 4 >Int32Array.from(obj, mapFn) : Int32Array ->Int32Array.from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>Int32Array.from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor ->from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number @@ -815,9 +815,9 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) >typedArrays : any[] >5 : 5 >Uint32Array.from(obj, mapFn) : Uint32Array ->Uint32Array.from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>Uint32Array.from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number @@ -827,9 +827,9 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) >typedArrays : any[] >6 : 6 >Float32Array.from(obj, mapFn) : Float32Array ->Float32Array.from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>Float32Array.from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor ->from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number @@ -839,9 +839,9 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) >typedArrays : any[] >7 : 7 >Float64Array.from(obj, mapFn) : Float64Array ->Float64Array.from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>Float64Array.from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor ->from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number @@ -851,9 +851,9 @@ function CreateTypedArraysFromMapFn2(obj:ArrayLike, mapFn: (n:T, v:number) >typedArrays : any[] >8 : 8 >Uint8ClampedArray.from(obj, mapFn) : Uint8ClampedArray ->Uint8ClampedArray.from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>Uint8ClampedArray.from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >obj : ArrayLike >mapFn : (n: T, v: number) => number @@ -878,9 +878,9 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays : any[] >0 : 0 >Int8Array.from(obj, mapFn) : Int8Array ->Int8Array.from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>Int8Array.from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor ->from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number @@ -890,9 +890,9 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays : any[] >1 : 1 >Uint8Array.from(obj, mapFn) : Uint8Array ->Uint8Array.from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>Uint8Array.from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number @@ -902,9 +902,9 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays : any[] >2 : 2 >Int16Array.from(obj, mapFn) : Int16Array ->Int16Array.from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>Int16Array.from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor ->from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number @@ -914,9 +914,9 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays : any[] >3 : 3 >Uint16Array.from(obj, mapFn) : Uint16Array ->Uint16Array.from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>Uint16Array.from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number @@ -926,9 +926,9 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays : any[] >4 : 4 >Int32Array.from(obj, mapFn) : Int32Array ->Int32Array.from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>Int32Array.from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor ->from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number @@ -938,9 +938,9 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays : any[] >5 : 5 >Uint32Array.from(obj, mapFn) : Uint32Array ->Uint32Array.from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>Uint32Array.from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number @@ -950,9 +950,9 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays : any[] >6 : 6 >Float32Array.from(obj, mapFn) : Float32Array ->Float32Array.from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>Float32Array.from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor ->from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number @@ -962,9 +962,9 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays : any[] >7 : 7 >Float64Array.from(obj, mapFn) : Float64Array ->Float64Array.from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>Float64Array.from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor ->from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number @@ -974,9 +974,9 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n >typedArrays : any[] >8 : 8 >Uint8ClampedArray.from(obj, mapFn) : Uint8ClampedArray ->Uint8ClampedArray.from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>Uint8ClampedArray.from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >obj : ArrayLike >mapFn : (n: number, v: number) => number @@ -1002,9 +1002,9 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays : any[] >0 : 0 >Int8Array.from(obj, mapFn, thisArg) : Int8Array ->Int8Array.from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>Int8Array.from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor ->from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number >thisArg : {} @@ -1015,9 +1015,9 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays : any[] >1 : 1 >Uint8Array.from(obj, mapFn, thisArg) : Uint8Array ->Uint8Array.from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>Uint8Array.from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number >thisArg : {} @@ -1028,9 +1028,9 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays : any[] >2 : 2 >Int16Array.from(obj, mapFn, thisArg) : Int16Array ->Int16Array.from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>Int16Array.from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor ->from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number >thisArg : {} @@ -1041,9 +1041,9 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays : any[] >3 : 3 >Uint16Array.from(obj, mapFn, thisArg) : Uint16Array ->Uint16Array.from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>Uint16Array.from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number >thisArg : {} @@ -1054,9 +1054,9 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays : any[] >4 : 4 >Int32Array.from(obj, mapFn, thisArg) : Int32Array ->Int32Array.from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>Int32Array.from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor ->from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number >thisArg : {} @@ -1067,9 +1067,9 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays : any[] >5 : 5 >Uint32Array.from(obj, mapFn, thisArg) : Uint32Array ->Uint32Array.from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>Uint32Array.from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number >thisArg : {} @@ -1080,9 +1080,9 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays : any[] >6 : 6 >Float32Array.from(obj, mapFn, thisArg) : Float32Array ->Float32Array.from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>Float32Array.from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor ->from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number >thisArg : {} @@ -1093,9 +1093,9 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays : any[] >7 : 7 >Float64Array.from(obj, mapFn, thisArg) : Float64Array ->Float64Array.from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>Float64Array.from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor ->from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >obj : ArrayLike >mapFn : (n: number, v: number) => number >thisArg : {} @@ -1106,9 +1106,9 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v >typedArrays : any[] >8 : 8 >Uint8ClampedArray.from(obj, mapFn, thisArg) : Uint8ClampedArray ->Uint8ClampedArray.from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>Uint8ClampedArray.from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >obj : ArrayLike >mapFn : (n: number, v: number) => number >thisArg : {} @@ -1135,9 +1135,9 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe >typedArrays : any[] >0 : 0 >Int8Array.from(obj, mapFn, thisArg) : Int8Array ->Int8Array.from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>Int8Array.from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >Int8Array : Int8ArrayConstructor ->from : { (arrayLike: ArrayLike): Int8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array; } +>from : { (source: ArrayLikeOrIterable): Int8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number >thisArg : {} @@ -1148,9 +1148,9 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe >typedArrays : any[] >1 : 1 >Uint8Array.from(obj, mapFn, thisArg) : Uint8Array ->Uint8Array.from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>Uint8Array.from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >Uint8Array : Uint8ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array; } +>from : { (source: ArrayLikeOrIterable): Uint8Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number >thisArg : {} @@ -1161,9 +1161,9 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe >typedArrays : any[] >2 : 2 >Int16Array.from(obj, mapFn, thisArg) : Int16Array ->Int16Array.from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>Int16Array.from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >Int16Array : Int16ArrayConstructor ->from : { (arrayLike: ArrayLike): Int16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array; } +>from : { (source: ArrayLikeOrIterable): Int16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number >thisArg : {} @@ -1174,9 +1174,9 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe >typedArrays : any[] >3 : 3 >Uint16Array.from(obj, mapFn, thisArg) : Uint16Array ->Uint16Array.from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>Uint16Array.from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >Uint16Array : Uint16ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint16Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array; } +>from : { (source: ArrayLikeOrIterable): Uint16Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number >thisArg : {} @@ -1187,9 +1187,9 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe >typedArrays : any[] >4 : 4 >Int32Array.from(obj, mapFn, thisArg) : Int32Array ->Int32Array.from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>Int32Array.from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >Int32Array : Int32ArrayConstructor ->from : { (arrayLike: ArrayLike): Int32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array; } +>from : { (source: ArrayLikeOrIterable): Int32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number >thisArg : {} @@ -1200,9 +1200,9 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe >typedArrays : any[] >5 : 5 >Uint32Array.from(obj, mapFn, thisArg) : Uint32Array ->Uint32Array.from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>Uint32Array.from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >Uint32Array : Uint32ArrayConstructor ->from : { (arrayLike: ArrayLike): Uint32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array; } +>from : { (source: ArrayLikeOrIterable): Uint32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number >thisArg : {} @@ -1213,9 +1213,9 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe >typedArrays : any[] >6 : 6 >Float32Array.from(obj, mapFn, thisArg) : Float32Array ->Float32Array.from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>Float32Array.from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >Float32Array : Float32ArrayConstructor ->from : { (arrayLike: ArrayLike): Float32Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array; } +>from : { (source: ArrayLikeOrIterable): Float32Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number >thisArg : {} @@ -1226,9 +1226,9 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe >typedArrays : any[] >7 : 7 >Float64Array.from(obj, mapFn, thisArg) : Float64Array ->Float64Array.from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>Float64Array.from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >Float64Array : Float64ArrayConstructor ->from : { (arrayLike: ArrayLike): Float64Array; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array; } +>from : { (source: ArrayLikeOrIterable): Float64Array; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array; } >obj : ArrayLike >mapFn : (n: T, v: number) => number >thisArg : {} @@ -1239,9 +1239,9 @@ function CreateTypedArraysFromThisObj2(obj:ArrayLike, mapFn: (n:T, v:numbe >typedArrays : any[] >8 : 8 >Uint8ClampedArray.from(obj, mapFn, thisArg) : Uint8ClampedArray ->Uint8ClampedArray.from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>Uint8ClampedArray.from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >Uint8ClampedArray : Uint8ClampedArrayConstructor ->from : { (arrayLike: ArrayLike): Uint8ClampedArray; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; (arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray; } +>from : { (source: ArrayLikeOrIterable): Uint8ClampedArray; (source: ArrayLikeOrIterable, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray; } >obj : ArrayLike >mapFn : (n: T, v: number) => number >thisArg : {} diff --git a/tests/baselines/reference/unionAndIntersectionInference1.symbols b/tests/baselines/reference/unionAndIntersectionInference1.symbols index 815e70ddce106..c3591912e67e4 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.symbols +++ b/tests/baselines/reference/unionAndIntersectionInference1.symbols @@ -272,9 +272,9 @@ const assign = (a: T, b: U) => Object.assign(a, b); >T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 94, 16)) >b : Symbol(b, Decl(unionAndIntersectionInference1.ts, 94, 27)) >U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 94, 18)) ->Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object.assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>assign : Symbol(ObjectConstructor.assign, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >a : Symbol(a, Decl(unionAndIntersectionInference1.ts, 94, 22)) >b : Symbol(b, Decl(unionAndIntersectionInference1.ts, 94, 27)) diff --git a/tests/baselines/reference/unionAndIntersectionInference1.types b/tests/baselines/reference/unionAndIntersectionInference1.types index ec56cbbd1c4ac..3979a3a7bdb9f 100644 --- a/tests/baselines/reference/unionAndIntersectionInference1.types +++ b/tests/baselines/reference/unionAndIntersectionInference1.types @@ -241,22 +241,22 @@ const func = () => {}; >() => {} : () => void const assign = (a: T, b: U) => Object.assign(a, b); ->assign : (a: T, b: U) => T & U ->(a: T, b: U) => Object.assign(a, b) : (a: T, b: U) => T & U +>assign : (a: T, b: U) => T & Writable +>(a: T, b: U) => Object.assign(a, b) : (a: T, b: U) => T & Writable >a : T >b : U ->Object.assign(a, b) : T & U ->Object.assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>Object.assign(a, b) : T & Writable +>Object.assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >Object : ObjectConstructor ->assign : { (target: T, source: U): T & U; (target: T, source1: U, source2: V): T & U & V; (target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; } +>assign : { (target: T): T; (target: T, source: U): T & Writable; (target: T, source1: U, source2: V): T & Writable & Writable; (target: T, source1: U, source2: V, source3: W): T & Writable & Writable & Writable; (target: {}, ...sources: any[]): any; } >a : T >b : U const res: (() => void) & { func: any } = assign(() => {}, { func }); >res : (() => void) & { func: any; } >func : any ->assign(() => {}, { func }) : (() => void) & { func: () => void; } ->assign : (a: T, b: U) => T & U +>assign(() => {}, { func }) : (() => void) & Writable<{ func: () => void; }> +>assign : (a: T, b: U) => T & Writable >() => {} : () => void >{ func } : { func: () => void; } >func : () => void diff --git a/tests/baselines/reference/unionOfClassCalls.errors.txt b/tests/baselines/reference/unionOfClassCalls.errors.txt index 386d34414bbf0..6b6c54520abdc 100644 --- a/tests/baselines/reference/unionOfClassCalls.errors.txt +++ b/tests/baselines/reference/unionOfClassCalls.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/unionOfClassCalls.ts(28,5): error TS2349: This expression is not callable. - Each member of the union type '{ (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } | { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; }' has signatures, but none of those signatures are compatible with each other. + Each member of the union type '{ (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } | { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string | undefined): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; }' has signatures, but none of those signatures are compatible with each other. ==== tests/cases/compiler/unionOfClassCalls.ts (1 errors) ==== @@ -33,7 +33,7 @@ tests/cases/compiler/unionOfClassCalls.ts(28,5): error TS2349: This expression i arr.reduce((acc: Array, a: number | string, index: number) => { ~~~~~~ !!! error TS2349: This expression is not callable. -!!! error TS2349: Each member of the union type '{ (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } | { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; }' has signatures, but none of those signatures are compatible with each other. +!!! error TS2349: Each member of the union type '{ (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } | { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string | undefined): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; }' has signatures, but none of those signatures are compatible with each other. return [] }, []) diff --git a/tests/baselines/reference/unionOfClassCalls.symbols b/tests/baselines/reference/unionOfClassCalls.symbols index 03155a66c5a10..77c85093adae8 100644 --- a/tests/baselines/reference/unionOfClassCalls.symbols +++ b/tests/baselines/reference/unionOfClassCalls.symbols @@ -67,9 +67,9 @@ arr.map((a: number | string, index: number) => { // This case still doesn't work because `reduce` has multiple overloads :( arr.reduce((acc: Array, a: number | string, index: number) => { ->arr.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>arr.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >arr : Symbol(arr, Decl(unionOfClassCalls.ts, 18, 5)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >acc : Symbol(acc, Decl(unionOfClassCalls.ts, 27, 12)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(unionOfClassCalls.ts, 27, 31)) @@ -103,9 +103,9 @@ arr1.map((a: number, index: number) => { }) arr1.reduce((acc: number[], a: number, index: number) => { ->arr1.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>arr1.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >arr1 : Symbol(arr1, Decl(unionOfClassCalls.ts, 19, 5)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >acc : Symbol(acc, Decl(unionOfClassCalls.ts, 39, 13)) >a : Symbol(a, Decl(unionOfClassCalls.ts, 39, 27)) >index : Symbol(index, Decl(unionOfClassCalls.ts, 39, 38)) @@ -139,9 +139,9 @@ arr2.map((a: string, index: number) => { }) arr2.reduce((acc: string[], a: string, index: number) => { ->arr2.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>arr2.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >arr2 : Symbol(arr2, Decl(unionOfClassCalls.ts, 20, 5)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >acc : Symbol(acc, Decl(unionOfClassCalls.ts, 50, 13)) >a : Symbol(a, Decl(unionOfClassCalls.ts, 50, 27)) >index : Symbol(index, Decl(unionOfClassCalls.ts, 50, 38)) diff --git a/tests/baselines/reference/unionOfClassCalls.types b/tests/baselines/reference/unionOfClassCalls.types index 7edd1c7f02ac2..06e3e4bab679e 100644 --- a/tests/baselines/reference/unionOfClassCalls.types +++ b/tests/baselines/reference/unionOfClassCalls.types @@ -65,9 +65,9 @@ arr.map((a: number | string, index: number) => { // This case still doesn't work because `reduce` has multiple overloads :( arr.reduce((acc: Array, a: number | string, index: number) => { >arr.reduce((acc: Array, a: number | string, index: number) => { return []}, []) : any ->arr.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } | { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>arr.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } | { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string | undefined): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >arr : number[] | string[] ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } | { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } | { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string | undefined): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >(acc: Array, a: number | string, index: number) => { return []} : (acc: Array, a: number | string, index: number) => never[] >acc : string[] >a : string | number @@ -109,9 +109,9 @@ arr1.map((a: number, index: number) => { arr1.reduce((acc: number[], a: number, index: number) => { >arr1.reduce((acc: number[], a: number, index: number) => { return [a]}, []) : number[] ->arr1.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>arr1.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >arr1 : number[] ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number | undefined): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(acc: number[], a: number, index: number) => { return [a]} : (acc: number[], a: number, index: number) => number[] >acc : number[] >a : number @@ -153,9 +153,9 @@ arr2.map((a: string, index: number) => { arr2.reduce((acc: string[], a: string, index: number) => { >arr2.reduce((acc: string[], a: string, index: number) => { return []}, []) : never[] ->arr2.reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>arr2.reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string | undefined): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >arr2 : string[] ->reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string | undefined): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >(acc: string[], a: string, index: number) => { return []} : (acc: string[], a: string, index: number) => never[] >acc : string[] >a : string diff --git a/tests/baselines/reference/unknownControlFlow.types b/tests/baselines/reference/unknownControlFlow.types index 24cbd3b162850..f0c7599de150b 100644 --- a/tests/baselines/reference/unknownControlFlow.types +++ b/tests/baselines/reference/unknownControlFlow.types @@ -660,14 +660,14 @@ function deepEquals(a: T, b: T): boolean { if (Array.isArray(a) || Array.isArray(b)) { >Array.isArray(a) || Array.isArray(b) : boolean >Array.isArray(a) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >a : T & object >Array.isArray(b) : boolean ->Array.isArray : (arg: any) => arg is any[] +>Array.isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >Array : ArrayConstructor ->isArray : (arg: any) => arg is any[] +>isArray : (arg: T) => arg is T extends any ? Extract ? U[] : unknown[], T> : never >b : T & object return false; diff --git a/tests/baselines/reference/unknownSymbolOffContextualType1.symbols b/tests/baselines/reference/unknownSymbolOffContextualType1.symbols index 1360417ccf386..a7ba8fa2cffc9 100644 --- a/tests/baselines/reference/unknownSymbolOffContextualType1.symbols +++ b/tests/baselines/reference/unknownSymbolOffContextualType1.symbols @@ -61,9 +61,9 @@ function getMaxWidth(elementNames: string[]) { }); var maxWidth = widths.reduce(function (a, b) { >maxWidth : Symbol(maxWidth, Decl(unknownSymbolOffContextualType1.ts, 17, 7)) ->widths.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>widths.reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >widths : Symbol(widths, Decl(unknownSymbolOffContextualType1.ts, 14, 7)) ->reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(unknownSymbolOffContextualType1.ts, 17, 43)) >b : Symbol(b, Decl(unknownSymbolOffContextualType1.ts, 17, 45)) diff --git a/tests/baselines/reference/unknownSymbolOffContextualType1.types b/tests/baselines/reference/unknownSymbolOffContextualType1.types index 556476fcfeb4d..68858384698e7 100644 --- a/tests/baselines/reference/unknownSymbolOffContextualType1.types +++ b/tests/baselines/reference/unknownSymbolOffContextualType1.types @@ -66,9 +66,9 @@ function getMaxWidth(elementNames: string[]) { var maxWidth = widths.reduce(function (a, b) { >maxWidth : any >widths.reduce(function (a, b) { return a > b ? a : b; }) : any ->widths.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>widths.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >widths : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >function (a, b) { return a > b ? a : b; } : (a: any, b: any) => any >a : any >b : any diff --git a/tests/cases/compiler/arrayCopyWithin.ts b/tests/cases/compiler/arrayCopyWithin.ts new file mode 100644 index 0000000000000..b1b60adc6aea2 --- /dev/null +++ b/tests/cases/compiler/arrayCopyWithin.ts @@ -0,0 +1,51 @@ +// @lib: esnext + +var strTuple: ["foo", "bar", "baz"]; +strTuple.copyWithin(0, 0); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] + +var numTuple: [11, 2, 22, 1]; +numTuple.copyWithin(0, 0); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +int8Array.copyWithin(0, 0); // Int8Array + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +uint8Array.copyWithin(0, 0); // Uint8Array + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +uint8ClampedArray.copyWithin(0, 0); // Uint8ClampedArray + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +int16Array.copyWithin(0, 0); // Int16Array + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +uint16Array.copyWithin(0, 0); // Uint16Array + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +int32Array.copyWithin(0, 0); // Int32Array + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +uint32Array.copyWithin(0, 0); // Uint32Array + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +float32Array.copyWithin(0, 0); // Float32Array + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +float64Array.copyWithin(0, 0); // Float64Array + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +bigInt64Array.copyWithin(0, 0); // BigInt64Array + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +bigUint64Array.copyWithin(0, 0); // BigUint64Array diff --git a/tests/cases/compiler/arrayFill.ts b/tests/cases/compiler/arrayFill.ts new file mode 100644 index 0000000000000..5b057703a499e --- /dev/null +++ b/tests/cases/compiler/arrayFill.ts @@ -0,0 +1,52 @@ +// @lib: esnext +// @target: esnext + +var strTuple: ["foo", "bar", "baz"]; +strTuple.fill("foo"); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] + +var numTuple: [11, 2, 22, 1]; +numTuple.fill(11); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +int8Array.fill(0); // Int8Array + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +uint8Array.fill(0); // Uint8Array + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +uint8ClampedArray.fill(0); // Uint8ClampedArray + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +int16Array.fill(0); // Int16Array + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +uint16Array.fill(0); // Uint16Array + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +int32Array.fill(0); // Int32Array + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +uint32Array.fill(0); // Uint32Array + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +float32Array.fill(0); // Float32Array + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +float64Array.fill(0); // Float64Array + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +bigInt64Array.fill(0n); // BigInt64Array + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +bigUint64Array.fill(0n); // BigUint64Array diff --git a/tests/cases/compiler/arrayMethodPredicates.ts b/tests/cases/compiler/arrayMethodPredicates.ts new file mode 100644 index 0000000000000..d50ed08123902 --- /dev/null +++ b/tests/cases/compiler/arrayMethodPredicates.ts @@ -0,0 +1,85 @@ +// @lib: esnext + +var array: number[]; +var readonlyArray: readonly number[]; +var int8Array: Int8Array; +var uint8Array: Uint8Array; +var uint8ClampedArray: Uint8ClampedArray; +var int16Array: Int16Array; +var uint16Array: Uint16Array; +var int32Array: Int32Array; +var uint32Array: Uint32Array; +var float32Array: Float32Array; +var float64Array: Float64Array; +var bigInt64Array: BigInt64Array; +var bigUint64Array: BigUint64Array; + +array.every(x => x); +readonlyArray.every(x => x); +int8Array.every(x => x); +uint8Array.every(x => x); +uint8ClampedArray.every(x => x); +int16Array.every(x => x); +uint16Array.every(x => x); +int32Array.every(x => x); +uint32Array.every(x => x); +float32Array.every(x => x); +float64Array.every(x => x); +bigInt64Array.every(x => x); +bigUint64Array.every(x => x); + +array.filter(x => x); +readonlyArray.filter(x => x); +int8Array.filter(x => x); +uint8Array.filter(x => x); +uint8ClampedArray.filter(x => x); +int16Array.filter(x => x); +uint16Array.filter(x => x); +int32Array.filter(x => x); +uint32Array.filter(x => x); +float32Array.filter(x => x); +float64Array.filter(x => x); +bigInt64Array.filter(x => x); +bigUint64Array.filter(x => x); + +array.find(x => x); +readonlyArray.find(x => x); +int8Array.find(x => x); +uint8Array.find(x => x); +uint8ClampedArray.find(x => x); +int16Array.find(x => x); +uint16Array.find(x => x); +int32Array.find(x => x); +uint32Array.find(x => x); +float32Array.find(x => x); +float64Array.find(x => x); +bigInt64Array.find(x => x); +bigUint64Array.find(x => x); + +array.findIndex(x => x); +readonlyArray.findIndex(x => x); +int8Array.findIndex(x => x); +uint8Array.findIndex(x => x); +uint8ClampedArray.findIndex(x => x); +int16Array.findIndex(x => x); +uint16Array.findIndex(x => x); +int32Array.findIndex(x => x); +uint32Array.findIndex(x => x); +float32Array.findIndex(x => x); +float64Array.findIndex(x => x); +bigInt64Array.findIndex(x => x); +bigUint64Array.findIndex(x => x); + +array.some(x => x); +readonlyArray.some(x => x); +int8Array.some(x => x); +uint8Array.some(x => x); +uint8ClampedArray.some(x => x); +int16Array.some(x => x); +uint16Array.some(x => x); +int32Array.some(x => x); +uint32Array.some(x => x); +float32Array.some(x => x); +float64Array.some(x => x); +bigInt64Array.some(x => x); +bigUint64Array.some(x => x); diff --git a/tests/cases/compiler/arrayReverse.ts b/tests/cases/compiler/arrayReverse.ts new file mode 100644 index 0000000000000..73eeade073a4f --- /dev/null +++ b/tests/cases/compiler/arrayReverse.ts @@ -0,0 +1,51 @@ +// @lib: esnext + +var strTuple: ["foo", "bar", "baz"]; +strTuple.reverse(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] + +var numTuple: [11, 2, 22, 1]; +numTuple.reverse(); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +int8Array.reverse(); // Int8Array + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +uint8Array.reverse(); // Uint8Array + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +uint8ClampedArray.reverse(); // Uint8ClampedArray + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +int16Array.reverse(); // Int16Array + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +uint16Array.reverse(); // Uint16Array + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +int32Array.reverse(); // Int32Array + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +uint32Array.reverse(); // Uint32Array + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +float32Array.reverse(); // Float32Array + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +float64Array.reverse(); // Float64Array + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +bigInt64Array.reverse(); // BigInt64Array + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +bigUint64Array.reverse(); // BigUint64Array diff --git a/tests/cases/compiler/arraySort.ts b/tests/cases/compiler/arraySort.ts new file mode 100644 index 0000000000000..c8233ca21c758 --- /dev/null +++ b/tests/cases/compiler/arraySort.ts @@ -0,0 +1,51 @@ +// @lib: esnext + +var strTuple: ["foo", "bar", "baz"]; +strTuple.sort(); // Type should be ("foo" | "bar" | "baz")[] instead of ["foo", "bar", "baz"] + +var numTuple: [11, 2, 22, 1]; +numTuple.sort((a, b) => a - b); // Type should be (11 | 2 | 22 | 1)[] instead of [11, 2, 22, 1] + +interface Int8ArrayExtension extends Int8Array {} +var int8Array: Int8ArrayExtension; +int8Array.sort((a, b) => a - b); // Int8Array + +interface Uint8ArrayExtension extends Uint8Array {} +var uint8Array: Uint8ArrayExtension; +uint8Array.sort((a, b) => a - b); // Uint8Array + +interface Uint8ClampedArrayExtension extends Uint8ClampedArray {} +var uint8ClampedArray: Uint8ClampedArrayExtension; +uint8ClampedArray.sort((a, b) => a - b); // Uint8ClampedArray + +interface Int16ArrayExtension extends Int16Array {} +var int16Array: Int16ArrayExtension; +int16Array.sort((a, b) => a - b); // Int16Array + +interface Uint16ArrayExtension extends Uint16Array {} +var uint16Array: Uint16ArrayExtension; +uint16Array.sort((a, b) => a - b); // Uint16Array + +interface Int32ArrayExtension extends Int32Array {} +var int32Array: Int32ArrayExtension; +int32Array.sort((a, b) => a - b); // Int32Array + +interface Uint32ArrayExtension extends Uint32Array {} +var uint32Array: Uint32ArrayExtension; +uint32Array.sort((a, b) => a - b); // Uint32Array + +interface Float32ArrayExtension extends Float32Array {} +var float32Array: Float32ArrayExtension; +float32Array.sort((a, b) => a - b); // Float32Array + +interface Float64ArrayExtension extends Float64Array {} +var float64Array: Float64ArrayExtension; +float64Array.sort((a, b) => a - b); // Float64Array + +interface BigInt64ArrayExtension extends BigInt64Array {} +var bigInt64Array: BigInt64ArrayExtension; +bigInt64Array.sort((a, b) => a - b); // BigInt64Array + +interface BigUint64ArrayExtension extends BigUint64Array {} +var bigUint64Array: BigUint64ArrayExtension; +bigUint64Array.sort((a, b) => a - b); // BigUint64Array diff --git a/tests/cases/compiler/implementArrayInterface.ts b/tests/cases/compiler/implementArrayInterface.ts index 79ba68bdc4279..9fcc4818976db 100644 --- a/tests/cases/compiler/implementArrayInterface.ts +++ b/tests/cases/compiler/implementArrayInterface.ts @@ -1,6 +1,9 @@ +// @lib: es2022 + declare class MyArray implements Array { toString(): string; toLocaleString(): string; + valueOf(): T[]; concat(...items: U[]): T[]; concat(...items: T[]): T[]; join(separator?: string): string; @@ -9,7 +12,7 @@ declare class MyArray implements Array { reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; - sort(compareFn?: (a: T, b: T) => number): this; + sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; @@ -26,6 +29,20 @@ declare class MyArray implements Array { 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; + find(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T | undefined; + findIndex(predicate: (value: T, index: number, array: T[]) => boolean, thisArg?: any): number; + fill(value: T, start?: number, end?: number): T[]; + copyWithin(target: number, start: number, end?: number): T[]; + [Symbol.iterator](): IterableIterator; + entries(): IterableIterator<[number, T]>; + keys(): IterableIterator; + values(): IterableIterator; + [Symbol.unscopables]: any; + includes(searchElement: T, fromIndex?: number): boolean; + flatMap(callback: (value: T, index: number, array: T[]) => U | U[], thisArg?: any): U[] + flat(this: A, depth?: D): FlatArray[] + at(index: number): T | undefined; + length: number; [n: number]: T; diff --git a/tests/cases/compiler/isArrayConformance.ts b/tests/cases/compiler/isArrayConformance.ts new file mode 100644 index 0000000000000..b1aa66a4ee6e2 --- /dev/null +++ b/tests/cases/compiler/isArrayConformance.ts @@ -0,0 +1,58 @@ +// @lib: esnext + +function f1(a: any) { + if (Array.isArray(a)) { + a; // Expected: any[] + } +} + +function f2(a: unknown) { + if (Array.isArray(a)) { + a; // Expected: unknown[] + } +} + +function f3(a: string | readonly string[] | number[]) { + if (Array.isArray(a)) { + var b: readonly string[] | number[] = a; // OK + a[0]; // Expected: string | number + } +} + +function f4(a: T) { + if (Array.isArray(a)) { + var b: readonly string[] | number[] = a; // OK + a[0]; // Expected: string | number + } +} + +// Repro from #41808 + +function f5(a: T) { + if (Array.isArray(a)) { + a[0]; // Expected: string + } +} + +function f6(a: (number[] | null | "loading")[]) { + a.filter(Array.isArray); // Expected: number[][] +} + +function f7(a: {} | null) { + if (Array.isArray(a)) { + a; // Expected: unknown[] + } +} + +function f8 | Iterable | readonly string[] | null>(a: T) { + if (Array.isArray(a)) { + var b: readonly string[] | number[] | boolean[] = a; // OK + a[0]; // Expected: string | number | boolean + } +} + +function f9(a: number | null) { + if (Array.isArray(a)) { + a; // Expected: never + } +} diff --git a/tests/cases/compiler/mapConstructorOnReadonlyTuple.ts b/tests/cases/compiler/mapConstructorOnReadonlyTuple.ts index f4914e67def20..2aa2824f4cf82 100644 --- a/tests/cases/compiler/mapConstructorOnReadonlyTuple.ts +++ b/tests/cases/compiler/mapConstructorOnReadonlyTuple.ts @@ -1,4 +1,5 @@ // @target: es2015 -const pairs = [['1', 1], ['2', 2]] as const -new Map(pairs); \ No newline at end of file +const pairs = [[{}, 1], [{}, 2]] as const; +new Map(pairs); +new WeakMap(pairs); diff --git a/tests/cases/compiler/objectMethodNullability.ts b/tests/cases/compiler/objectMethodNullability.ts new file mode 100644 index 0000000000000..4c3038be83c7e --- /dev/null +++ b/tests/cases/compiler/objectMethodNullability.ts @@ -0,0 +1,51 @@ +// @lib: esnext +// @strict: true + +// All of the following should produce an error: + +Object.assign(undefined); +Object.create(undefined); +Object.defineProperties(undefined, {}); +Object.defineProperty(undefined, "foo", {}); +Object.entries(undefined); +Object.getOwnPropertyDescriptor(undefined, "foo"); +Object.getOwnPropertyDescriptors(undefined); +Object.getOwnPropertyNames(undefined); +Object.getOwnPropertySymbols(undefined); +Object.getPrototypeOf(undefined); +Object.hasOwn(undefined, "foo"); +Object.keys(undefined); +Object.setPrototypeOf(undefined, {}); +Object.values(undefined); + +Object.create(0); +Object.defineProperties(0, {}); +Object.defineProperty(0, "foo", {}); + +// While the following should not: + +Object.assign(0); +Object.entries(0); +Object.getOwnPropertyDescriptor(0, "foo"); +Object.getOwnPropertyDescriptors(0); +Object.getOwnPropertyNames(0); +Object.getOwnPropertySymbols(0); +Object.getPrototypeOf(0); +Object.hasOwn(0, "foo"); +Object.keys(0); +Object.setPrototypeOf(0, {}); +Object.values(0); + +Object.freeze(undefined); +Object.isExtensible(undefined); +Object.isFrozen(undefined); +Object.isSealed(undefined); +Object.preventExtensions(undefined); +Object.seal(undefined); + +Object.freeze(0); +Object.isExtensible(0); +Object.isFrozen(0); +Object.isSealed(0); +Object.preventExtensions(0); +Object.seal(0); diff --git a/tests/cases/fourslash/completionListOfGenericSymbol.ts b/tests/cases/fourslash/completionListOfGenericSymbol.ts index 6d17cd06d159d..6b91502b54c19 100644 --- a/tests/cases/fourslash/completionListOfGenericSymbol.ts +++ b/tests/cases/fourslash/completionListOfGenericSymbol.ts @@ -18,7 +18,7 @@ verify.completions({ { name: "toString", text: "(method) Array.toString(): string", - documentation: "Returns a string representation of an array.", + documentation: "Returns a string representation of the array.", kind: "method", kindModifiers: "declare", },