Merge branch 'master' into report-multiple-overload-errors

This commit is contained in:
Nathan Shively-Sanders
2019-07-08 09:33:24 -07:00
298 changed files with 5748 additions and 2209 deletions
+2 -2
View File
@@ -427,8 +427,8 @@ namespace ts.BuilderState {
const references = state.referencedMap.get(path);
if (references) {
const iterator = references.keys();
for (let { value, done } = iterator.next(); !done; { value, done } = iterator.next()) {
queue.push(value as Path);
for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) {
queue.push(iterResult.value as Path);
}
}
}
+860 -350
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -40,6 +40,7 @@ namespace ts {
["es2017.string", "lib.es2017.string.d.ts"],
["es2017.intl", "lib.es2017.intl.d.ts"],
["es2017.typedarrays", "lib.es2017.typedarrays.d.ts"],
["es2018.asyncgenerator", "lib.es2018.asyncgenerator.d.ts"],
["es2018.asynciterable", "lib.es2018.asynciterable.d.ts"],
["es2018.intl", "lib.es2018.intl.d.ts"],
["es2018.promise", "lib.es2018.promise.d.ts"],
@@ -1899,7 +1900,9 @@ namespace ts {
case "object":
return {};
default:
return option.type.keys().next().value;
const iterResult = option.type.keys().next();
if (!iterResult.done) return iterResult.value;
return Debug.fail("Expected 'option.type' to have entries.");
}
}
+15 -14
View File
@@ -24,7 +24,6 @@ namespace ts {
" __sortedArrayBrand": any;
}
/** ES6 Map interface, only read methods included. */
export interface ReadonlyMap<T> {
get(key: string): T | undefined;
@@ -45,7 +44,7 @@ namespace ts {
/** ES6 Iterator type. */
export interface Iterator<T> {
next(): { value: T, done: false } | { value: never, done: true };
next(): { value: T, done?: false } | { value: never, done: true };
}
/** Array that is only intended to be pushed to, never read. */
@@ -297,12 +296,13 @@ namespace ts {
forEach(action: (value: T, key: string) => void): void {
const iterator = this.entries();
while (true) {
const { value: entry, done } = iterator.next();
if (done) {
const iterResult = iterator.next();
if (iterResult.done) {
break;
}
action(entry[1], entry[0]);
const [key, value] = iterResult.value;
action(value, key);
}
}
};
@@ -346,11 +346,11 @@ namespace ts {
export function firstDefinedIterator<T, U>(iter: Iterator<T>, callback: (element: T) => U | undefined): U | undefined {
while (true) {
const { value, done } = iter.next();
if (done) {
const iterResult = iter.next();
if (iterResult.done) {
return undefined;
}
const result = callback(value);
const result = callback(iterResult.value);
if (result !== undefined) {
return result;
}
@@ -375,7 +375,7 @@ namespace ts {
return { value: undefined as never, done: true };
}
i++;
return { value: [arrayA[i - 1], arrayB[i - 1]], done: false };
return { value: [arrayA[i - 1], arrayB[i - 1]] as [T, U], done: false };
}
};
}
@@ -567,7 +567,7 @@ namespace ts {
return {
next() {
const iterRes = iter.next();
return iterRes.done ? iterRes : { value: mapFn(iterRes.value), done: false };
return iterRes.done ? iterRes as { done: true, value: never } : { value: mapFn(iterRes.value), done: false };
}
};
}
@@ -672,7 +672,7 @@ namespace ts {
}
const iterRes = iter.next();
if (iterRes.done) {
return iterRes;
return iterRes as { done: true, value: never };
}
currentIter = getIterator(iterRes.value);
}
@@ -747,7 +747,7 @@ namespace ts {
while (true) {
const res = iter.next();
if (res.done) {
return res;
return res as { done: true, value: never };
}
const value = mapFn(res.value);
if (value !== undefined) {
@@ -1072,6 +1072,7 @@ namespace ts {
* @param value The value to append to the array. If `value` is `undefined`, nothing is
* appended.
*/
export function append<TArray extends any[] | undefined, TValue extends NonNullable<TArray>[number] | undefined>(to: TArray, value: TValue): [undefined, undefined] extends [TArray, TValue] ? TArray : NonNullable<TArray>[number][];
export function append<T>(to: T[], value: T | undefined): T[];
export function append<T>(to: T[] | undefined, value: T): T[];
export function append<T>(to: T[] | undefined, value: T | undefined): T[] | undefined;
@@ -1396,8 +1397,8 @@ namespace ts {
export function arrayFrom<T>(iterator: Iterator<T> | IterableIterator<T>): T[];
export function arrayFrom<T, U>(iterator: Iterator<T> | IterableIterator<T>, map?: (t: T) => U): (T | U)[] {
const result: (T | U)[] = [];
for (let { value, done } = iterator.next(); !done; { value, done } = iterator.next()) {
result.push(map ? map(value) : value);
for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) {
result.push(map ? map(iterResult.value) : iterResult.value);
}
return result;
}
+36 -7
View File
@@ -1764,7 +1764,7 @@
"category": "Error",
"code": 2489
},
"The type returned by the 'next()' method of an iterator must have a 'value' property.": {
"The type returned by the '{0}()' method of an iterator must have a 'value' property.": {
"category": "Error",
"code": 2490
},
@@ -1992,7 +1992,7 @@
"category": "Error",
"code": 2546
},
"The type returned by the 'next()' method of an async iterator must be a promise for a type with a 'value' property.": {
"The type returned by the '{0}()' method of an async iterator must be a promise for a type with a 'value' property.": {
"category": "Error",
"code": 2547
},
@@ -2653,22 +2653,46 @@
"category": "Error",
"code": 2762
},
"No overload matches this call.": {
"Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'.": {
"category": "Error",
"code": 2763
},
"The last overload gave the following error.": {
"Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'.": {
"category": "Error",
"code": 2764
},
"The last overload is declared here.": {
"Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'.": {
"category": "Error",
"code": 2765
},
"Overload {0} of {1}, '{2}', gave the following error.": {
"Cannot delegate iteration to value because the 'next' method of its iterator expects type '{1}', but the containing generator will always send '{0}'.": {
"category": "Error",
"code": 2766
},
"The '{0}' property of an iterator must be a method.": {
"category": "Error",
"code": 2767
},
"The '{0}' property of an async iterator must be a method.": {
"category": "Error",
"code": 2768
},
"No overload matches this call.": {
"category": "Error",
"code": 2769
},
"The last overload gave the following error.": {
"category": "Error",
"code": 2770
},
"The last overload is declared here.": {
"category": "Error",
"code": 2771
},
"Overload {0} of {1}, '{2}', gave the following error.": {
"category": "Error",
"code": 2772
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
@@ -4230,7 +4254,7 @@
"category": "Error",
"code": 7024
},
"Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type.": {
"Generator implicitly has yield type '{0}' because it does not yield any values. Consider supplying a return type annotation.": {
"category": "Error",
"code": 7025
},
@@ -4352,6 +4376,11 @@
"category": "Error",
"code": 7054
},
"'{0}', which lacks return-type annotation, implicitly has an '{1}' yield type.": {
"category": "Error",
"code": 7055
},
"You cannot rename this element.": {
"category": "Error",
"code": 8000
+2 -1
View File
@@ -148,7 +148,8 @@ namespace ts {
const sourceIndexToNewSourceIndexMap: number[] = [];
let nameIndexToNewNameIndexMap: number[] | undefined;
const mappingIterator = decodeMappings(map.mappings);
for (let { value: raw, done } = mappingIterator.next(); !done; { value: raw, done } = mappingIterator.next()) {
for (let iterResult = mappingIterator.next(); !iterResult.done; iterResult = mappingIterator.next()) {
const raw = iterResult.value;
if (end && (
raw.generatedLine > end.line ||
(raw.generatedLine === end.line && raw.generatedCharacter > end.character))) {
+14 -4
View File
@@ -4273,13 +4273,23 @@ namespace ts {
regularType: ResolvedType; // Regular version of fresh type
}
/* @internal */
export interface IterationTypes {
readonly yieldType: Type;
readonly returnType: Type;
readonly nextType: Type;
}
// Just a place to cache element types of iterables and iterators
/* @internal */
export interface IterableOrIteratorType extends ObjectType, UnionType {
iteratedTypeOfIterable?: Type;
iteratedTypeOfIterator?: Type;
iteratedTypeOfAsyncIterable?: Type;
iteratedTypeOfAsyncIterator?: Type;
iterationTypesOfGeneratorReturnType?: IterationTypes;
iterationTypesOfAsyncGeneratorReturnType?: IterationTypes;
iterationTypesOfIterable?: IterationTypes;
iterationTypesOfIterator?: IterationTypes;
iterationTypesOfAsyncIterable?: IterationTypes;
iterationTypesOfAsyncIterator?: IterationTypes;
iterationTypesOfIteratorResult?: IterationTypes;
}
/* @internal */
+4 -4
View File
@@ -150,8 +150,8 @@ namespace ts {
export function forEachEntry<T, U>(map: ReadonlyMap<T>, callback: (value: T, key: string) => U | undefined): U | undefined;
export function forEachEntry<T, U>(map: ReadonlyUnderscoreEscapedMap<T> | ReadonlyMap<T>, callback: (value: T, key: (string & __String)) => U | undefined): U | undefined {
const iterator = map.entries();
for (let { value: pair, done } = iterator.next(); !done; { value: pair, done } = iterator.next()) {
const [key, value] = pair;
for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) {
const [key, value] = iterResult.value;
const result = callback(value, key as (string & __String));
if (result) {
return result;
@@ -165,8 +165,8 @@ namespace ts {
export function forEachKey<T>(map: ReadonlyMap<{}>, callback: (key: string) => T | undefined): T | undefined;
export function forEachKey<T>(map: ReadonlyUnderscoreEscapedMap<{}> | ReadonlyMap<{}>, callback: (key: string & __String) => T | undefined): T | undefined {
const iterator = map.keys();
for (let { value: key, done } = iterator.next(); !done; { value: key, done } = iterator.next()) {
const result = callback(key as string & __String);
for (let iterResult = iterator.next(); !iterResult.done; iterResult = iterator.next()) {
const result = callback(iterResult.value as string & __String);
if (result) {
return result;
}
+4 -2
View File
@@ -301,7 +301,8 @@ namespace Harness.SourceMapRecorder {
SourceMapSpanWriter.initializeSourceMapSpanWriter(sourceMapRecorder, sourceMapData.sourceMap, currentFile);
const mapper = ts.decodeMappings(sourceMapData.sourceMap.mappings);
for (let { value: decodedSourceMapping, done } = mapper.next(); !done; { value: decodedSourceMapping, done } = mapper.next()) {
for (let iterResult = mapper.next(); !iterResult.done; iterResult = mapper.next()) {
const decodedSourceMapping = iterResult.value;
const currentSourceFile = ts.isSourceMapping(decodedSourceMapping)
? program.getSourceFile(sourceMapData.inputSourceFileNames[decodedSourceMapping.sourceIndex])
: undefined;
@@ -335,7 +336,8 @@ namespace Harness.SourceMapRecorder {
SourceMapSpanWriter.initializeSourceMapSpanWriter(sourceMapRecorder, sourceMap, currentFile);
const mapper = ts.decodeMappings(sourceMap.mappings);
for (let { value: decodedSourceMapping, done } = mapper.next(); !done; { value: decodedSourceMapping, done } = mapper.next()) {
for (let iterResult = mapper.next(); !iterResult.done; iterResult = mapper.next()) {
const decodedSourceMapping = iterResult.value;
const currentSourceFile = ts.isSourceMapping(decodedSourceMapping)
? getFile(sourceFileAbsolutePaths[decodedSourceMapping.sourceIndex])
: undefined;
+2 -2
View File
@@ -683,7 +683,7 @@ namespace vfs {
if (isDirectory(node)) throw createIOError("EISDIR");
if (!isFile(node)) throw createIOError("EBADF");
node.buffer = Buffer.isBuffer(data) ? data.slice() : ts.sys.bufferFrom!("" + data, encoding || "utf8");
node.buffer = Buffer.isBuffer(data) ? data.slice() : ts.sys.bufferFrom!("" + data, encoding || "utf8") as Buffer;
node.size = node.buffer.byteLength;
node.mtimeMs = time;
node.ctimeMs = time;
@@ -1204,7 +1204,7 @@ namespace vfs {
}
},
readFileSync(path: string): Buffer {
return ts.sys.bufferFrom!(host.readFile(path)!, "utf8"); // TODO: GH#18217
return ts.sys.bufferFrom!(host.readFile(path)!, "utf8") as Buffer; // TODO: GH#18217
}
};
}
+9 -1
View File
@@ -1,4 +1,12 @@
interface Generator extends Iterator<any> { }
/// <reference lib="es2015.iterable" />
interface Generator<T = unknown, TReturn = any, TNext = unknown> extends Iterator<T, TReturn, TNext> {
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
return(value: TReturn): IteratorResult<T, TReturn>;
throw(e: any): IteratorResult<T, TReturn>;
[Symbol.iterator](): Generator<T, TReturn, TNext>;
}
interface GeneratorFunction {
/**
+15 -7
View File
@@ -8,15 +8,23 @@ interface SymbolConstructor {
readonly iterator: symbol;
}
interface IteratorResult<T> {
done: boolean;
value: T;
interface IteratorYieldResult<TYield> {
done?: false;
value: TYield;
}
interface Iterator<T> {
next(value?: any): IteratorResult<T>;
return?(value?: any): IteratorResult<T>;
throw?(e?: any): IteratorResult<T>;
interface IteratorReturnResult<TReturn> {
done: true;
value: TReturn;
}
type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
interface Iterator<T, TReturn = any, TNext = undefined> {
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
return?(value?: TReturn): IteratorResult<T, TReturn>;
throw?(e?: any): IteratorResult<T, TReturn>;
}
interface Iterable<T> {
+59
View File
@@ -0,0 +1,59 @@
/// <reference lib="es2018.asynciterable" />
interface AsyncGenerator<T = unknown, TReturn = any, TNext = unknown> extends AsyncIterator<T, TReturn, TNext> {
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
next(...args: [] | [TNext | PromiseLike<TNext>]): Promise<IteratorResult<T, TReturn>>;
return(value: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
throw(e: any): Promise<IteratorResult<T, TReturn>>;
[Symbol.asyncIterator](): AsyncGenerator<T, TReturn, TNext>;
}
interface AsyncGeneratorFunction {
/**
* Creates a new AsyncGenerator object.
* @param args A list of arguments the function accepts.
*/
new (...args: any[]): AsyncGenerator;
/**
* Creates a new AsyncGenerator object.
* @param args A list of arguments the function accepts.
*/
(...args: any[]): AsyncGenerator;
/**
* The length of the arguments.
*/
readonly length: number;
/**
* Returns the name of the function.
*/
readonly name: string;
/**
* A reference to the prototype.
*/
readonly prototype: AsyncGenerator;
}
interface AsyncGeneratorFunctionConstructor {
/**
* Creates a new AsyncGenerator function.
* @param args A list of arguments the function accepts.
*/
new (...args: string[]): AsyncGeneratorFunction;
/**
* Creates a new AsyncGenerator function.
* @param args A list of arguments the function accepts.
*/
(...args: string[]): AsyncGeneratorFunction;
/**
* The length of the arguments.
*/
readonly length: number;
/**
* Returns the name of the function.
*/
readonly name: string;
/**
* A reference to the prototype.
*/
readonly prototype: AsyncGeneratorFunction;
}
+5 -4
View File
@@ -9,10 +9,11 @@ interface SymbolConstructor {
readonly asyncIterator: symbol;
}
interface AsyncIterator<T> {
next(value?: any): Promise<IteratorResult<T>>;
return?(value?: any): Promise<IteratorResult<T>>;
throw?(e?: any): Promise<IteratorResult<T>>;
interface AsyncIterator<T, TReturn = any, TNext = undefined> {
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
next(...args: [] | [TNext | PromiseLike<TNext>]): Promise<IteratorResult<T, TReturn>>;
return?(value?: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
throw?(e?: any): Promise<IteratorResult<T, TReturn>>;
}
interface AsyncIterable<T> {
+1
View File
@@ -1,4 +1,5 @@
/// <reference lib="es2017" />
/// <reference lib="es2018.asyncgenerator" />
/// <reference lib="es2018.asynciterable" />
/// <reference lib="es2018.promise" />
/// <reference lib="es2018.regexp" />
+1
View File
@@ -31,6 +31,7 @@
"es2017.string",
"es2017.intl",
"es2017.typedarrays",
"es2018.asyncgenerator",
"es2018.asynciterable",
"es2018.regexp",
"es2018.promise",
+9 -6
View File
@@ -2832,8 +2832,9 @@ namespace ts.server {
let assignOrphanScriptInfosToInferredProject = false;
if (openFiles) {
while (true) {
const { value: file, done } = openFiles.next();
if (done) break;
const iterResult = openFiles.next();
if (iterResult.done) break;
const file = iterResult.value;
const scriptInfo = this.getScriptInfo(file.fileName);
Debug.assert(!scriptInfo || !scriptInfo.isScriptOpen(), "Script should not exist and not be open already");
// Create script infos so we have the new content for all the open files before we do any updates to projects
@@ -2850,8 +2851,9 @@ namespace ts.server {
if (changedFiles) {
while (true) {
const { value: file, done } = changedFiles.next();
if (done) break;
const iterResult = changedFiles.next();
if (iterResult.done) break;
const file = iterResult.value;
const scriptInfo = this.getScriptInfo(file.fileName)!;
Debug.assert(!!scriptInfo);
// Make edits to script infos and marks containing project as dirty
@@ -2887,8 +2889,9 @@ namespace ts.server {
/* @internal */
applyChangesToFile(scriptInfo: ScriptInfo, changes: Iterator<TextChange>) {
while (true) {
const { value: change, done } = changes.next();
if (done) break;
const iterResult = changes.next();
if (iterResult.done) break;
const change = iterResult.value;
scriptInfo.editContent(change.span.start, change.span.start + change.span.length, change.newText);
}
}
+2 -2
View File
@@ -295,8 +295,8 @@ namespace Harness.Parallel.Host {
worker.accumulatedOutput += d.toString();
console.log(`[Worker ${i}]`, d.toString());
};
worker.process.stderr.on("data", appendOutput);
worker.process.stdout.on("data", appendOutput);
worker.process.stderr!.on("data", appendOutput);
worker.process.stdout!.on("data", appendOutput);
const killChild = (timeout: TaskTimeout) => {
worker.process.kill();
console.error(`Worker exceeded ${timeout.duration}ms timeout ${worker.currentTasks && worker.currentTasks.length ? `while running test '${worker.currentTasks[0].file}'.` : `during test setup.`}`);
@@ -57,7 +57,7 @@ namespace ts {
assertParseResult(["--lib", "es5,invalidOption", "0.ts"],
{
errors: [{
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.",
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
file: undefined,
@@ -259,7 +259,7 @@ namespace ts {
assertParseResult(["--lib", "es5,", "es7", "0.ts"],
{
errors: [{
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.",
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
file: undefined,
@@ -278,7 +278,7 @@ namespace ts {
assertParseResult(["--lib", "es5, ", "es7", "0.ts"],
{
errors: [{
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.",
messageText: "Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'esnext', 'dom', 'dom.iterable', 'webworker', 'webworker.importscripts', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2020.string', 'es2020.symbol.wellknown', 'esnext.array', 'esnext.symbol', 'esnext.asynciterable', 'esnext.intl', 'esnext.bigint'.",
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
file: undefined,
@@ -134,7 +134,9 @@ namespace ts {
break;
}
default: {
const val = option.type.keys().next().value;
const iterResult = option.type.keys().next();
if (iterResult.done) return Debug.fail("Expected 'option.type' to have entries");
const val = iterResult.value;
if (option.isTSConfigOnly) {
args = ["-p", "tsconfig.json"];
configObject = { compilerOptions: { [option.name]: val } };
+4 -3
View File
@@ -68,12 +68,13 @@ namespace ts {
// Use an iterator.
const iterator = map.entries();
while (true) {
const { value: tuple, done } = iterator.next();
if (done) {
const iterResult = iterator.next();
if (iterResult.done) {
break;
}
doForEach(tuple[1], tuple[0]);
const [key, value] = iterResult.value;
doForEach(value, key);
}
}
+5 -2
View File
@@ -438,10 +438,13 @@ namespace ts.projectSystem {
export function configuredProjectAt(projectService: server.ProjectService, index: number) {
const values = projectService.configuredProjects.values();
while (index > 0) {
values.next();
const iterResult = values.next();
if (iterResult.done) return Debug.fail("Expected a result.");
index--;
}
return values.next().value;
const iterResult = values.next();
if (iterResult.done) return Debug.fail("Expected a result.");
return iterResult.value;
}
export function checkProjectActualFiles(project: server.Project, expectedFiles: ReadonlyArray<string>) {
+1 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"pretty": true,
"lib": ["es2015.iterable", "es5"],
"lib": ["es2015.iterable", "es2015.generator", "es5"],
"target": "es5",
"rootDir": ".",
@@ -1,4 +1,4 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts ===
function * yield() {
>yield : () => IterableIterator<any>
>yield : () => Generator<never, void, unknown>
}
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts ===
function * foo() {
>foo : () => IterableIterator<any>
>foo : () => Generator<never, void, unknown>
// Legal to use 'yield' in a type context.
var v: yield;
@@ -1,4 +1,4 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts ===
function * foo() {
>foo : () => IterableIterator<any>
>foo : () => Generator<never, void, unknown>
}
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts ===
function*foo(a = yield) {
>foo : (a?: any) => IterableIterator<any>
>foo : (a?: any) => Generator<never, void, unknown>
>a : any
>yield : any
}
@@ -1,10 +1,10 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts ===
function*bar() {
>bar : () => IterableIterator<any>
>bar : () => Generator<never, void, unknown>
// 'yield' here is an identifier, and not a yield expression.
function*foo(a = yield) {
>foo : (a?: any) => IterableIterator<any>
>foo : (a?: any) => Generator<never, void, unknown>
>a : any
>yield : any
}
@@ -1,11 +1,11 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts ===
function * foo() {
>foo : () => IterableIterator<any>
>foo : () => Generator<any, void, unknown>
var v = { [yield]: foo }
>v : { [x: number]: () => IterableIterator<any>; }
>{ [yield]: foo } : { [x: number]: () => IterableIterator<any>; }
>[yield] : () => IterableIterator<any>
>v : { [x: number]: () => Generator<any, void, unknown>; }
>{ [yield]: foo } : { [x: number]: () => Generator<any, void, unknown>; }
>[yield] : () => Generator<any, void, unknown>
>yield : any
>foo : () => IterableIterator<any>
>foo : () => Generator<any, void, unknown>
}
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts ===
var v = function * () { }
>v : () => IterableIterator<any>
>function * () { } : () => IterableIterator<any>
>v : () => Generator<never, void, unknown>
>function * () { } : () => Generator<never, void, unknown>
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts ===
var v = function * foo() { }
>v : () => IterableIterator<any>
>function * foo() { } : () => IterableIterator<any>
>foo : () => IterableIterator<any>
>v : () => Generator<never, void, unknown>
>function * foo() { } : () => Generator<never, void, unknown>
>foo : () => Generator<never, void, unknown>
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts ===
var v = { *foo() { } }
>v : { foo(): IterableIterator<any>; }
>{ *foo() { } } : { foo(): IterableIterator<any>; }
>foo : () => IterableIterator<any>
>v : { foo(): Generator<never, void, unknown>; }
>{ *foo() { } } : { foo(): Generator<never, void, unknown>; }
>foo : () => Generator<never, void, unknown>
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts ===
var v = { *() { } }
>v : { (Missing)(): IterableIterator<any>; }
>{ *() { } } : { (Missing)(): IterableIterator<any>; }
> : () => IterableIterator<any>
>v : { (Missing)(): Generator<never, void, unknown>; }
>{ *() { } } : { (Missing)(): Generator<never, void, unknown>; }
> : () => Generator<never, void, unknown>
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments3_es6.ts ===
var v = { *{ } }
>v : { (Missing)(): IterableIterator<any>; }
>{ *{ } } : { (Missing)(): IterableIterator<any>; }
> : () => IterableIterator<any>
>v : { (Missing)(): Generator<never, void, unknown>; }
>{ *{ } } : { (Missing)(): Generator<never, void, unknown>; }
> : () => Generator<never, void, unknown>
@@ -1,8 +1,8 @@
=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts ===
var v = { *[foo()]() { } }
>v : { [x: number]: () => IterableIterator<any>; }
>{ *[foo()]() { } } : { [x: number]: () => IterableIterator<any>; }
>[foo()] : () => IterableIterator<any>
>v : { [x: number]: () => Generator<never, void, unknown>; }
>{ *[foo()]() { } } : { [x: number]: () => Generator<never, void, unknown>; }
>[foo()] : () => Generator<never, void, unknown>
>foo() : any
>foo : any
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments6_es6.ts ===
var v = { *<T>() { } }
>v : { (Missing)<T>(): IterableIterator<any>; }
>{ *<T>() { } } : { (Missing)<T>(): IterableIterator<any>; }
> : <T>() => IterableIterator<any>
>v : { (Missing)<T>(): Generator<never, void, unknown>; }
>{ *<T>() { } } : { (Missing)<T>(): Generator<never, void, unknown>; }
> : <T>() => Generator<never, void, unknown>
@@ -3,5 +3,5 @@ class C {
>C : C
*foo() { }
>foo : () => IterableIterator<any>
>foo : () => Generator<never, void, unknown>
}
@@ -3,5 +3,5 @@ class C {
>C : C
public * foo() { }
>foo : () => IterableIterator<any>
>foo : () => Generator<never, void, unknown>
}
@@ -3,6 +3,6 @@ class C {
>C : C
*[foo]() { }
>[foo] : () => IterableIterator<any>
>[foo] : () => Generator<never, void, unknown>
>foo : any
}
@@ -3,5 +3,5 @@ class C {
>C : C
*() { }
> : () => IterableIterator<any>
> : () => Generator<never, void, unknown>
}
@@ -3,5 +3,5 @@ class C {
>C : C
*foo<T>() { }
>foo : <T>() => IterableIterator<any>
>foo : <T>() => Generator<never, void, unknown>
}
@@ -1,8 +1,8 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts ===
var v = { * foo() {
>v : { foo(): IterableIterator<any>; }
>{ * foo() { yield(foo); }} : { foo(): IterableIterator<any>; }
>foo : () => IterableIterator<any>
>v : { foo(): Generator<any, void, unknown>; }
>{ * foo() { yield(foo); }} : { foo(): Generator<any, void, unknown>; }
>foo : () => Generator<any, void, unknown>
yield(foo);
>yield(foo) : any
@@ -3,7 +3,7 @@ class C {
>C : C
*foo() {
>foo : () => IterableIterator<any>
>foo : () => Generator<any, void, unknown>
yield(foo);
>yield(foo) : any
@@ -1,5 +1,5 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts ===
function* foo() { yield }
>foo : () => IterableIterator<any>
>foo : () => Generator<any, void, unknown>
>yield : any
@@ -1,12 +1,12 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts ===
function* foo() {
>foo : () => IterableIterator<any>
>foo : () => Generator<never, void, unknown>
function bar() {
>bar : () => void
yield foo;
>yield foo : any
>foo : () => IterableIterator<any>
>foo : () => Generator<never, void, unknown>
}
}
@@ -1,17 +1,17 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts ===
function*foo() {
>foo : () => IterableIterator<any>
>foo : () => Generator<never, void, unknown>
function bar() {
>bar : () => void
function* quux() {
>quux : () => IterableIterator<() => IterableIterator<any>>
>quux : () => Generator<() => Generator<never, void, unknown>, void, unknown>
yield(foo);
>yield(foo) : any
>(foo) : () => IterableIterator<any>
>foo : () => IterableIterator<any>
>(foo) : () => Generator<never, void, unknown>
>foo : () => Generator<never, void, unknown>
}
}
}
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts ===
function* foo() {
>foo : () => IterableIterator<any>
>foo : () => Generator<any, void, unknown>
yield
>yield : any
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts ===
function* foo() {
>foo : () => IterableIterator<any>
>foo : () => Generator<any, void, unknown>
yield;
>yield : any
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression5_es6.ts ===
function* foo() {
>foo : () => IterableIterator<any>
>foo : () => Generator<any, void, any>
yield*
>yield* : any
@@ -1,8 +1,8 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts ===
function* foo() {
>foo : () => IterableIterator<typeof foo>
>foo : () => Generator<typeof foo, void, unknown>
yield foo
>yield foo : any
>foo : () => IterableIterator<typeof foo>
>foo : () => Generator<typeof foo, void, unknown>
}
@@ -2,13 +2,13 @@
yield(foo);
>yield(foo) : any
>yield : any
>foo : () => IterableIterator<typeof foo>
>foo : () => Generator<typeof foo, void, unknown>
function* foo() {
>foo : () => IterableIterator<typeof foo>
>foo : () => Generator<typeof foo, void, unknown>
yield(foo);
>yield(foo) : any
>(foo) : () => IterableIterator<typeof foo>
>foo : () => IterableIterator<typeof foo>
>(foo) : () => Generator<typeof foo, void, unknown>
>foo : () => Generator<typeof foo, void, unknown>
}
@@ -1,7 +1,7 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts ===
var v = function*() {
>v : () => IterableIterator<any>
>function*() { yield(foo);} : () => IterableIterator<any>
>v : () => Generator<any, void, unknown>
>function*() { yield(foo);} : () => Generator<any, void, unknown>
yield(foo);
>yield(foo) : any
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression3_es6.ts ===
function *g() {
>g : () => IterableIterator<any>
>g : () => Generator<any, void, any>
yield *;
>yield * : any
@@ -1,6 +1,6 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts ===
function *g() {
>g : () => IterableIterator<any>
>g : () => Generator<any, void, undefined>
yield * [];
>yield * [] : any
+1 -1
View File
@@ -53,7 +53,7 @@ declare namespace ts {
interface Iterator<T> {
next(): {
value: T;
done: false;
done?: false;
} | {
value: never;
done: true;
+1 -1
View File
@@ -53,7 +53,7 @@ declare namespace ts {
interface Iterator<T> {
next(): {
value: T;
done: false;
done?: false;
} | {
value: never;
done: true;
@@ -1,6 +1,6 @@
=== tests/cases/compiler/asyncImportNestedYield.ts ===
async function* foo() {
>foo : () => AsyncIterableIterator<string>
>foo : () => AsyncGenerator<string, void, string>
import((await import(yield "foo")).default);
>import((await import(yield "foo")).default) : Promise<any>
@@ -336,7 +336,7 @@ class B extends A {
}
async * property_access_only_read_only_in_generator() {
>property_access_only_read_only_in_generator : () => AsyncIterableIterator<any>
>property_access_only_read_only_in_generator : () => AsyncGenerator<never, void, unknown>
// call with property access
super.x();
@@ -372,7 +372,7 @@ class B extends A {
}
async * property_access_only_write_only_in_generator() {
>property_access_only_write_only_in_generator : () => AsyncIterableIterator<any>
>property_access_only_write_only_in_generator : () => AsyncGenerator<never, void, unknown>
const f = () => {};
>f : () => void
@@ -420,7 +420,7 @@ class B extends A {
}
async * element_access_only_read_only_in_generator() {
>element_access_only_read_only_in_generator : () => AsyncIterableIterator<any>
>element_access_only_read_only_in_generator : () => AsyncGenerator<never, void, unknown>
// call with element access
super["x"]();
@@ -456,7 +456,7 @@ class B extends A {
}
async * element_access_only_write_only_in_generator() {
>element_access_only_write_only_in_generator : () => AsyncIterableIterator<any>
>element_access_only_write_only_in_generator : () => AsyncGenerator<never, void, unknown>
const f = () => {};
>f : () => void
@@ -57,7 +57,7 @@ const arrowFunc = (p: Promise<number>) => {
};
function* generatorFunc(p: Promise<number>) {
>generatorFunc : (p: Promise<number>) => IterableIterator<number>
>generatorFunc : (p: Promise<number>) => Generator<number, void, unknown>
>p : Promise<number>
for await (const _ of []);
@@ -1,21 +1,23 @@
tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/bigintWithLib.ts(16,15): error TS2763: No overload matches this call.
tests/cases/compiler/bigintWithLib.ts(16,15): error TS2769: No overload matches this call.
Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'number'.
Overload 2 of 3, '(array: Iterable<bigint>): BigInt64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => IterableIterator<number>' is not assignable to type '() => Iterator<bigint>'.
Type 'IterableIterator<number>' is not assignable to type 'Iterator<bigint>'.
Type '() => IterableIterator<number>' is not assignable to type '() => Iterator<bigint, any, undefined>'.
Type 'IterableIterator<number>' is not assignable to type 'Iterator<bigint, any, undefined>'.
Types of property 'next' are incompatible.
Type '(value?: any) => IteratorResult<number>' is not assignable to type '(value?: any) => IteratorResult<bigint>'.
Type 'IteratorResult<number>' is not assignable to type 'IteratorResult<bigint>'.
Type 'number' is not assignable to type 'bigint'.
Type '(...args: [] | [undefined]) => IteratorResult<number, any>' is not assignable to type '(...args: [] | [undefined]) => IteratorResult<bigint, any>'.
Type 'IteratorResult<number, any>' is not assignable to type 'IteratorResult<bigint, any>'.
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<bigint, any>'.
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<bigint>'.
Type 'number' is not assignable to type 'bigint'.
Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property.
tests/cases/compiler/bigintWithLib.ts(28,16): error TS2763: No overload matches this call.
tests/cases/compiler/bigintWithLib.ts(28,16): error TS2769: No overload matches this call.
Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error.
Argument of type 'number[]' is not assignable to parameter of type 'number'.
Overload 2 of 3, '(array: Iterable<bigint>): BigUint64Array', gave the following error.
@@ -48,21 +50,23 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12
bigIntArray = new BigInt64Array([1n, 2n, 3n]);
bigIntArray = new BigInt64Array([1, 2, 3]); // should error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error.
!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'number'.
!!! error TS2763: Overload 2 of 3, '(array: Iterable<bigint>): BigInt64Array', gave the following error.
!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
!!! error TS2763: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2763: Type '() => IterableIterator<number>' is not assignable to type '() => Iterator<bigint>'.
!!! error TS2763: Type 'IterableIterator<number>' is not assignable to type 'Iterator<bigint>'.
!!! error TS2763: Types of property 'next' are incompatible.
!!! error TS2763: Type '(value?: any) => IteratorResult<number>' is not assignable to type '(value?: any) => IteratorResult<bigint>'.
!!! error TS2763: Type 'IteratorResult<number>' is not assignable to type 'IteratorResult<bigint>'.
!!! error TS2763: Type 'number' is not assignable to type 'bigint'.
!!! error TS2763: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error.
!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
!!! error TS2763: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error.
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'number'.
!!! error TS2769: Overload 2 of 3, '(array: Iterable<bigint>): BigInt64Array', gave the following error.
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
!!! error TS2769: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2769: Type '() => IterableIterator<number>' is not assignable to type '() => Iterator<bigint, any, undefined>'.
!!! error TS2769: Type 'IterableIterator<number>' is not assignable to type 'Iterator<bigint, any, undefined>'.
!!! error TS2769: Types of property 'next' are incompatible.
!!! error TS2769: Type '(...args: [] | [undefined]) => IteratorResult<number, any>' is not assignable to type '(...args: [] | [undefined]) => IteratorResult<bigint, any>'.
!!! error TS2769: Type 'IteratorResult<number, any>' is not assignable to type 'IteratorResult<bigint, any>'.
!!! error TS2769: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<bigint, any>'.
!!! error TS2769: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<bigint>'.
!!! error TS2769: Type 'number' is not assignable to type 'bigint'.
!!! error TS2769: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigInt64Array', gave the following error.
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
!!! error TS2769: Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
bigIntArray = new BigInt64Array(new ArrayBuffer(80));
bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8);
bigIntArray = new BigInt64Array(new ArrayBuffer(80), 8, 3);
@@ -78,14 +82,14 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12
bigUintArray = new BigUint64Array([1n, 2n, 3n]);
bigUintArray = new BigUint64Array([1, 2, 3]); // should error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error.
!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'number'.
!!! error TS2763: Overload 2 of 3, '(array: Iterable<bigint>): BigUint64Array', gave the following error.
!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
!!! error TS2763: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error.
!!! error TS2763: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
!!! error TS2763: Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error.
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'number'.
!!! error TS2769: Overload 2 of 3, '(array: Iterable<bigint>): BigUint64Array', gave the following error.
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
!!! error TS2769: Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error.
!!! error TS2769: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
!!! error TS2769: Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
bigUintArray = new BigUint64Array(new ArrayBuffer(80));
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8);
bigUintArray = new BigUint64Array(new ArrayBuffer(80), 8, 3);
@@ -1,6 +1,6 @@
=== tests/cases/compiler/blockScopedBindingsInDownlevelGenerator.ts ===
function* a() {
>a : () => IterableIterator<number>
>a : () => Generator<number, void, unknown>
for (const i of [1,2,3]) {
>i : number
@@ -82,11 +82,11 @@ function foo6(y = () => (() => z)(), z = 1) {
// ok - used inside immediately invoked generator function
function foo7(y = (function*() {yield z})(), z = 1) {
>foo7 : (y?: IterableIterator<number>, z?: number) => void
>y : IterableIterator<number>
>(function*() {yield z})() : IterableIterator<number>
>(function*() {yield z}) : () => IterableIterator<number>
>function*() {yield z} : () => IterableIterator<number>
>foo7 : (y?: Generator<number, void, unknown>, z?: number) => void
>y : Generator<number, void, unknown>
>(function*() {yield z})() : Generator<number, void, unknown>
>(function*() {yield z}) : () => Generator<number, void, unknown>
>function*() {yield z} : () => Generator<number, void, unknown>
>yield z : any
>z : number
>z : number
@@ -1,8 +1,8 @@
error TS2318: Cannot find global type 'IterableIterator'.
error TS2318: Cannot find global type 'Generator'.
tests/cases/compiler/castOfYield.ts(4,14): error TS1109: Expression expected.
!!! error TS2318: Cannot find global type 'IterableIterator'.
!!! error TS2318: Cannot find global type 'Generator'.
==== tests/cases/compiler/castOfYield.ts (1 errors) ====
function* f() {
<number> (yield 0);
@@ -2,12 +2,12 @@ tests/cases/compiler/constructorOverloads1.ts(2,5): error TS2392: Multiple const
tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple constructor implementations are not allowed.
tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed.
tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed.
tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2763: No overload matches this call.
tests/cases/compiler/constructorOverloads1.ts(16,10): error TS2769: No overload matches this call.
Overload 1 of 2, '(s: string): Foo', gave the following error.
Argument of type 'Foo' is not assignable to parameter of type 'string'.
Overload 2 of 2, '(n: number): Foo', gave the following error.
Argument of type 'Foo' is not assignable to parameter of type 'number'.
tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2763: No overload matches this call.
tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2769: No overload matches this call.
Overload 1 of 2, '(s: string): Foo', gave the following error.
Argument of type 'any[]' is not assignable to parameter of type 'string'.
Overload 2 of 2, '(n: number): Foo', gave the following error.
@@ -44,18 +44,18 @@ tests/cases/compiler/constructorOverloads1.ts(17,10): error TS2763: No overload
var f2 = new Foo(0);
var f3 = new Foo(f1);
~~~~~~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 2, '(s: string): Foo', gave the following error.
!!! error TS2763: Argument of type 'Foo' is not assignable to parameter of type 'string'.
!!! error TS2763: Overload 2 of 2, '(n: number): Foo', gave the following error.
!!! error TS2763: Argument of type 'Foo' is not assignable to parameter of type 'number'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(s: string): Foo', gave the following error.
!!! error TS2769: Argument of type 'Foo' is not assignable to parameter of type 'string'.
!!! error TS2769: Overload 2 of 2, '(n: number): Foo', gave the following error.
!!! error TS2769: Argument of type 'Foo' is not assignable to parameter of type 'number'.
var f4 = new Foo([f1,f2,f3]);
~~~~~~~~~~~~~~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 2, '(s: string): Foo', gave the following error.
!!! error TS2763: Argument of type 'any[]' is not assignable to parameter of type 'string'.
!!! error TS2763: Overload 2 of 2, '(n: number): Foo', gave the following error.
!!! error TS2763: Argument of type 'any[]' is not assignable to parameter of type 'number'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(s: string): Foo', gave the following error.
!!! error TS2769: Argument of type 'any[]' is not assignable to parameter of type 'string'.
!!! error TS2769: Overload 2 of 2, '(n: number): Foo', gave the following error.
!!! error TS2769: Argument of type 'any[]' is not assignable to parameter of type 'number'.
f1.bar1();
f1.bar2();
@@ -1,25 +1,25 @@
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2763: No overload matches this call.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,12): error TS2769: No overload matches this call.
Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2763: No overload matches this call.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(28,12): error TS2769: No overload matches this call.
Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2763: No overload matches this call.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(29,12): error TS2769: No overload matches this call.
Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2763: No overload matches this call.
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(30,12): error TS2769: No overload matches this call.
Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'.
@@ -61,40 +61,40 @@ tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): err
const b0 = <MainButton {...{onClick: (k) => {console.log(k)}}} extra />; // k has type "left" | "right"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
!!! error TS2763: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
!!! error TS2763: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
!!! error TS2769: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
!!! error TS2769: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />; // k has type "left" | "right"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
!!! error TS2763: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
!!! error TS2763: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2763: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
!!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
!!! error TS2769: Type '{ onClick: (k: "left" | "right") => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2769: Property 'onClick' does not exist on type 'IntrinsicAttributes & LinkProps'.
const b3 = <MainButton {...{goTo:"home"}} extra />; // goTo has type"home" | "contact"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
!!! error TS2763: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
!!! error TS2763: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
!!! error TS2769: Type '{ extra: true; goTo: string; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
!!! error TS2769: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
const b4 = <MainButton goTo="home" extra />; // goTo has type "home" | "contact"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
!!! error TS2763: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2763: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2763: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
!!! error TS2763: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2763: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(buttonProps: ButtonProps): Element', gave the following error.
!!! error TS2769: Type '{ goTo: string; extra: true; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2769: Property 'goTo' does not exist on type 'IntrinsicAttributes & ButtonProps'.
!!! error TS2769: Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
!!! error TS2769: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
!!! error TS2769: Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
export function NoOverload(buttonProps: ButtonProps): JSX.Element { return undefined }
const c1 = <NoOverload {...{onClick: (k) => {console.log(k)}}} extra />; // k has type any
@@ -181,9 +181,9 @@ function f5() {
>v : number
(function*() {
>(function*() { yield 1; v = 1; })() : IterableIterator<number>
>(function*() { yield 1; v = 1; }) : () => IterableIterator<number>
>function*() { yield 1; v = 1; } : () => IterableIterator<number>
>(function*() { yield 1; v = 1; })() : Generator<number, void, unknown>
>(function*() { yield 1; v = 1; }) : () => Generator<number, void, unknown>
>function*() { yield 1; v = 1; } : () => Generator<number, void, unknown>
yield 1;
>yield 1 : any
@@ -2,14 +2,14 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(11,17): error
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(22,17): error TS2345: Argument of type 'string | number' is not assignable to parameter of type 'string'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2763: No overload matches this call.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(34,13): error TS2769: No overload matches this call.
Overload 1 of 2, '(x: string): number', gave the following error.
Argument of type 'string | number' is not assignable to parameter of type 'string'.
Type 'number' is not assignable to type 'string'.
Overload 2 of 2, '(x: number): string', gave the following error.
Argument of type 'string | number' is not assignable to parameter of type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2763: No overload matches this call.
tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error TS2769: No overload matches this call.
Overload 1 of 2, '(x: string): number', gave the following error.
Argument of type 'string | number' is not assignable to parameter of type 'string'.
Type 'number' is not assignable to type 'string'.
@@ -60,13 +60,13 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error
while (cond) {
x = foo(x);
~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 2, '(x: string): number', gave the following error.
!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'string'.
!!! error TS2763: Type 'number' is not assignable to type 'string'.
!!! error TS2763: Overload 2 of 2, '(x: number): string', gave the following error.
!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2763: Type 'string' is not assignable to type 'number'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(x: string): number', gave the following error.
!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'.
!!! error TS2769: Type 'number' is not assignable to type 'string'.
!!! error TS2769: Overload 2 of 2, '(x: number): string', gave the following error.
!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2769: Type 'string' is not assignable to type 'number'.
x;
}
x;
@@ -79,13 +79,13 @@ tests/cases/conformance/controlFlow/controlFlowIterationErrors.ts(45,13): error
x;
x = foo(x);
~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 2, '(x: string): number', gave the following error.
!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'string'.
!!! error TS2763: Type 'number' is not assignable to type 'string'.
!!! error TS2763: Overload 2 of 2, '(x: number): string', gave the following error.
!!! error TS2763: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2763: Type 'string' is not assignable to type 'number'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(x: string): number', gave the following error.
!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'string'.
!!! error TS2769: Type 'number' is not assignable to type 'string'.
!!! error TS2769: Overload 2 of 2, '(x: number): string', gave the following error.
!!! error TS2769: Argument of type 'string | number' is not assignable to parameter of type 'number'.
!!! error TS2769: Type 'string' is not assignable to type 'number'.
}
x;
}
@@ -1,5 +1,5 @@
tests/cases/compiler/destructuringTuple.ts(11,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'.
tests/cases/compiler/destructuringTuple.ts(11,48): error TS2763: No overload matches this call.
tests/cases/compiler/destructuringTuple.ts(11,48): error TS2769: No overload matches this call.
Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
@@ -21,11 +21,11 @@ tests/cases/compiler/destructuringTuple.ts(11,48): error TS2763: No overload mat
~~~~~
!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'.
~~~~~~~~~~~~~~~
!!! error TS2763: No overload matches this call.
!!! error TS2763: Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
!!! error TS2763: Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
!!! error TS2763: Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
!!! error TS2763: Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
!!! error TS2769: Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
!!! error TS2769: Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
const [oops2] = [1, 2, 3].reduce((acc: number[], e) => acc.concat(e), []);
@@ -3,7 +3,7 @@ class C1 {
>C1 : C1
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
}
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/C2.ts ===
@@ -11,7 +11,7 @@ class C2 {
>C2 : C2
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -23,7 +23,7 @@ class C3 {
>C3 : C3
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -36,7 +36,7 @@ class C4 {
>C4 : C4
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -50,14 +50,14 @@ class C5 {
>C5 : C5
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
@@ -67,7 +67,7 @@ class C6 {
>C6 : C6
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -80,7 +80,7 @@ class C7 {
>C7 : C7
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -94,7 +94,7 @@ class C8 {
>g : () => void
}
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
this.g();
>this.g() : void
@@ -115,7 +115,7 @@ class C9 extends B9 {
>B9 : B9
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
super.g();
>super.g() : void
@@ -3,7 +3,7 @@ class C1 {
>C1 : C1
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
}
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/C2.ts ===
@@ -11,7 +11,7 @@ class C2 {
>C2 : C2
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -23,7 +23,7 @@ class C3 {
>C3 : C3
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -36,7 +36,7 @@ class C4 {
>C4 : C4
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -50,14 +50,14 @@ class C5 {
>C5 : C5
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
@@ -67,7 +67,7 @@ class C6 {
>C6 : C6
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -80,7 +80,7 @@ class C7 {
>C7 : C7
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -94,7 +94,7 @@ class C8 {
>g : () => void
}
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
this.g();
>this.g() : void
@@ -115,7 +115,7 @@ class C9 extends B9 {
>B9 : B9
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
super.g();
>super.g() : void
@@ -3,7 +3,7 @@ class C1 {
>C1 : C1
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
}
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/C2.ts ===
@@ -11,7 +11,7 @@ class C2 {
>C2 : C2
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -23,7 +23,7 @@ class C3 {
>C3 : C3
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -36,7 +36,7 @@ class C4 {
>C4 : C4
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -50,14 +50,14 @@ class C5 {
>C5 : C5
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
@@ -67,7 +67,7 @@ class C6 {
>C6 : C6
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -80,7 +80,7 @@ class C7 {
>C7 : C7
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -94,7 +94,7 @@ class C8 {
>g : () => void
}
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
this.g();
>this.g() : void
@@ -115,7 +115,7 @@ class C9 extends B9 {
>B9 : B9
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
super.g();
>super.g() : void
@@ -1,10 +1,10 @@
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F1.ts ===
async function * f1() {
>f1 : () => AsyncIterableIterator<any>
>f1 : () => AsyncGenerator<never, void, unknown>
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F2.ts ===
async function * f2() {
>f2 : () => AsyncIterableIterator<any>
>f2 : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -12,7 +12,7 @@ async function * f2() {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F3.ts ===
async function * f3() {
>f3 : () => AsyncIterableIterator<number>
>f3 : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -21,7 +21,7 @@ async function * f3() {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F4.ts ===
async function * f4() {
>f4 : () => AsyncIterableIterator<number>
>f4 : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -31,20 +31,20 @@ async function * f4() {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F5.ts ===
async function * f5() {
>f5 : () => AsyncIterableIterator<number>
>f5 : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F6.ts ===
async function * f6() {
>f6 : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -53,7 +53,7 @@ async function * f6() {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F7.ts ===
async function * f7() {
>f7 : () => AsyncIterableIterator<number>
>f7 : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -1,10 +1,10 @@
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F1.ts ===
async function * f1() {
>f1 : () => AsyncIterableIterator<any>
>f1 : () => AsyncGenerator<never, void, unknown>
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F2.ts ===
async function * f2() {
>f2 : () => AsyncIterableIterator<any>
>f2 : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -12,7 +12,7 @@ async function * f2() {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F3.ts ===
async function * f3() {
>f3 : () => AsyncIterableIterator<number>
>f3 : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -21,7 +21,7 @@ async function * f3() {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F4.ts ===
async function * f4() {
>f4 : () => AsyncIterableIterator<number>
>f4 : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -31,20 +31,20 @@ async function * f4() {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F5.ts ===
async function * f5() {
>f5 : () => AsyncIterableIterator<number>
>f5 : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F6.ts ===
async function * f6() {
>f6 : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -53,7 +53,7 @@ async function * f6() {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F7.ts ===
async function * f7() {
>f7 : () => AsyncIterableIterator<number>
>f7 : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -1,10 +1,10 @@
=== tests/cases/conformance/emitter/es5/asyncGenerators/F1.ts ===
async function * f1() {
>f1 : () => AsyncIterableIterator<any>
>f1 : () => AsyncGenerator<never, void, unknown>
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F2.ts ===
async function * f2() {
>f2 : () => AsyncIterableIterator<any>
>f2 : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -12,7 +12,7 @@ async function * f2() {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F3.ts ===
async function * f3() {
>f3 : () => AsyncIterableIterator<number>
>f3 : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -21,7 +21,7 @@ async function * f3() {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F4.ts ===
async function * f4() {
>f4 : () => AsyncIterableIterator<number>
>f4 : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -31,20 +31,20 @@ async function * f4() {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F5.ts ===
async function * f5() {
>f5 : () => AsyncIterableIterator<number>
>f5 : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F6.ts ===
async function * f6() {
>f6 : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -53,7 +53,7 @@ async function * f6() {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F7.ts ===
async function * f7() {
>f7 : () => AsyncIterableIterator<number>
>f7 : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -1,12 +1,12 @@
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F1.ts ===
const f1 = async function * () {
>f1 : () => AsyncIterableIterator<any>
>async function * () {} : () => AsyncIterableIterator<any>
>f1 : () => AsyncGenerator<never, void, unknown>
>async function * () {} : () => AsyncGenerator<never, void, unknown>
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F2.ts ===
const f2 = async function * () {
>f2 : () => AsyncIterableIterator<any>
>async function * () { const x = yield;} : () => AsyncIterableIterator<any>
>f2 : () => AsyncGenerator<any, void, unknown>
>async function * () { const x = yield;} : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -14,8 +14,8 @@ const f2 = async function * () {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F3.ts ===
const f3 = async function * () {
>f3 : () => AsyncIterableIterator<number>
>async function * () { const x = yield 1;} : () => AsyncIterableIterator<number>
>f3 : () => AsyncGenerator<number, void, unknown>
>async function * () { const x = yield 1;} : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -24,8 +24,8 @@ const f3 = async function * () {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F4.ts ===
const f4 = async function * () {
>f4 : () => AsyncIterableIterator<number>
>async function * () { const x = yield* [1];} : () => AsyncIterableIterator<number>
>f4 : () => AsyncGenerator<number, void, undefined>
>async function * () { const x = yield* [1];} : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -35,22 +35,22 @@ const f4 = async function * () {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F5.ts ===
const f5 = async function * () {
>f5 : () => AsyncIterableIterator<number>
>async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncIterableIterator<number>
>f5 : () => AsyncGenerator<number, void, unknown>
>async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F6.ts ===
const f6 = async function * () {
>f6 : () => AsyncIterableIterator<any>
>async function * () { const x = await 1;} : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
>async function * () { const x = await 1;} : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -59,8 +59,8 @@ const f6 = async function * () {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/F7.ts ===
const f7 = async function * () {
>f7 : () => AsyncIterableIterator<number>
>async function * () { return 1;} : () => AsyncIterableIterator<number>
>f7 : () => AsyncGenerator<never, number, unknown>
>async function * () { return 1;} : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -1,12 +1,12 @@
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F1.ts ===
const f1 = async function * () {
>f1 : () => AsyncIterableIterator<any>
>async function * () {} : () => AsyncIterableIterator<any>
>f1 : () => AsyncGenerator<never, void, unknown>
>async function * () {} : () => AsyncGenerator<never, void, unknown>
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F2.ts ===
const f2 = async function * () {
>f2 : () => AsyncIterableIterator<any>
>async function * () { const x = yield;} : () => AsyncIterableIterator<any>
>f2 : () => AsyncGenerator<any, void, unknown>
>async function * () { const x = yield;} : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -14,8 +14,8 @@ const f2 = async function * () {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F3.ts ===
const f3 = async function * () {
>f3 : () => AsyncIterableIterator<number>
>async function * () { const x = yield 1;} : () => AsyncIterableIterator<number>
>f3 : () => AsyncGenerator<number, void, unknown>
>async function * () { const x = yield 1;} : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -24,8 +24,8 @@ const f3 = async function * () {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F4.ts ===
const f4 = async function * () {
>f4 : () => AsyncIterableIterator<number>
>async function * () { const x = yield* [1];} : () => AsyncIterableIterator<number>
>f4 : () => AsyncGenerator<number, void, undefined>
>async function * () { const x = yield* [1];} : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -35,22 +35,22 @@ const f4 = async function * () {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F5.ts ===
const f5 = async function * () {
>f5 : () => AsyncIterableIterator<number>
>async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncIterableIterator<number>
>f5 : () => AsyncGenerator<number, void, unknown>
>async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F6.ts ===
const f6 = async function * () {
>f6 : () => AsyncIterableIterator<any>
>async function * () { const x = await 1;} : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
>async function * () { const x = await 1;} : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -59,8 +59,8 @@ const f6 = async function * () {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/F7.ts ===
const f7 = async function * () {
>f7 : () => AsyncIterableIterator<number>
>async function * () { return 1;} : () => AsyncIterableIterator<number>
>f7 : () => AsyncGenerator<never, number, unknown>
>async function * () { return 1;} : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -1,12 +1,12 @@
=== tests/cases/conformance/emitter/es5/asyncGenerators/F1.ts ===
const f1 = async function * () {
>f1 : () => AsyncIterableIterator<any>
>async function * () {} : () => AsyncIterableIterator<any>
>f1 : () => AsyncGenerator<never, void, unknown>
>async function * () {} : () => AsyncGenerator<never, void, unknown>
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F2.ts ===
const f2 = async function * () {
>f2 : () => AsyncIterableIterator<any>
>async function * () { const x = yield;} : () => AsyncIterableIterator<any>
>f2 : () => AsyncGenerator<any, void, unknown>
>async function * () { const x = yield;} : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -14,8 +14,8 @@ const f2 = async function * () {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F3.ts ===
const f3 = async function * () {
>f3 : () => AsyncIterableIterator<number>
>async function * () { const x = yield 1;} : () => AsyncIterableIterator<number>
>f3 : () => AsyncGenerator<number, void, unknown>
>async function * () { const x = yield 1;} : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -24,8 +24,8 @@ const f3 = async function * () {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F4.ts ===
const f4 = async function * () {
>f4 : () => AsyncIterableIterator<number>
>async function * () { const x = yield* [1];} : () => AsyncIterableIterator<number>
>f4 : () => AsyncGenerator<number, void, undefined>
>async function * () { const x = yield* [1];} : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -35,22 +35,22 @@ const f4 = async function * () {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F5.ts ===
const f5 = async function * () {
>f5 : () => AsyncIterableIterator<number>
>async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncIterableIterator<number>
>f5 : () => AsyncGenerator<number, void, unknown>
>async function * () { const x = yield* (async function*() { yield 1; })();} : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F6.ts ===
const f6 = async function * () {
>f6 : () => AsyncIterableIterator<any>
>async function * () { const x = await 1;} : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
>async function * () { const x = await 1;} : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -59,8 +59,8 @@ const f6 = async function * () {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/F7.ts ===
const f7 = async function * () {
>f7 : () => AsyncIterableIterator<number>
>async function * () { return 1;} : () => AsyncIterableIterator<number>
>f7 : () => AsyncGenerator<never, number, unknown>
>async function * () { return 1;} : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -1,19 +1,19 @@
=== tests/cases/conformance/emitter/es2015/asyncGenerators/O1.ts ===
const o1 = {
>o1 : { f(): AsyncIterableIterator<any>; }
>{ async * f() { }} : { f(): AsyncIterableIterator<any>; }
>o1 : { f(): AsyncGenerator<never, void, unknown>; }
>{ async * f() { }} : { f(): AsyncGenerator<never, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
}
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/O2.ts ===
const o2 = {
>o2 : { f(): AsyncIterableIterator<any>; }
>{ async * f() { const x = yield; }} : { f(): AsyncIterableIterator<any>; }
>o2 : { f(): AsyncGenerator<any, void, unknown>; }
>{ async * f() { const x = yield; }} : { f(): AsyncGenerator<any, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -22,11 +22,11 @@ const o2 = {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/O3.ts ===
const o3 = {
>o3 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { const x = yield 1; }} : { f(): AsyncIterableIterator<number>; }
>o3 : { f(): AsyncGenerator<number, void, unknown>; }
>{ async * f() { const x = yield 1; }} : { f(): AsyncGenerator<number, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -36,11 +36,11 @@ const o3 = {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/O4.ts ===
const o4 = {
>o4 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { const x = yield* [1]; }} : { f(): AsyncIterableIterator<number>; }
>o4 : { f(): AsyncGenerator<number, void, undefined>; }
>{ async * f() { const x = yield* [1]; }} : { f(): AsyncGenerator<number, void, undefined>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -51,29 +51,29 @@ const o4 = {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/O5.ts ===
const o5 = {
>o5 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncIterableIterator<number>; }
>o5 : { f(): AsyncGenerator<number, void, unknown>; }
>{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncGenerator<number, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/O6.ts ===
const o6 = {
>o6 : { f(): AsyncIterableIterator<any>; }
>{ async * f() { const x = await 1; }} : { f(): AsyncIterableIterator<any>; }
>o6 : { f(): AsyncGenerator<never, void, unknown>; }
>{ async * f() { const x = await 1; }} : { f(): AsyncGenerator<never, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -83,11 +83,11 @@ const o6 = {
}
=== tests/cases/conformance/emitter/es2015/asyncGenerators/O7.ts ===
const o7 = {
>o7 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { return 1; }} : { f(): AsyncIterableIterator<number>; }
>o7 : { f(): AsyncGenerator<never, number, unknown>; }
>{ async * f() { return 1; }} : { f(): AsyncGenerator<never, number, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -1,19 +1,19 @@
=== tests/cases/conformance/emitter/es2018/asyncGenerators/O1.ts ===
const o1 = {
>o1 : { f(): AsyncIterableIterator<any>; }
>{ async * f() { }} : { f(): AsyncIterableIterator<any>; }
>o1 : { f(): AsyncGenerator<never, void, unknown>; }
>{ async * f() { }} : { f(): AsyncGenerator<never, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
}
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/O2.ts ===
const o2 = {
>o2 : { f(): AsyncIterableIterator<any>; }
>{ async * f() { const x = yield; }} : { f(): AsyncIterableIterator<any>; }
>o2 : { f(): AsyncGenerator<any, void, unknown>; }
>{ async * f() { const x = yield; }} : { f(): AsyncGenerator<any, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -22,11 +22,11 @@ const o2 = {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/O3.ts ===
const o3 = {
>o3 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { const x = yield 1; }} : { f(): AsyncIterableIterator<number>; }
>o3 : { f(): AsyncGenerator<number, void, unknown>; }
>{ async * f() { const x = yield 1; }} : { f(): AsyncGenerator<number, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -36,11 +36,11 @@ const o3 = {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/O4.ts ===
const o4 = {
>o4 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { const x = yield* [1]; }} : { f(): AsyncIterableIterator<number>; }
>o4 : { f(): AsyncGenerator<number, void, undefined>; }
>{ async * f() { const x = yield* [1]; }} : { f(): AsyncGenerator<number, void, undefined>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -51,29 +51,29 @@ const o4 = {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/O5.ts ===
const o5 = {
>o5 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncIterableIterator<number>; }
>o5 : { f(): AsyncGenerator<number, void, unknown>; }
>{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncGenerator<number, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/O6.ts ===
const o6 = {
>o6 : { f(): AsyncIterableIterator<any>; }
>{ async * f() { const x = await 1; }} : { f(): AsyncIterableIterator<any>; }
>o6 : { f(): AsyncGenerator<never, void, unknown>; }
>{ async * f() { const x = await 1; }} : { f(): AsyncGenerator<never, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -83,11 +83,11 @@ const o6 = {
}
=== tests/cases/conformance/emitter/es2018/asyncGenerators/O7.ts ===
const o7 = {
>o7 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { return 1; }} : { f(): AsyncIterableIterator<number>; }
>o7 : { f(): AsyncGenerator<never, number, unknown>; }
>{ async * f() { return 1; }} : { f(): AsyncGenerator<never, number, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -1,19 +1,19 @@
=== tests/cases/conformance/emitter/es5/asyncGenerators/O1.ts ===
const o1 = {
>o1 : { f(): AsyncIterableIterator<any>; }
>{ async * f() { }} : { f(): AsyncIterableIterator<any>; }
>o1 : { f(): AsyncGenerator<never, void, unknown>; }
>{ async * f() { }} : { f(): AsyncGenerator<never, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
}
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/O2.ts ===
const o2 = {
>o2 : { f(): AsyncIterableIterator<any>; }
>{ async * f() { const x = yield; }} : { f(): AsyncIterableIterator<any>; }
>o2 : { f(): AsyncGenerator<any, void, unknown>; }
>{ async * f() { const x = yield; }} : { f(): AsyncGenerator<any, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<any, void, unknown>
const x = yield;
>x : any
@@ -22,11 +22,11 @@ const o2 = {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/O3.ts ===
const o3 = {
>o3 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { const x = yield 1; }} : { f(): AsyncIterableIterator<number>; }
>o3 : { f(): AsyncGenerator<number, void, unknown>; }
>{ async * f() { const x = yield 1; }} : { f(): AsyncGenerator<number, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield 1;
>x : any
@@ -36,11 +36,11 @@ const o3 = {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/O4.ts ===
const o4 = {
>o4 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { const x = yield* [1]; }} : { f(): AsyncIterableIterator<number>; }
>o4 : { f(): AsyncGenerator<number, void, undefined>; }
>{ async * f() { const x = yield* [1]; }} : { f(): AsyncGenerator<number, void, undefined>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, undefined>
const x = yield* [1];
>x : any
@@ -51,29 +51,29 @@ const o4 = {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/O5.ts ===
const o5 = {
>o5 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncIterableIterator<number>; }
>o5 : { f(): AsyncGenerator<number, void, unknown>; }
>{ async * f() { const x = yield* (async function*() { yield 1; })(); }} : { f(): AsyncGenerator<number, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<number, void, unknown>
const x = yield* (async function*() { yield 1; })();
>x : any
>yield* (async function*() { yield 1; })() : any
>(async function*() { yield 1; })() : AsyncIterableIterator<number>
>(async function*() { yield 1; }) : () => AsyncIterableIterator<number>
>async function*() { yield 1; } : () => AsyncIterableIterator<number>
>x : void
>yield* (async function*() { yield 1; })() : void
>(async function*() { yield 1; })() : AsyncGenerator<number, void, unknown>
>(async function*() { yield 1; }) : () => AsyncGenerator<number, void, unknown>
>async function*() { yield 1; } : () => AsyncGenerator<number, void, unknown>
>yield 1 : any
>1 : 1
}
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/O6.ts ===
const o6 = {
>o6 : { f(): AsyncIterableIterator<any>; }
>{ async * f() { const x = await 1; }} : { f(): AsyncIterableIterator<any>; }
>o6 : { f(): AsyncGenerator<never, void, unknown>; }
>{ async * f() { const x = await 1; }} : { f(): AsyncGenerator<never, void, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<any>
>f : () => AsyncGenerator<never, void, unknown>
const x = await 1;
>x : 1
@@ -83,11 +83,11 @@ const o6 = {
}
=== tests/cases/conformance/emitter/es5/asyncGenerators/O7.ts ===
const o7 = {
>o7 : { f(): AsyncIterableIterator<number>; }
>{ async * f() { return 1; }} : { f(): AsyncIterableIterator<number>; }
>o7 : { f(): AsyncGenerator<never, number, unknown>; }
>{ async * f() { return 1; }} : { f(): AsyncGenerator<never, number, unknown>; }
async * f() {
>f : () => AsyncIterableIterator<number>
>f : () => AsyncGenerator<never, number, unknown>
return 1;
>1 : 1
@@ -25,7 +25,7 @@ async function f2() {
}
=== tests/cases/conformance/emitter/es2015/forAwait/file3.ts ===
async function* f3() {
>f3 : () => AsyncIterableIterator<any>
>f3 : () => AsyncGenerator<never, void, unknown>
let y: any;
>y : any
@@ -37,7 +37,7 @@ async function* f3() {
}
=== tests/cases/conformance/emitter/es2015/forAwait/file4.ts ===
async function* f4() {
>f4 : () => AsyncIterableIterator<any>
>f4 : () => AsyncGenerator<never, void, unknown>
let x: any, y: any;
>x : any
@@ -68,7 +68,7 @@ async function f5() {
=== tests/cases/conformance/emitter/es2015/forAwait/file6.ts ===
// https://github.com/Microsoft/TypeScript/issues/21363
async function* f6() {
>f6 : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
let y: any;
>y : any
@@ -25,7 +25,7 @@ async function f2() {
}
=== tests/cases/conformance/emitter/es2017/forAwait/file3.ts ===
async function* f3() {
>f3 : () => AsyncIterableIterator<any>
>f3 : () => AsyncGenerator<never, void, unknown>
let y: any;
>y : any
@@ -37,7 +37,7 @@ async function* f3() {
}
=== tests/cases/conformance/emitter/es2017/forAwait/file4.ts ===
async function* f4() {
>f4 : () => AsyncIterableIterator<any>
>f4 : () => AsyncGenerator<never, void, unknown>
let x: any, y: any;
>x : any
@@ -68,7 +68,7 @@ async function f5() {
=== tests/cases/conformance/emitter/es2017/forAwait/file6.ts ===
// https://github.com/Microsoft/TypeScript/issues/21363
async function* f6() {
>f6 : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
let y: any;
>y : any
@@ -25,7 +25,7 @@ async function f2() {
}
=== tests/cases/conformance/emitter/es2018/forAwait/file3.ts ===
async function* f3() {
>f3 : () => AsyncIterableIterator<any>
>f3 : () => AsyncGenerator<never, void, unknown>
let y: any;
>y : any
@@ -37,7 +37,7 @@ async function* f3() {
}
=== tests/cases/conformance/emitter/es2018/forAwait/file4.ts ===
async function* f4() {
>f4 : () => AsyncIterableIterator<any>
>f4 : () => AsyncGenerator<never, void, unknown>
let x: any, y: any;
>x : any
@@ -68,7 +68,7 @@ async function f5() {
=== tests/cases/conformance/emitter/es2018/forAwait/file6.ts ===
// https://github.com/Microsoft/TypeScript/issues/21363
async function* f6() {
>f6 : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
let y: any;
>y : any
@@ -25,7 +25,7 @@ async function f2() {
}
=== tests/cases/conformance/emitter/es5/forAwait/file3.ts ===
async function* f3() {
>f3 : () => AsyncIterableIterator<any>
>f3 : () => AsyncGenerator<never, void, unknown>
let y: any;
>y : any
@@ -37,7 +37,7 @@ async function* f3() {
}
=== tests/cases/conformance/emitter/es5/forAwait/file4.ts ===
async function* f4() {
>f4 : () => AsyncIterableIterator<any>
>f4 : () => AsyncGenerator<never, void, unknown>
let x: any, y: any;
>x : any
@@ -68,7 +68,7 @@ async function f5() {
=== tests/cases/conformance/emitter/es5/forAwait/file6.ts ===
// https://github.com/Microsoft/TypeScript/issues/21363
async function* f6() {
>f6 : () => AsyncIterableIterator<any>
>f6 : () => AsyncGenerator<never, void, unknown>
let y: any;
>y : any
@@ -8,7 +8,7 @@ export async function foo({ foo = await import("./bar") }) {
}
export function* foo2({ foo = yield "a" }) {
>foo2 : ({ foo }: { foo?: any; }) => IterableIterator<any>
>foo2 : ({ foo }: { foo?: any; }) => Generator<never, void, unknown>
>foo : any
>yield "a" : any
>"a" : "a"
@@ -1,5 +1,4 @@
tests/cases/conformance/es6/for-ofStatements/for-of29.ts(5,15): error TS2322: Type '{ [Symbol.iterator]?(): Iterator<string>; }' is not assignable to type 'Iterable<string>'.
Property '[Symbol.iterator]' is optional in type '{ [Symbol.iterator]?(): Iterator<string>; }' but required in type 'Iterable<string>'.
tests/cases/conformance/es6/for-ofStatements/for-of29.ts(5,15): error TS2488: Type '{ [Symbol.iterator]?(): Iterator<string, any, undefined>; }' must have a '[Symbol.iterator]()' method that returns an iterator.
==== tests/cases/conformance/es6/for-ofStatements/for-of29.ts (1 errors) ====
@@ -9,6 +8,5 @@ tests/cases/conformance/es6/for-ofStatements/for-of29.ts(5,15): error TS2322: Ty
for (var v of iterableWithOptionalIterator) { }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type '{ [Symbol.iterator]?(): Iterator<string>; }' is not assignable to type 'Iterable<string>'.
!!! error TS2322: Property '[Symbol.iterator]' is optional in type '{ [Symbol.iterator]?(): Iterator<string>; }' but required in type 'Iterable<string>'.
!!! error TS2488: Type '{ [Symbol.iterator]?(): Iterator<string, any, undefined>; }' must have a '[Symbol.iterator]()' method that returns an iterator.
+4 -4
View File
@@ -1,9 +1,9 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of29.ts ===
var iterableWithOptionalIterator: {
>iterableWithOptionalIterator : { [Symbol.iterator]?(): Iterator<string>; }
>iterableWithOptionalIterator : { [Symbol.iterator]?(): Iterator<string, any, undefined>; }
[Symbol.iterator]?(): Iterator<string>
>[Symbol.iterator] : () => Iterator<string>
>[Symbol.iterator] : () => Iterator<string, any, undefined>
>Symbol.iterator : symbol
>Symbol : SymbolConstructor
>iterator : symbol
@@ -11,6 +11,6 @@ var iterableWithOptionalIterator: {
};
for (var v of iterableWithOptionalIterator) { }
>v : string
>iterableWithOptionalIterator : { [Symbol.iterator]?(): Iterator<string>; }
>v : any
>iterableWithOptionalIterator : { [Symbol.iterator]?(): Iterator<string, any, undefined>; }
+4 -14
View File
@@ -1,9 +1,4 @@
tests/cases/conformance/es6/for-ofStatements/for-of30.ts(16,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
Type 'StringIterator' is not assignable to type 'Iterator<string>'.
Types of property 'return' are incompatible.
Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
tests/cases/conformance/es6/for-ofStatements/for-of30.ts(16,15): error TS2767: The 'return' property of an iterator must be a method.
==== tests/cases/conformance/es6/for-ofStatements/for-of30.ts (1 errors) ====
@@ -14,9 +9,9 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(16,15): error TS2322: T
value: ""
}
}
return = 0;
[Symbol.iterator]() {
return this;
}
@@ -24,9 +19,4 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(16,15): error TS2322: T
for (var v of new StringIterator) { }
~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'return' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
!!! error TS2767: The 'return' property of an iterator must be a method.
+2 -2
View File
@@ -6,9 +6,9 @@ class StringIterator {
value: ""
}
}
return = 0;
[Symbol.iterator]() {
return this;
}
+2 -2
View File
@@ -13,10 +13,10 @@ class StringIterator {
>value : Symbol(value, Decl(for-of30.ts, 3, 24))
}
}
return = 0;
>return : Symbol(StringIterator.return, Decl(for-of30.ts, 6, 5))
[Symbol.iterator]() {
>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of30.ts, 8, 15))
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
+2 -2
View File
@@ -17,11 +17,11 @@ class StringIterator {
>"" : ""
}
}
return = 0;
>return : number
>0 : 0
[Symbol.iterator]() {
>[Symbol.iterator] : () => this
>Symbol.iterator : symbol
@@ -1,33 +0,0 @@
tests/cases/conformance/es6/for-ofStatements/for-of31.ts(14,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
Type 'StringIterator' is not assignable to type 'Iterator<string>'.
Types of property 'next' are incompatible.
Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult<string>'.
Property 'done' is missing in type '{ value: string; }' but required in type 'IteratorResult<string>'.
==== tests/cases/conformance/es6/for-ofStatements/for-of31.ts (1 errors) ====
class StringIterator {
next() {
return {
// no done property
value: ""
}
}
[Symbol.iterator]() {
return this;
}
}
for (var v of new StringIterator) { }
~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult<string>'.
!!! error TS2322: Property 'done' is missing in type '{ value: string; }' but required in type 'IteratorResult<string>'.
!!! related TS2728 /.ts/lib.es2015.iterable.d.ts:32:5: 'done' is declared here.
+1 -1
View File
@@ -6,7 +6,7 @@ class StringIterator {
value: ""
}
}
[Symbol.iterator]() {
return this;
}
+1 -1
View File
@@ -11,7 +11,7 @@ class StringIterator {
>value : Symbol(value, Decl(for-of31.ts, 2, 16))
}
}
[Symbol.iterator]() {
>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of31.ts, 6, 5))
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
+1 -1
View File
@@ -14,7 +14,7 @@ class StringIterator {
>"" : ""
}
}
[Symbol.iterator]() {
>[Symbol.iterator] : () => this
>Symbol.iterator : symbol
@@ -9,7 +9,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of34.ts(11,10): error TS7022: '
!!! error TS7023: 'next' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
return v;
}
[Symbol.iterator]() {
return this;
}
+1 -1
View File
@@ -3,7 +3,7 @@ class StringIterator {
next() {
return v;
}
[Symbol.iterator]() {
return this;
}
+1 -1
View File
@@ -8,7 +8,7 @@ class StringIterator {
return v;
>v : Symbol(v, Decl(for-of34.ts, 10, 8))
}
[Symbol.iterator]() {
>[Symbol.iterator] : Symbol(StringIterator[Symbol.iterator], Decl(for-of34.ts, 3, 5))
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
+1 -1
View File
@@ -8,7 +8,7 @@ class StringIterator {
return v;
>v : any
}
[Symbol.iterator]() {
>[Symbol.iterator] : () => this
>Symbol.iterator : symbol
@@ -12,7 +12,7 @@ tests/cases/conformance/es6/for-ofStatements/for-of35.ts(14,10): error TS7022: '
value: v
}
}
[Symbol.iterator]() {
return this;
}

Some files were not shown because too many files have changed in this diff Show More