From 539d47c570796a8b36ed5e847509e254ea4bd392 Mon Sep 17 00:00:00 2001 From: lionel-rowe Date: Thu, 23 Nov 2023 15:50:52 +0800 Subject: [PATCH] Add BuiltInIterableIterator for built-in iterables with undefined return values --- src/lib/es2015.iterable.d.ts | 130 +++++++++--------- src/lib/es2020.bigint.d.ts | 16 +-- src/lib/es2020.string.d.ts | 2 +- src/lib/es2020.symbol.wellknown.d.ts | 2 +- src/lib/es2022.intl.d.ts | 2 +- .../reference/YieldStarExpression4_es6.types | 2 +- .../argumentsObjectIterator02_ES6.types | 8 +- tests/baselines/reference/arrayFrom.types | 12 +- .../reference/bigintWithLib.errors.txt | 4 +- ...ructuredLateBoundNameHasCorrectTypes.types | 4 +- .../dissallowSymbolAsWeakType.errors.txt | 8 +- ....asyncGenerators.classMethods.es2015.types | 4 +- ....asyncGenerators.classMethods.es2018.types | 4 +- ...ter.asyncGenerators.classMethods.es5.types | 4 +- ...nerators.functionDeclarations.es2015.types | 4 +- ...nerators.functionDeclarations.es2018.types | 4 +- ...cGenerators.functionDeclarations.es5.types | 4 +- ...enerators.functionExpressions.es2015.types | 4 +- ...enerators.functionExpressions.es2018.types | 4 +- ...ncGenerators.functionExpressions.es5.types | 4 +- ...nerators.objectLiteralMethods.es2015.types | 4 +- ...nerators.objectLiteralMethods.es2018.types | 4 +- ...cGenerators.objectLiteralMethods.es5.types | 4 +- tests/baselines/reference/for-of12.types | 6 +- tests/baselines/reference/for-of13.types | 6 +- tests/baselines/reference/for-of39.errors.txt | 4 +- .../generatorReturnTypeInference.types | 2 +- ...eneratorReturnTypeInferenceNonStrict.types | 2 +- .../reference/generatorTypeCheck19.types | 2 +- .../reference/generatorTypeCheck20.types | 2 +- .../reference/generatorTypeCheck22.types | 4 +- .../reference/generatorTypeCheck23.types | 4 +- .../reference/generatorTypeCheck24.types | 6 +- .../reference/generatorTypeCheck25.types | 4 +- .../reference/generatorTypeCheck26.types | 2 +- .../reference/generatorTypeCheck53.types | 2 +- .../reference/generatorTypeCheck54.types | 4 +- ...rtHelpersNoHelpersForAsyncGenerators.types | 2 +- ...indirectGlobalSymbolPartOfObjectType.types | 2 +- .../iterableArrayPattern28.errors.txt | 4 +- ...ithAsClauseAndLateBoundProperty.errors.txt | 4 +- ...TypeWithAsClauseAndLateBoundProperty.types | 6 +- ...edTypeWithAsClauseAndLateBoundProperty2.js | 16 +-- ...ypeWithAsClauseAndLateBoundProperty2.types | 6 +- ...eLibrary_NoErrorDuplicateLibOptions1.types | 6 +- ...eLibrary_NoErrorDuplicateLibOptions2.types | 6 +- ...dularizeLibrary_TargetES5UsingES6Lib.types | 6 +- ...dularizeLibrary_TargetES6UsingES6Lib.types | 6 +- ....asyncGenerators.classMethods.es2018.types | 2 +- ...nerators.functionDeclarations.es2018.types | 2 +- ...enerators.functionExpressions.es2018.types | 2 +- ...nerators.objectLiteralMethods.es2018.types | 2 +- .../reference/regexMatchAll-esnext.types | 8 +- tests/baselines/reference/regexMatchAll.types | 8 +- .../baselines/reference/stringMatchAll.types | 10 +- .../types.asyncGenerators.es2018.1.types | 28 ++-- .../types.asyncGenerators.es2018.2.types | 12 +- .../yieldExpressionInControlFlow.types | 8 +- .../yieldExpressionInnerCommentEmit.types | 4 +- 59 files changed, 222 insertions(+), 216 deletions(-) diff --git a/src/lib/es2015.iterable.d.ts b/src/lib/es2015.iterable.d.ts index d28b8381eec86..48e8dd0d4fd47 100644 --- a/src/lib/es2015.iterable.d.ts +++ b/src/lib/es2015.iterable.d.ts @@ -35,24 +35,30 @@ interface IterableIterator extends Iterator { [Symbol.iterator](): IterableIterator; } +interface BuiltInIterableIterator { + // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. + next(...args: [] | [undefined]): IteratorResult; + [Symbol.iterator](): BuiltInIterableIterator; +} + interface Array { /** Iterator */ - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an iterable of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, T]>; + entries(): BuiltInIterableIterator<[number, T]>; /** * Returns an iterable of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an iterable of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface ArrayConstructor { @@ -73,67 +79,67 @@ interface ArrayConstructor { interface ReadonlyArray { /** Iterator of values in the array. */ - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an iterable of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, T]>; + entries(): BuiltInIterableIterator<[number, T]>; /** * Returns an iterable of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an iterable of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface IArguments { /** Iterator */ - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; } interface Map { /** Returns an iterable of entries in the map. */ - [Symbol.iterator](): IterableIterator<[K, V]>; + [Symbol.iterator](): BuiltInIterableIterator<[K, V]>; /** * Returns an iterable of key, value pairs for every entry in the map. */ - entries(): IterableIterator<[K, V]>; + entries(): BuiltInIterableIterator<[K, V]>; /** * Returns an iterable of keys in the map */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an iterable of values in the map */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface ReadonlyMap { /** Returns an iterable of entries in the map. */ - [Symbol.iterator](): IterableIterator<[K, V]>; + [Symbol.iterator](): BuiltInIterableIterator<[K, V]>; /** * Returns an iterable of key, value pairs for every entry in the map. */ - entries(): IterableIterator<[K, V]>; + entries(): BuiltInIterableIterator<[K, V]>; /** * Returns an iterable of keys in the map */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an iterable of values in the map */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface MapConstructor { @@ -149,40 +155,40 @@ interface WeakMapConstructor { interface Set { /** Iterates over values in the set. */ - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an iterable of [v,v] pairs for every value `v` in the set. */ - entries(): IterableIterator<[T, T]>; + entries(): BuiltInIterableIterator<[T, T]>; /** * Despite its name, returns an iterable of the values in the set. */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an iterable of values in the set. */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface ReadonlySet { /** Iterates over values in the set. */ - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an iterable of [v,v] pairs for every value `v` in the set. */ - entries(): IterableIterator<[T, T]>; + entries(): BuiltInIterableIterator<[T, T]>; /** * Despite its name, returns an iterable of the values in the set. */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an iterable of values in the set. */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface SetConstructor { @@ -217,23 +223,23 @@ interface PromiseConstructor { interface String { /** Iterator */ - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; } interface Int8Array { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an array of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, number]>; + entries(): BuiltInIterableIterator<[number, number]>; /** * Returns an list of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an list of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface Int8ArrayConstructor { @@ -249,19 +255,19 @@ interface Int8ArrayConstructor { } interface Uint8Array { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an array of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, number]>; + entries(): BuiltInIterableIterator<[number, number]>; /** * Returns an list of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an list of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface Uint8ArrayConstructor { @@ -277,21 +283,21 @@ interface Uint8ArrayConstructor { } interface Uint8ClampedArray { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an array of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, number]>; + entries(): BuiltInIterableIterator<[number, number]>; /** * Returns an list of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an list of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface Uint8ClampedArrayConstructor { @@ -307,21 +313,21 @@ interface Uint8ClampedArrayConstructor { } interface Int16Array { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an array of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, number]>; + entries(): BuiltInIterableIterator<[number, number]>; /** * Returns an list of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an list of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface Int16ArrayConstructor { @@ -337,19 +343,19 @@ interface Int16ArrayConstructor { } interface Uint16Array { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an array of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, number]>; + entries(): BuiltInIterableIterator<[number, number]>; /** * Returns an list of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an list of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface Uint16ArrayConstructor { @@ -365,19 +371,19 @@ interface Uint16ArrayConstructor { } interface Int32Array { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an array of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, number]>; + entries(): BuiltInIterableIterator<[number, number]>; /** * Returns an list of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an list of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface Int32ArrayConstructor { @@ -393,19 +399,19 @@ interface Int32ArrayConstructor { } interface Uint32Array { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an array of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, number]>; + entries(): BuiltInIterableIterator<[number, number]>; /** * Returns an list of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an list of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface Uint32ArrayConstructor { @@ -421,19 +427,19 @@ interface Uint32ArrayConstructor { } interface Float32Array { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an array of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, number]>; + entries(): BuiltInIterableIterator<[number, number]>; /** * Returns an list of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an list of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface Float32ArrayConstructor { @@ -449,19 +455,19 @@ interface Float32ArrayConstructor { } interface Float64Array { - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; /** * Returns an array of key, value pairs for every entry in the array */ - entries(): IterableIterator<[number, number]>; + entries(): BuiltInIterableIterator<[number, number]>; /** * Returns an list of keys in the array */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns an list of values in the array */ - values(): IterableIterator; + values(): BuiltInIterableIterator; } interface Float64ArrayConstructor { diff --git a/src/lib/es2020.bigint.d.ts b/src/lib/es2020.bigint.d.ts index 597b3822792eb..55417e2dc8e84 100644 --- a/src/lib/es2020.bigint.d.ts +++ b/src/lib/es2020.bigint.d.ts @@ -153,7 +153,7 @@ interface BigInt64Array { copyWithin(target: number, start: number, end?: number): this; /** Yields index, value pairs for every entry in the array. */ - entries(): IterableIterator<[number, bigint]>; + entries(): BuiltInIterableIterator<[number, bigint]>; /** * Determines whether all the members of an array satisfy the specified test. @@ -238,7 +238,7 @@ interface BigInt64Array { join(separator?: string): string; /** Yields each index in the array. */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns the index of the last occurrence of a value in an array. @@ -360,9 +360,9 @@ interface BigInt64Array { valueOf(): BigInt64Array; /** Yields each value in the array. */ - values(): IterableIterator; + values(): BuiltInIterableIterator; - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; readonly [Symbol.toStringTag]: "BigInt64Array"; @@ -425,7 +425,7 @@ interface BigUint64Array { copyWithin(target: number, start: number, end?: number): this; /** Yields index, value pairs for every entry in the array. */ - entries(): IterableIterator<[number, bigint]>; + entries(): BuiltInIterableIterator<[number, bigint]>; /** * Determines whether all the members of an array satisfy the specified test. @@ -510,7 +510,7 @@ interface BigUint64Array { join(separator?: string): string; /** Yields each index in the array. */ - keys(): IterableIterator; + keys(): BuiltInIterableIterator; /** * Returns the index of the last occurrence of a value in an array. @@ -632,9 +632,9 @@ interface BigUint64Array { valueOf(): BigUint64Array; /** Yields each value in the array. */ - values(): IterableIterator; + values(): BuiltInIterableIterator; - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; readonly [Symbol.toStringTag]: "BigUint64Array"; diff --git a/src/lib/es2020.string.d.ts b/src/lib/es2020.string.d.ts index 382bc75595e92..4efe9fcd4ae22 100644 --- a/src/lib/es2020.string.d.ts +++ b/src/lib/es2020.string.d.ts @@ -6,5 +6,5 @@ interface String { * containing the results of that search. * @param regexp A variable name or string literal containing the regular expression pattern and flags. */ - matchAll(regexp: RegExp): IterableIterator; + matchAll(regexp: RegExp): BuiltInIterableIterator; } diff --git a/src/lib/es2020.symbol.wellknown.d.ts b/src/lib/es2020.symbol.wellknown.d.ts index 94a11768256c7..a5d2d1e079b10 100644 --- a/src/lib/es2020.symbol.wellknown.d.ts +++ b/src/lib/es2020.symbol.wellknown.d.ts @@ -15,5 +15,5 @@ interface RegExp { * containing the results of that search. * @param string A string to search within. */ - [Symbol.matchAll](str: string): IterableIterator; + [Symbol.matchAll](str: string): BuiltInIterableIterator; } diff --git a/src/lib/es2022.intl.d.ts b/src/lib/es2022.intl.d.ts index 7ed03b05e07ca..7064872513037 100644 --- a/src/lib/es2022.intl.d.ts +++ b/src/lib/es2022.intl.d.ts @@ -37,7 +37,7 @@ declare namespace Intl { containing(codeUnitIndex?: number): SegmentData; /** Returns an iterator to iterate over the segments. */ - [Symbol.iterator](): IterableIterator; + [Symbol.iterator](): BuiltInIterableIterator; } interface SegmentData { diff --git a/tests/baselines/reference/YieldStarExpression4_es6.types b/tests/baselines/reference/YieldStarExpression4_es6.types index 6ab7b6205fe6b..b6be82f0fbde5 100644 --- a/tests/baselines/reference/YieldStarExpression4_es6.types +++ b/tests/baselines/reference/YieldStarExpression4_es6.types @@ -5,6 +5,6 @@ function *g() { >g : () => Generator yield * []; ->yield * [] : any +>yield * [] : undefined >[] : undefined[] } diff --git a/tests/baselines/reference/argumentsObjectIterator02_ES6.types b/tests/baselines/reference/argumentsObjectIterator02_ES6.types index 28ea6a9c71106..e9df0cb6b1d77 100644 --- a/tests/baselines/reference/argumentsObjectIterator02_ES6.types +++ b/tests/baselines/reference/argumentsObjectIterator02_ES6.types @@ -8,8 +8,8 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe >z : number let blah = arguments[Symbol.iterator]; ->blah : () => IterableIterator ->arguments[Symbol.iterator] : () => IterableIterator +>blah : () => BuiltInIterableIterator +>arguments[Symbol.iterator] : () => BuiltInIterableIterator >arguments : IArguments >Symbol.iterator : unique symbol >Symbol : SymbolConstructor @@ -21,8 +21,8 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe for (let arg of blah()) { >arg : any ->blah() : IterableIterator ->blah : () => IterableIterator +>blah() : BuiltInIterableIterator +>blah : () => BuiltInIterableIterator result.push(arg + arg); >result.push(arg + arg) : number diff --git a/tests/baselines/reference/arrayFrom.types b/tests/baselines/reference/arrayFrom.types index dda3f91d2698f..04f7da5bef950 100644 --- a/tests/baselines/reference/arrayFrom.types +++ b/tests/baselines/reference/arrayFrom.types @@ -54,10 +54,10 @@ const result2: A[] = Array.from(inputA.values()); >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T_2[]; (iterable: Iterable | ArrayLike, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[]; } >Array : ArrayConstructor >from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T_2[]; (iterable: Iterable | ArrayLike, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[]; } ->inputA.values() : IterableIterator ->inputA.values : () => IterableIterator +>inputA.values() : BuiltInIterableIterator +>inputA.values : () => BuiltInIterableIterator >inputA : A[] ->values : () => IterableIterator +>values : () => BuiltInIterableIterator const result3: B[] = Array.from(inputA.values()); // expect error >result3 : B[] @@ -65,10 +65,10 @@ const result3: B[] = Array.from(inputA.values()); // expect error >Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T_2[]; (iterable: Iterable | ArrayLike, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[]; } >Array : ArrayConstructor >from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[]; (iterable: Iterable | ArrayLike): T_2[]; (iterable: Iterable | ArrayLike, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[]; } ->inputA.values() : IterableIterator ->inputA.values : () => IterableIterator +>inputA.values() : BuiltInIterableIterator +>inputA.values : () => BuiltInIterableIterator >inputA : A[] ->values : () => IterableIterator +>values : () => BuiltInIterableIterator const result4: A[] = Array.from(inputB, ({ b }): A => ({ a: b })); >result4 : A[] diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index aa402ec0cba5c..478c72e8096ec 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -5,7 +5,7 @@ bigintWithLib.ts(19,33): error TS2769: No overload matches this call. 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 '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'. @@ -54,7 +54,7 @@ bigintWithLib.ts(46,26): error TS2345: Argument of type 'number' is not assignab !!! 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 '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'. diff --git a/tests/baselines/reference/destructuredLateBoundNameHasCorrectTypes.types b/tests/baselines/reference/destructuredLateBoundNameHasCorrectTypes.types index 35f40b8548fbc..4d6dc3ce6b735 100644 --- a/tests/baselines/reference/destructuredLateBoundNameHasCorrectTypes.types +++ b/tests/baselines/reference/destructuredLateBoundNameHasCorrectTypes.types @@ -5,12 +5,12 @@ let { [Symbol.iterator]: destructured } = []; >Symbol.iterator : unique symbol >Symbol : SymbolConstructor >iterator : unique symbol ->destructured : () => IterableIterator +>destructured : () => BuiltInIterableIterator >[] : undefined[] void destructured; >void destructured : undefined ->destructured : () => IterableIterator +>destructured : () => BuiltInIterableIterator const named = "prop"; >named : "prop" diff --git a/tests/baselines/reference/dissallowSymbolAsWeakType.errors.txt b/tests/baselines/reference/dissallowSymbolAsWeakType.errors.txt index bb5a8b0daf840..a71188490579c 100644 --- a/tests/baselines/reference/dissallowSymbolAsWeakType.errors.txt +++ b/tests/baselines/reference/dissallowSymbolAsWeakType.errors.txt @@ -2,7 +2,7 @@ dissallowSymbolAsWeakType.ts(3,12): error TS2769: No overload matches this call. Overload 1 of 2, '(iterable: Iterable): WeakSet', gave the following error. Argument of type 'symbol[]' 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 'IteratorResult' is not assignable to type 'IteratorResult'. Type 'IteratorYieldResult' is not assignable to type 'IteratorResult'. Type 'IteratorYieldResult' is not assignable to type 'IteratorYieldResult'. Type 'symbol' is not assignable to type 'object'. @@ -15,7 +15,7 @@ dissallowSymbolAsWeakType.ts(8,12): error TS2769: No overload matches this call. Overload 1 of 2, '(iterable: Iterable): WeakMap', gave the following error. Argument of type '[symbol, false][]' is not assignable to parameter of type 'Iterable'. The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. - Type 'IteratorResult<[symbol, false], any>' is not assignable to type 'IteratorResult'. + Type 'IteratorResult<[symbol, false], undefined>' is not assignable to type 'IteratorResult'. Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorResult'. Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorYieldResult'. Type '[symbol, false]' is not assignable to type 'readonly [object, boolean]'. @@ -41,7 +41,7 @@ dissallowSymbolAsWeakType.ts(19,14): error TS2345: Argument of type 'symbol' is !!! error TS2769: Overload 1 of 2, '(iterable: Iterable): WeakSet', gave the following error. !!! error TS2769: Argument of type 'symbol[]' 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 '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 'symbol' is not assignable to type 'object'. @@ -63,7 +63,7 @@ dissallowSymbolAsWeakType.ts(19,14): error TS2345: Argument of type 'symbol' is !!! error TS2769: Overload 1 of 2, '(iterable: Iterable): WeakMap', gave the following error. !!! error TS2769: Argument of type '[symbol, false][]' 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<[symbol, false], any>' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorResult<[symbol, false], undefined>' is not assignable to type 'IteratorResult'. !!! error TS2769: Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorResult'. !!! error TS2769: Type 'IteratorYieldResult<[symbol, false]>' is not assignable to type 'IteratorYieldResult'. !!! error TS2769: Type '[symbol, false]' is not assignable to type 'readonly [object, boolean]'. diff --git a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2015.types b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2015.types index d2afa4c32af15..baeec57e5c949 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2015.types +++ b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2015.types @@ -41,8 +41,8 @@ class C4 { >f : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2018.types b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2018.types index 28de01dedacc6..35f2112918702 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2018.types +++ b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es2018.types @@ -41,8 +41,8 @@ class C4 { >f : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.types b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.types index 5035ae32a101c..9700e1bc4e0b4 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.types +++ b/tests/baselines/reference/emitter.asyncGenerators.classMethods.es5.types @@ -41,8 +41,8 @@ class C4 { >f : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2015.types b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2015.types index 4ee98563c28d0..48f8dea6f827c 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2015.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2015.types @@ -26,8 +26,8 @@ async function * f4() { >f4 : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2018.types b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2018.types index 33c358b70a958..516aba8940f3a 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2018.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es2018.types @@ -26,8 +26,8 @@ async function * f4() { >f4 : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es5.types b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es5.types index c007f6f625b8f..6a5645d957c59 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es5.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionDeclarations.es5.types @@ -26,8 +26,8 @@ async function * f4() { >f4 : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2015.types b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2015.types index 08dce0ec514ce..778c85e26ed55 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2015.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2015.types @@ -30,8 +30,8 @@ const f4 = async function * () { >async function * () { const x = yield* [1];} : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2018.types b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2018.types index b39f6121770c8..ddc1642253775 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2018.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es2018.types @@ -30,8 +30,8 @@ const f4 = async function * () { >async function * () { const x = yield* [1];} : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es5.types b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es5.types index 9f31455cb0827..71ecb9028ae85 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es5.types +++ b/tests/baselines/reference/emitter.asyncGenerators.functionExpressions.es5.types @@ -30,8 +30,8 @@ const f4 = async function * () { >async function * () { const x = yield* [1];} : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2015.types b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2015.types index 791e0696c6bb2..9a246dcd105eb 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2015.types +++ b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2015.types @@ -45,8 +45,8 @@ const o4 = { >f : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2018.types b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2018.types index 52aebe0074393..39b3c34125b0c 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2018.types +++ b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es2018.types @@ -45,8 +45,8 @@ const o4 = { >f : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es5.types b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es5.types index 05afc7251b23e..415f7cb3ea12c 100644 --- a/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es5.types +++ b/tests/baselines/reference/emitter.asyncGenerators.objectLiteralMethods.es5.types @@ -45,8 +45,8 @@ const o4 = { >f : () => AsyncGenerator const x = yield* [1]; ->x : any ->yield* [1] : any +>x : undefined +>yield* [1] : undefined >[1] : number[] >1 : 1 } diff --git a/tests/baselines/reference/for-of12.types b/tests/baselines/reference/for-of12.types index d9d75ee7fec4e..565c4f6cb1a1b 100644 --- a/tests/baselines/reference/for-of12.types +++ b/tests/baselines/reference/for-of12.types @@ -6,10 +6,10 @@ var v: string; for (v of [0, ""].values()) { } >v : string ->[0, ""].values() : IterableIterator ->[0, ""].values : () => IterableIterator +>[0, ""].values() : BuiltInIterableIterator +>[0, ""].values : () => BuiltInIterableIterator >[0, ""] : (string | number)[] >0 : 0 >"" : "" ->values : () => IterableIterator +>values : () => BuiltInIterableIterator diff --git a/tests/baselines/reference/for-of13.types b/tests/baselines/reference/for-of13.types index bf2d5ef7f5b9f..5ced7b8684998 100644 --- a/tests/baselines/reference/for-of13.types +++ b/tests/baselines/reference/for-of13.types @@ -6,9 +6,9 @@ var v: string; for (v of [""].values()) { } >v : string ->[""].values() : IterableIterator ->[""].values : () => IterableIterator +>[""].values() : BuiltInIterableIterator +>[""].values : () => BuiltInIterableIterator >[""] : string[] >"" : "" ->values : () => IterableIterator +>values : () => BuiltInIterableIterator diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index 9f36eb6bd4585..05aa3710c4260 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -2,7 +2,7 @@ for-of39.ts(1,11): error TS2769: No overload matches this call. Overload 1 of 4, '(iterable?: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, true])[]' is not assignable to parameter of type 'Iterable'. The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. - Type 'IteratorResult<[string, number] | [string, true], any>' is not assignable to type 'IteratorResult'. + Type 'IteratorResult<[string, number] | [string, true], undefined>' is not assignable to type 'IteratorResult'. Type 'IteratorYieldResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. Type 'IteratorYieldResult<[string, number] | [string, true]>' is not assignable to type 'IteratorYieldResult'. Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. @@ -20,7 +20,7 @@ for-of39.ts(1,11): error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(iterable?: Iterable): Map', gave the following error. !!! error TS2769: Argument of type '([string, number] | [string, true])[]' 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<[string, number] | [string, true], any>' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorResult<[string, number] | [string, true], undefined>' is not assignable to type 'IteratorResult'. !!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, true]>' is not assignable to type 'IteratorResult'. !!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, true]>' is not assignable to type 'IteratorYieldResult'. !!! error TS2769: Type '[string, number] | [string, true]' is not assignable to type 'readonly [string, boolean]'. diff --git a/tests/baselines/reference/generatorReturnTypeInference.types b/tests/baselines/reference/generatorReturnTypeInference.types index fef5e85f57e4e..069154e78731f 100644 --- a/tests/baselines/reference/generatorReturnTypeInference.types +++ b/tests/baselines/reference/generatorReturnTypeInference.types @@ -34,7 +34,7 @@ function* g003() { // Generator >g003 : () => Generator yield* []; ->yield* [] : any +>yield* [] : undefined >[] : never[] } diff --git a/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.types b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.types index 1a4ccee855436..810d7472ae8c3 100644 --- a/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.types +++ b/tests/baselines/reference/generatorReturnTypeInferenceNonStrict.types @@ -36,7 +36,7 @@ function* g003() { // Generator // NOTE: In strict mode, `[]` produces the type `never[]`. // In non-strict mode, `[]` produces the type `undefined[]` which is implicitly any. yield* []; ->yield* [] : any +>yield* [] : undefined >[] : undefined[] } diff --git a/tests/baselines/reference/generatorTypeCheck19.types b/tests/baselines/reference/generatorTypeCheck19.types index 1ba4c4d2a5b44..9b69b9f7a40df 100644 --- a/tests/baselines/reference/generatorTypeCheck19.types +++ b/tests/baselines/reference/generatorTypeCheck19.types @@ -17,7 +17,7 @@ function* g(): IterableIterator { >yield : undefined yield * [new Bar]; ->yield * [new Bar] : any +>yield * [new Bar] : undefined >[new Bar] : Bar[] >new Bar : Bar >Bar : typeof Bar diff --git a/tests/baselines/reference/generatorTypeCheck20.types b/tests/baselines/reference/generatorTypeCheck20.types index 62f0620990fb2..463bea37da233 100644 --- a/tests/baselines/reference/generatorTypeCheck20.types +++ b/tests/baselines/reference/generatorTypeCheck20.types @@ -16,7 +16,7 @@ function* g(): IterableIterator { >yield : undefined yield * [new Baz]; ->yield * [new Baz] : any +>yield * [new Baz] : undefined >[new Baz] : Baz[] >new Baz : Baz >Baz : typeof Baz diff --git a/tests/baselines/reference/generatorTypeCheck22.types b/tests/baselines/reference/generatorTypeCheck22.types index 8db577d0039cc..e63be6d92188d 100644 --- a/tests/baselines/reference/generatorTypeCheck22.types +++ b/tests/baselines/reference/generatorTypeCheck22.types @@ -31,13 +31,13 @@ function* g3() { >Baz : typeof Baz yield *[new Bar]; ->yield *[new Bar] : any +>yield *[new Bar] : undefined >[new Bar] : Bar[] >new Bar : Bar >Bar : typeof Bar yield *[new Baz]; ->yield *[new Baz] : any +>yield *[new Baz] : undefined >[new Baz] : Baz[] >new Baz : Baz >Baz : typeof Baz diff --git a/tests/baselines/reference/generatorTypeCheck23.types b/tests/baselines/reference/generatorTypeCheck23.types index 30a25445fa745..851b6730f7f9f 100644 --- a/tests/baselines/reference/generatorTypeCheck23.types +++ b/tests/baselines/reference/generatorTypeCheck23.types @@ -36,13 +36,13 @@ function* g3() { >Baz : typeof Baz yield *[new Bar]; ->yield *[new Bar] : any +>yield *[new Bar] : undefined >[new Bar] : Bar[] >new Bar : Bar >Bar : typeof Bar yield *[new Baz]; ->yield *[new Baz] : any +>yield *[new Baz] : undefined >[new Baz] : Baz[] >new Baz : Baz >Baz : typeof Baz diff --git a/tests/baselines/reference/generatorTypeCheck24.types b/tests/baselines/reference/generatorTypeCheck24.types index 438db9562e055..8bfc4eaa7ca08 100644 --- a/tests/baselines/reference/generatorTypeCheck24.types +++ b/tests/baselines/reference/generatorTypeCheck24.types @@ -21,7 +21,7 @@ function* g3() { >yield : any yield * [new Foo]; ->yield * [new Foo] : any +>yield * [new Foo] : undefined >[new Foo] : Foo[] >new Foo : Foo >Foo : typeof Foo @@ -37,13 +37,13 @@ function* g3() { >Baz : typeof Baz yield *[new Bar]; ->yield *[new Bar] : any +>yield *[new Bar] : undefined >[new Bar] : Bar[] >new Bar : Bar >Bar : typeof Bar yield *[new Baz]; ->yield *[new Baz] : any +>yield *[new Baz] : undefined >[new Baz] : Baz[] >new Baz : Baz >Baz : typeof Baz diff --git a/tests/baselines/reference/generatorTypeCheck25.types b/tests/baselines/reference/generatorTypeCheck25.types index 5542432c60ee0..007585e9e2848 100644 --- a/tests/baselines/reference/generatorTypeCheck25.types +++ b/tests/baselines/reference/generatorTypeCheck25.types @@ -32,13 +32,13 @@ var g3: () => Iterable = function* () { >Baz : typeof Baz yield *[new Bar]; ->yield *[new Bar] : any +>yield *[new Bar] : undefined >[new Bar] : Bar[] >new Bar : Bar >Bar : typeof Bar yield *[new Baz]; ->yield *[new Baz] : any +>yield *[new Baz] : undefined >[new Baz] : Baz[] >new Baz : Baz >Baz : typeof Baz diff --git a/tests/baselines/reference/generatorTypeCheck26.types b/tests/baselines/reference/generatorTypeCheck26.types index 57a7fcf694d51..a97faf50b7c30 100644 --- a/tests/baselines/reference/generatorTypeCheck26.types +++ b/tests/baselines/reference/generatorTypeCheck26.types @@ -14,7 +14,7 @@ function* g(): IterableIterator<(x: string) => number> { >length : number yield *[x => x.length]; ->yield *[x => x.length] : any +>yield *[x => x.length] : undefined >[x => x.length] : ((x: string) => number)[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/generatorTypeCheck53.types b/tests/baselines/reference/generatorTypeCheck53.types index 060a677db7334..d1c2bbec8bfa4 100644 --- a/tests/baselines/reference/generatorTypeCheck53.types +++ b/tests/baselines/reference/generatorTypeCheck53.types @@ -18,7 +18,7 @@ function* g() { >Foo : typeof Foo yield* [new Baz]; ->yield* [new Baz] : any +>yield* [new Baz] : undefined >[new Baz] : Baz[] >new Baz : Baz >Baz : typeof Baz diff --git a/tests/baselines/reference/generatorTypeCheck54.types b/tests/baselines/reference/generatorTypeCheck54.types index e37a8d8dfd44c..f04f25b8529e1 100644 --- a/tests/baselines/reference/generatorTypeCheck54.types +++ b/tests/baselines/reference/generatorTypeCheck54.types @@ -13,13 +13,13 @@ function* g() { >g : () => Generator yield* [new Foo]; ->yield* [new Foo] : any +>yield* [new Foo] : undefined >[new Foo] : Foo[] >new Foo : Foo >Foo : typeof Foo yield* [new Baz]; ->yield* [new Baz] : any +>yield* [new Baz] : undefined >[new Baz] : Baz[] >new Baz : Baz >Baz : typeof Baz diff --git a/tests/baselines/reference/importHelpersNoHelpersForAsyncGenerators.types b/tests/baselines/reference/importHelpersNoHelpersForAsyncGenerators.types index 68e6fab174ffe..979bdedc4c1c3 100644 --- a/tests/baselines/reference/importHelpersNoHelpersForAsyncGenerators.types +++ b/tests/baselines/reference/importHelpersNoHelpersForAsyncGenerators.types @@ -13,7 +13,7 @@ export async function * f() { >2 : 2 yield* [3]; ->yield* [3] : any +>yield* [3] : undefined >[3] : number[] >3 : 3 } diff --git a/tests/baselines/reference/indirectGlobalSymbolPartOfObjectType.types b/tests/baselines/reference/indirectGlobalSymbolPartOfObjectType.types index fda5e3866855f..0e0d442155321 100644 --- a/tests/baselines/reference/indirectGlobalSymbolPartOfObjectType.types +++ b/tests/baselines/reference/indirectGlobalSymbolPartOfObjectType.types @@ -9,7 +9,7 @@ const Symbol = globalThis.Symbol; >Symbol : SymbolConstructor [][Symbol.iterator]; ->[][Symbol.iterator] : () => IterableIterator +>[][Symbol.iterator] : () => BuiltInIterableIterator >[] : undefined[] >Symbol.iterator : unique symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index 70bab6d9c7d0d..64ed24539485d 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -2,7 +2,7 @@ iterableArrayPattern28.ts(2,24): error TS2769: No overload matches this call. Overload 1 of 4, '(iterable?: Iterable): Map', gave the following error. Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable'. The types returned by '[Symbol.iterator]().next(...)' are incompatible between these types. - Type 'IteratorResult<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. + Type 'IteratorResult<[string, number] | [string, boolean], undefined>' is not assignable to type 'IteratorResult'. Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. @@ -21,7 +21,7 @@ iterableArrayPattern28.ts(2,24): error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 4, '(iterable?: Iterable): Map', gave the following error. !!! error TS2769: Argument of type '([string, number] | [string, boolean])[]' 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<[string, number] | [string, boolean], any>' is not assignable to type 'IteratorResult'. +!!! error TS2769: Type 'IteratorResult<[string, number] | [string, boolean], undefined>' is not assignable to type 'IteratorResult'. !!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult'. !!! error TS2769: Type 'IteratorYieldResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorYieldResult'. !!! error TS2769: Type '[string, number] | [string, boolean]' is not assignable to type 'readonly [string, number]'. diff --git a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt index 6dac97e6c4f8e..ab31e1d4e2294 100644 --- a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt +++ b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt @@ -1,4 +1,4 @@ -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[]; [Symbol.iterator]: () => IterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; }' but required in type 'number[]'. +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: () => BuiltInIterableIterator<[number, number]>; keys: () => BuiltInIterableIterator; values: () => BuiltInIterableIterator; 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]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; }' but required in type 'number[]'. ==== mappedTypeWithAsClauseAndLateBoundProperty.ts (1 errors) ==== @@ -6,6 +6,6 @@ mappedTypeWithAsClauseAndLateBoundProperty.ts(3,1): error TS2741: Property 'leng 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[]; [Symbol.iterator]: () => IterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; }' but required in type 'number[]'. +!!! 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: () => BuiltInIterableIterator<[number, number]>; keys: () => BuiltInIterableIterator; values: () => BuiltInIterableIterator; 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]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; }' but required in type 'number[]'. !!! related TS2728 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 4d9bf2b86fb35..56d9da812dcd5 100644 --- a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.types +++ b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.types @@ -5,10 +5,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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; } +>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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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: () => BuiltInIterableIterator<[number, number]>; keys: () => BuiltInIterableIterator; values: () => BuiltInIterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: 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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; } +>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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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: () => BuiltInIterableIterator<[number, number]>; keys: () => BuiltInIterableIterator; values: () => BuiltInIterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: 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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; } +>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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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: () => BuiltInIterableIterator<[number, number]>; keys: () => BuiltInIterableIterator; values: () => BuiltInIterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; } diff --git a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.js b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.js index 9bfc37222f9a8..70983cd9bfcd3 100644 --- a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.js +++ b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.js @@ -59,13 +59,13 @@ export declare const thing: { 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; + entries: () => BuiltInIterableIterator<[number, number]>; + keys: () => BuiltInIterableIterator; + values: () => BuiltInIterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; - [Symbol.iterator]: () => IterableIterator; + [Symbol.iterator]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; @@ -165,13 +165,13 @@ mappedTypeWithAsClauseAndLateBoundProperty2.d.ts(24,118): error TS2526: A 'this' 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; + entries: () => BuiltInIterableIterator<[number, number]>; + keys: () => BuiltInIterableIterator; + values: () => BuiltInIterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; - [Symbol.iterator]: () => IterableIterator; + [Symbol.iterator]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; diff --git a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.types b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.types index 0938c9402a3d6..cd6a0441796c0 100644 --- a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.types +++ b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty2.types @@ -2,8 +2,8 @@ === 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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: 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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: 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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => IterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; } +>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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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: () => BuiltInIterableIterator<[number, number]>; keys: () => BuiltInIterableIterator; values: () => BuiltInIterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: 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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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: () => BuiltInIterableIterator<[number, number]>; keys: () => BuiltInIterableIterator; values: () => BuiltInIterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: 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_1, thisArg?: any): S_1[]; (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_1, currentValue: number, currentIndex: number, array: number[]) => U_1, initialValue: U_1): U_1; }; 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_2, currentValue: number, currentIndex: number, array: number[]) => U_2, initialValue: U_2): U_2; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S_2, thisArg?: any): S_2; (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: () => BuiltInIterableIterator<[number, number]>; keys: () => BuiltInIterableIterator; values: () => BuiltInIterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[]; flat: (this: A, depth?: D) => FlatArray[]; [Symbol.iterator]: () => BuiltInIterableIterator; readonly [Symbol.unscopables]: { [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; splice?: boolean; unshift?: boolean; indexOf?: boolean; lastIndexOf?: boolean; every?: boolean; some?: boolean; forEach?: boolean; map?: boolean; filter?: boolean; reduce?: boolean; reduceRight?: boolean; find?: boolean; findIndex?: boolean; fill?: boolean; copyWithin?: boolean; entries?: boolean; keys?: boolean; values?: boolean; includes?: boolean; flatMap?: boolean; flat?: boolean; [Symbol.iterator]?: boolean; readonly [Symbol.unscopables]?: boolean; }; } >null as any : any diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types index 0f884c4ce16c4..d914f95c1934e 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions1.types @@ -37,10 +37,10 @@ m.clear(); // Using ES6 iterable m.keys(); ->m.keys() : IterableIterator ->m.keys : () => IterableIterator +>m.keys() : BuiltInIterableIterator +>m.keys : () => BuiltInIterableIterator >m : Map ->keys : () => IterableIterator +>keys : () => BuiltInIterableIterator // Using ES6 function function Baz() { } diff --git a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types index 37e1440f523be..a5c02bd12ab01 100644 --- a/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types +++ b/tests/baselines/reference/modularizeLibrary_NoErrorDuplicateLibOptions2.types @@ -37,10 +37,10 @@ m.clear(); // Using ES6 iterable m.keys(); ->m.keys() : IterableIterator ->m.keys : () => IterableIterator +>m.keys() : BuiltInIterableIterator +>m.keys : () => BuiltInIterableIterator >m : Map ->keys : () => IterableIterator +>keys : () => BuiltInIterableIterator // Using ES6 function function Baz() { } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types index 8a55354867061..0824209174c26 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES5UsingES6Lib.types @@ -37,10 +37,10 @@ m.clear(); // Using ES6 iterable m.keys(); ->m.keys() : IterableIterator ->m.keys : () => IterableIterator +>m.keys() : BuiltInIterableIterator +>m.keys : () => BuiltInIterableIterator >m : Map ->keys : () => IterableIterator +>keys : () => BuiltInIterableIterator // Using ES6 function function Baz() { } diff --git a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types index 53df319fe798a..010c102852ed0 100644 --- a/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types +++ b/tests/baselines/reference/modularizeLibrary_TargetES6UsingES6Lib.types @@ -37,10 +37,10 @@ m.clear(); // Using ES6 iterable m.keys(); ->m.keys() : IterableIterator ->m.keys : () => IterableIterator +>m.keys() : BuiltInIterableIterator +>m.keys : () => BuiltInIterableIterator >m : Map ->keys : () => IterableIterator +>keys : () => BuiltInIterableIterator // Using ES6 function function Baz() { } diff --git a/tests/baselines/reference/parser.asyncGenerators.classMethods.es2018.types b/tests/baselines/reference/parser.asyncGenerators.classMethods.es2018.types index f3c8c633c2472..04e4104186b6c 100644 --- a/tests/baselines/reference/parser.asyncGenerators.classMethods.es2018.types +++ b/tests/baselines/reference/parser.asyncGenerators.classMethods.es2018.types @@ -172,7 +172,7 @@ class C16 { >f : () => AsyncGenerator yield * []; ->yield * [] : any +>yield * [] : undefined >[] : undefined[] } } diff --git a/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.es2018.types b/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.es2018.types index 162edaf4ac972..96de924f5cd0c 100644 --- a/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.es2018.types +++ b/tests/baselines/reference/parser.asyncGenerators.functionDeclarations.es2018.types @@ -109,7 +109,7 @@ async function * f16() { >f16 : () => AsyncGenerator yield * []; ->yield * [] : any +>yield * [] : undefined >[] : undefined[] } === awaitWithValueIsOk.ts === diff --git a/tests/baselines/reference/parser.asyncGenerators.functionExpressions.es2018.types b/tests/baselines/reference/parser.asyncGenerators.functionExpressions.es2018.types index 48889e73fea1a..4fbf8715bbd05 100644 --- a/tests/baselines/reference/parser.asyncGenerators.functionExpressions.es2018.types +++ b/tests/baselines/reference/parser.asyncGenerators.functionExpressions.es2018.types @@ -138,7 +138,7 @@ const f16 = async function * () { >async function * () { yield * [];} : () => AsyncGenerator yield * []; ->yield * [] : any +>yield * [] : undefined >[] : undefined[] }; diff --git a/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.es2018.types b/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.es2018.types index d6768850e3925..1192d36efb319 100644 --- a/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.es2018.types +++ b/tests/baselines/reference/parser.asyncGenerators.objectLiteralMethods.es2018.types @@ -188,7 +188,7 @@ const o16 = { >f : () => AsyncGenerator yield * []; ->yield * [] : any +>yield * [] : undefined >[] : undefined[] } }; diff --git a/tests/baselines/reference/regexMatchAll-esnext.types b/tests/baselines/reference/regexMatchAll-esnext.types index 5d9872c0eb01f..0cada42cb950e 100644 --- a/tests/baselines/reference/regexMatchAll-esnext.types +++ b/tests/baselines/reference/regexMatchAll-esnext.types @@ -2,9 +2,9 @@ === regexMatchAll-esnext.ts === const matches = /\w/g[Symbol.matchAll]("matchAll"); ->matches : IterableIterator ->/\w/g[Symbol.matchAll]("matchAll") : IterableIterator ->/\w/g[Symbol.matchAll] : (str: string) => IterableIterator +>matches : BuiltInIterableIterator +>/\w/g[Symbol.matchAll]("matchAll") : BuiltInIterableIterator +>/\w/g[Symbol.matchAll] : (str: string) => BuiltInIterableIterator >/\w/g : RegExp >Symbol.matchAll : unique symbol >Symbol : SymbolConstructor @@ -15,7 +15,7 @@ const array = [...matches]; >array : RegExpMatchArray[] >[...matches] : RegExpMatchArray[] >...matches : RegExpMatchArray ->matches : IterableIterator +>matches : BuiltInIterableIterator const { index, input } = array[0]; >index : number diff --git a/tests/baselines/reference/regexMatchAll.types b/tests/baselines/reference/regexMatchAll.types index 311b26b931bdf..17339af2bf334 100644 --- a/tests/baselines/reference/regexMatchAll.types +++ b/tests/baselines/reference/regexMatchAll.types @@ -2,9 +2,9 @@ === regexMatchAll.ts === const matches = /\w/g[Symbol.matchAll]("matchAll"); ->matches : IterableIterator ->/\w/g[Symbol.matchAll]("matchAll") : IterableIterator ->/\w/g[Symbol.matchAll] : (str: string) => IterableIterator +>matches : BuiltInIterableIterator +>/\w/g[Symbol.matchAll]("matchAll") : BuiltInIterableIterator +>/\w/g[Symbol.matchAll] : (str: string) => BuiltInIterableIterator >/\w/g : RegExp >Symbol.matchAll : unique symbol >Symbol : SymbolConstructor @@ -15,7 +15,7 @@ const array = [...matches]; >array : RegExpMatchArray[] >[...matches] : RegExpMatchArray[] >...matches : RegExpMatchArray ->matches : IterableIterator +>matches : BuiltInIterableIterator const { index, input } = array[0]; >index : number diff --git a/tests/baselines/reference/stringMatchAll.types b/tests/baselines/reference/stringMatchAll.types index 59c112f5016a6..9e396d3bf5f25 100644 --- a/tests/baselines/reference/stringMatchAll.types +++ b/tests/baselines/reference/stringMatchAll.types @@ -2,18 +2,18 @@ === stringMatchAll.ts === const matches = "matchAll".matchAll(/\w/g); ->matches : IterableIterator ->"matchAll".matchAll(/\w/g) : IterableIterator ->"matchAll".matchAll : (regexp: RegExp) => IterableIterator +>matches : BuiltInIterableIterator +>"matchAll".matchAll(/\w/g) : BuiltInIterableIterator +>"matchAll".matchAll : (regexp: RegExp) => BuiltInIterableIterator >"matchAll" : "matchAll" ->matchAll : (regexp: RegExp) => IterableIterator +>matchAll : (regexp: RegExp) => BuiltInIterableIterator >/\w/g : RegExp const array = [...matches]; >array : RegExpMatchArray[] >[...matches] : RegExpMatchArray[] >...matches : RegExpMatchArray ->matches : IterableIterator +>matches : BuiltInIterableIterator const { index, input } = array[0]; >index : number diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.1.types b/tests/baselines/reference/types.asyncGenerators.es2018.1.types index 1dab8448cf487..f74188d86a980 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.1.types +++ b/tests/baselines/reference/types.asyncGenerators.es2018.1.types @@ -47,7 +47,7 @@ async function * inferReturnType6() { >inferReturnType6 : () => AsyncGenerator yield* [1, 2]; ->yield* [1, 2] : any +>yield* [1, 2] : undefined >[1, 2] : number[] >1 : 1 >2 : 2 @@ -56,7 +56,7 @@ async function * inferReturnType7() { >inferReturnType7 : () => AsyncGenerator yield* [Promise.resolve(1)]; ->yield* [Promise.resolve(1)] : any +>yield* [Promise.resolve(1)] : undefined >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise >Promise.resolve : { (): Promise; (value: T): Promise>; (value: T_1 | PromiseLike): Promise>; } @@ -102,7 +102,7 @@ const assignability3: () => AsyncIterableIterator = async function * () >async function * () { yield* [1, 2];} : () => AsyncGenerator yield* [1, 2]; ->yield* [1, 2] : any +>yield* [1, 2] : undefined >[1, 2] : number[] >1 : 1 >2 : 2 @@ -113,7 +113,7 @@ const assignability4: () => AsyncIterableIterator = async function * () >async function * () { yield* [Promise.resolve(1)];} : () => AsyncGenerator yield* [Promise.resolve(1)]; ->yield* [Promise.resolve(1)] : any +>yield* [Promise.resolve(1)] : undefined >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise >Promise.resolve : { (): Promise; (value: T): Promise>; (value: T_1 | PromiseLike): Promise>; } @@ -162,7 +162,7 @@ const assignability8: () => AsyncIterable = async function * () { >async function * () { yield* [1, 2];} : () => AsyncGenerator yield* [1, 2]; ->yield* [1, 2] : any +>yield* [1, 2] : undefined >[1, 2] : number[] >1 : 1 >2 : 2 @@ -173,7 +173,7 @@ const assignability9: () => AsyncIterable = async function * () { >async function * () { yield* [Promise.resolve(1)];} : () => AsyncGenerator yield* [Promise.resolve(1)]; ->yield* [Promise.resolve(1)] : any +>yield* [Promise.resolve(1)] : undefined >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise >Promise.resolve : { (): Promise; (value: T): Promise>; (value: T_1 | PromiseLike): Promise>; } @@ -222,7 +222,7 @@ const assignability13: () => AsyncIterator = async function * () { >async function * () { yield* [1, 2];} : () => AsyncGenerator yield* [1, 2]; ->yield* [1, 2] : any +>yield* [1, 2] : undefined >[1, 2] : number[] >1 : 1 >2 : 2 @@ -233,7 +233,7 @@ const assignability14: () => AsyncIterator = async function * () { >async function * () { yield* [Promise.resolve(1)];} : () => AsyncGenerator yield* [Promise.resolve(1)]; ->yield* [Promise.resolve(1)] : any +>yield* [Promise.resolve(1)] : undefined >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise >Promise.resolve : { (): Promise; (value: T): Promise>; (value: T_1 | PromiseLike): Promise>; } @@ -277,7 +277,7 @@ async function * explicitReturnType3(): AsyncIterableIterator { >explicitReturnType3 : () => AsyncIterableIterator yield* [1, 2]; ->yield* [1, 2] : any +>yield* [1, 2] : undefined >[1, 2] : number[] >1 : 1 >2 : 2 @@ -286,7 +286,7 @@ async function * explicitReturnType4(): AsyncIterableIterator { >explicitReturnType4 : () => AsyncIterableIterator yield* [Promise.resolve(1)]; ->yield* [Promise.resolve(1)] : any +>yield* [Promise.resolve(1)] : undefined >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise >Promise.resolve : { (): Promise; (value: T): Promise>; (value: T_1 | PromiseLike): Promise>; } @@ -327,7 +327,7 @@ async function * explicitReturnType8(): AsyncIterable { >explicitReturnType8 : () => AsyncIterable yield* [1, 2]; ->yield* [1, 2] : any +>yield* [1, 2] : undefined >[1, 2] : number[] >1 : 1 >2 : 2 @@ -336,7 +336,7 @@ async function * explicitReturnType9(): AsyncIterable { >explicitReturnType9 : () => AsyncIterable yield* [Promise.resolve(1)]; ->yield* [Promise.resolve(1)] : any +>yield* [Promise.resolve(1)] : undefined >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise >Promise.resolve : { (): Promise; (value: T): Promise>; (value: T_1 | PromiseLike): Promise>; } @@ -377,7 +377,7 @@ async function * explicitReturnType13(): AsyncIterator { >explicitReturnType13 : () => AsyncIterator yield* [1, 2]; ->yield* [1, 2] : any +>yield* [1, 2] : undefined >[1, 2] : number[] >1 : 1 >2 : 2 @@ -386,7 +386,7 @@ async function * explicitReturnType14(): AsyncIterator { >explicitReturnType14 : () => AsyncIterator yield* [Promise.resolve(1)]; ->yield* [Promise.resolve(1)] : any +>yield* [Promise.resolve(1)] : undefined >[Promise.resolve(1)] : Promise[] >Promise.resolve(1) : Promise >Promise.resolve : { (): Promise; (value: T): Promise>; (value: T_1 | PromiseLike): Promise>; } diff --git a/tests/baselines/reference/types.asyncGenerators.es2018.2.types b/tests/baselines/reference/types.asyncGenerators.es2018.2.types index 915189c840378..275e92f3bd36e 100644 --- a/tests/baselines/reference/types.asyncGenerators.es2018.2.types +++ b/tests/baselines/reference/types.asyncGenerators.es2018.2.types @@ -43,7 +43,7 @@ const assignability2: () => AsyncIterableIterator = async function * () >async function * () { yield* ["a", "b"];} : () => AsyncGenerator yield* ["a", "b"]; ->yield* ["a", "b"] : any +>yield* ["a", "b"] : undefined >["a", "b"] : string[] >"a" : "a" >"b" : "b" @@ -76,7 +76,7 @@ const assignability5: () => AsyncIterable = async function * () { >async function * () { yield* ["a", "b"];} : () => AsyncGenerator yield* ["a", "b"]; ->yield* ["a", "b"] : any +>yield* ["a", "b"] : undefined >["a", "b"] : string[] >"a" : "a" >"b" : "b" @@ -109,7 +109,7 @@ const assignability8: () => AsyncIterator = async function * () { >async function * () { yield* ["a", "b"];} : () => AsyncGenerator yield* ["a", "b"]; ->yield* ["a", "b"] : any +>yield* ["a", "b"] : undefined >["a", "b"] : string[] >"a" : "a" >"b" : "b" @@ -139,7 +139,7 @@ async function * explicitReturnType2(): AsyncIterableIterator { >explicitReturnType2 : () => AsyncIterableIterator yield* ["a", "b"]; ->yield* ["a", "b"] : any +>yield* ["a", "b"] : undefined >["a", "b"] : string[] >"a" : "a" >"b" : "b" @@ -166,7 +166,7 @@ async function * explicitReturnType5(): AsyncIterable { >explicitReturnType5 : () => AsyncIterable yield* ["a", "b"]; ->yield* ["a", "b"] : any +>yield* ["a", "b"] : undefined >["a", "b"] : string[] >"a" : "a" >"b" : "b" @@ -193,7 +193,7 @@ async function * explicitReturnType8(): AsyncIterator { >explicitReturnType8 : () => AsyncIterator yield* ["a", "b"]; ->yield* ["a", "b"] : any +>yield* ["a", "b"] : undefined >["a", "b"] : string[] >"a" : "a" >"b" : "b" diff --git a/tests/baselines/reference/yieldExpressionInControlFlow.types b/tests/baselines/reference/yieldExpressionInControlFlow.types index b4a31e9f9fa97..a4f1a01fb92c5 100644 --- a/tests/baselines/reference/yieldExpressionInControlFlow.types +++ b/tests/baselines/reference/yieldExpressionInControlFlow.types @@ -21,7 +21,7 @@ function* f() { === alsoFails.ts === // fails in Typescript too function* g() { ->g : () => Generator +>g : () => Generator var o = [] >o : any[] @@ -31,10 +31,10 @@ function* g() { >true : true o = yield* o ->o = yield* o : any +>o = yield* o : undefined +>o : any[] +>yield* o : undefined >o : any[] ->yield* o : any ->o : any } } diff --git a/tests/baselines/reference/yieldExpressionInnerCommentEmit.types b/tests/baselines/reference/yieldExpressionInnerCommentEmit.types index 226e8de48b163..3d402dcae47bf 100644 --- a/tests/baselines/reference/yieldExpressionInnerCommentEmit.types +++ b/tests/baselines/reference/yieldExpressionInnerCommentEmit.types @@ -17,12 +17,12 @@ function * foo2() { >3 : 3 yield */*comment4*/ [4]; ->yield */*comment4*/ [4] : any +>yield */*comment4*/ [4] : undefined >[4] : number[] >4 : 4 yield /*comment5*/* [5]; ->yield /*comment5*/* [5] : any +>yield /*comment5*/* [5] : undefined >[5] : number[] >5 : 5 }