mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into referencesPrototypeSourceFile
Uptodate to 3.6.0-dev.20190711
This commit is contained in:
@@ -415,6 +415,8 @@ task("runtests").flags = {
|
||||
" --no-lint": "Disables lint",
|
||||
" --timeout=<ms>": "Overrides the default test timeout.",
|
||||
" --built": "Compile using the built version of the compiler.",
|
||||
" --shards": "Total number of shards running tests (default: 1)",
|
||||
" --shardId": "1-based ID of this shard (default: 1)",
|
||||
}
|
||||
|
||||
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ true, /*watchMode*/ false);
|
||||
@@ -430,6 +432,8 @@ task("runtests-parallel").flags = {
|
||||
" --timeout=<ms>": "Overrides the default test timeout.",
|
||||
" --built": "Compile using the built version of the compiler.",
|
||||
" --skipPercent=<number>": "Skip expensive tests with <percent> chance to miss an edit. Default 5%.",
|
||||
" --shards": "Total number of shards running tests (default: 1)",
|
||||
" --shardId": "1-based ID of this shard (default: 1)",
|
||||
};
|
||||
|
||||
task("diff", () => exec(getDiffTool(), [refBaseline, localBaseline], { ignoreExitCode: true }));
|
||||
|
||||
@@ -5,7 +5,7 @@ const os = require("os");
|
||||
/** @type {CommandLineOptions} */
|
||||
module.exports = minimist(process.argv.slice(2), {
|
||||
boolean: ["debug", "dirty", "inspect", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
|
||||
string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout"],
|
||||
string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
|
||||
alias: {
|
||||
"b": "browser",
|
||||
"d": "debug", "debug-brk": "debug",
|
||||
|
||||
+10
-4
@@ -36,6 +36,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
|
||||
const testConfigFile = "test.config";
|
||||
const failed = cmdLineOptions.failed;
|
||||
const keepFailed = cmdLineOptions.keepFailed;
|
||||
const shards = +cmdLineOptions.shards || undefined;
|
||||
const shardId = +cmdLineOptions.shardId || undefined;
|
||||
if (!cmdLineOptions.dirty) {
|
||||
await cleanTestDirs();
|
||||
cancelToken.throwIfCancellationRequested();
|
||||
@@ -63,8 +65,8 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
|
||||
testTimeout = 400000;
|
||||
}
|
||||
|
||||
if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || skipPercent !== undefined) {
|
||||
writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed);
|
||||
if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed || skipPercent !== undefined || shards || shardId) {
|
||||
writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed, shards, shardId);
|
||||
}
|
||||
|
||||
const colors = cmdLineOptions.colors;
|
||||
@@ -165,8 +167,10 @@ exports.cleanTestDirs = cleanTestDirs;
|
||||
* @param {string} [stackTraceLimit]
|
||||
* @param {string | number} [timeout]
|
||||
* @param {boolean} [keepFailed]
|
||||
* @param {number | undefined} [shards]
|
||||
* @param {number | undefined} [shardId]
|
||||
*/
|
||||
function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed) {
|
||||
function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFolder, workerCount, stackTraceLimit, timeout, keepFailed, shards, shardId) {
|
||||
const testConfigContents = JSON.stringify({
|
||||
test: tests ? [tests] : undefined,
|
||||
runners: runners ? runners.split(",") : undefined,
|
||||
@@ -177,7 +181,9 @@ function writeTestConfigFile(tests, runners, light, skipPercent, taskConfigsFold
|
||||
taskConfigsFolder,
|
||||
noColor: !cmdLineOptions.colors,
|
||||
timeout,
|
||||
keepFailed
|
||||
keepFailed,
|
||||
shards,
|
||||
shardId
|
||||
});
|
||||
log.info("Running tests with config: " + testConfigContents);
|
||||
fs.writeFileSync("test.config", testConfigContents);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1342
-552
File diff suppressed because it is too large
Load Diff
@@ -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"],
|
||||
@@ -1905,7 +1906,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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+24
-29
@@ -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 };
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -600,24 +600,18 @@ namespace ts {
|
||||
*
|
||||
* @param array The array to flatten.
|
||||
*/
|
||||
export function flatten<T>(array: ReadonlyArray<T | ReadonlyArray<T> | undefined>): T[];
|
||||
export function flatten<T>(array: ReadonlyArray<T | ReadonlyArray<T> | undefined> | undefined): T[] | undefined;
|
||||
export function flatten<T>(array: ReadonlyArray<T | ReadonlyArray<T> | undefined> | undefined): T[] | undefined {
|
||||
let result: T[] | undefined;
|
||||
if (array) {
|
||||
result = [];
|
||||
for (const v of array) {
|
||||
if (v) {
|
||||
if (isArray(v)) {
|
||||
addRange(result, v);
|
||||
}
|
||||
else {
|
||||
result.push(v);
|
||||
}
|
||||
export function flatten<T>(array: T[][] | ReadonlyArray<T | ReadonlyArray<T> | undefined>): T[] {
|
||||
const result = [];
|
||||
for (const v of array) {
|
||||
if (v) {
|
||||
if (isArray(v)) {
|
||||
addRange(result, v);
|
||||
}
|
||||
else {
|
||||
result.push(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -678,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);
|
||||
}
|
||||
@@ -753,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) {
|
||||
@@ -1078,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;
|
||||
@@ -1402,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;
|
||||
}
|
||||
|
||||
@@ -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,6 +2653,50 @@
|
||||
"category": "Error",
|
||||
"code": 2762
|
||||
},
|
||||
"Cannot iterate value because the 'next' method of its iterator expects type '{1}', but for-of will always send '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2763
|
||||
},
|
||||
"Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array spread will always send '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2764
|
||||
},
|
||||
"Cannot iterate value because the 'next' method of its iterator expects type '{1}', but array destructuring will always send '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2765
|
||||
},
|
||||
"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
|
||||
},
|
||||
"Did you forget to use 'await'?": {
|
||||
"category": "Error",
|
||||
"code": 2773
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
@@ -4218,7 +4262,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
|
||||
},
|
||||
@@ -4340,6 +4384,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
|
||||
@@ -5034,6 +5083,14 @@
|
||||
"category": "Message",
|
||||
"code": 95080
|
||||
},
|
||||
"Add 'const' to unresolved variable": {
|
||||
"category": "Message",
|
||||
"code": 95081
|
||||
},
|
||||
"Add 'const' to all unresolved variables": {
|
||||
"category": "Message",
|
||||
"code": 95082
|
||||
},
|
||||
"No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.": {
|
||||
"category": "Error",
|
||||
"code": 18004
|
||||
|
||||
+15
-9
@@ -1544,8 +1544,8 @@ namespace ts {
|
||||
export function createIf(expression: Expression, thenStatement: Statement, elseStatement?: Statement) {
|
||||
const node = <IfStatement>createSynthesizedNode(SyntaxKind.IfStatement);
|
||||
node.expression = expression;
|
||||
node.thenStatement = thenStatement;
|
||||
node.elseStatement = elseStatement;
|
||||
node.thenStatement = asEmbeddedStatement(thenStatement);
|
||||
node.elseStatement = asEmbeddedStatement(elseStatement);
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1559,7 +1559,7 @@ namespace ts {
|
||||
|
||||
export function createDo(statement: Statement, expression: Expression) {
|
||||
const node = <DoStatement>createSynthesizedNode(SyntaxKind.DoStatement);
|
||||
node.statement = statement;
|
||||
node.statement = asEmbeddedStatement(statement);
|
||||
node.expression = expression;
|
||||
return node;
|
||||
}
|
||||
@@ -1574,7 +1574,7 @@ namespace ts {
|
||||
export function createWhile(expression: Expression, statement: Statement) {
|
||||
const node = <WhileStatement>createSynthesizedNode(SyntaxKind.WhileStatement);
|
||||
node.expression = expression;
|
||||
node.statement = statement;
|
||||
node.statement = asEmbeddedStatement(statement);
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1590,7 +1590,7 @@ namespace ts {
|
||||
node.initializer = initializer;
|
||||
node.condition = condition;
|
||||
node.incrementor = incrementor;
|
||||
node.statement = statement;
|
||||
node.statement = asEmbeddedStatement(statement);
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1607,7 +1607,7 @@ namespace ts {
|
||||
const node = <ForInStatement>createSynthesizedNode(SyntaxKind.ForInStatement);
|
||||
node.initializer = initializer;
|
||||
node.expression = expression;
|
||||
node.statement = statement;
|
||||
node.statement = asEmbeddedStatement(statement);
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1624,7 +1624,7 @@ namespace ts {
|
||||
node.awaitModifier = awaitModifier;
|
||||
node.initializer = initializer;
|
||||
node.expression = expression;
|
||||
node.statement = statement;
|
||||
node.statement = asEmbeddedStatement(statement);
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1676,7 +1676,7 @@ namespace ts {
|
||||
export function createWith(expression: Expression, statement: Statement) {
|
||||
const node = <WithStatement>createSynthesizedNode(SyntaxKind.WithStatement);
|
||||
node.expression = expression;
|
||||
node.statement = statement;
|
||||
node.statement = asEmbeddedStatement(statement);
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -1704,7 +1704,7 @@ namespace ts {
|
||||
export function createLabel(label: string | Identifier, statement: Statement) {
|
||||
const node = <LabeledStatement>createSynthesizedNode(SyntaxKind.LabeledStatement);
|
||||
node.label = asName(label);
|
||||
node.statement = statement;
|
||||
node.statement = asEmbeddedStatement(statement);
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -3080,6 +3080,12 @@ namespace ts {
|
||||
return typeof value === "number" ? createToken(value) : value;
|
||||
}
|
||||
|
||||
function asEmbeddedStatement<T extends Node>(statement: T): T | EmptyStatement;
|
||||
function asEmbeddedStatement<T extends Node>(statement: T | undefined): T | EmptyStatement | undefined;
|
||||
function asEmbeddedStatement<T extends Node>(statement: T | undefined): T | EmptyStatement | undefined {
|
||||
return statement && isNotEmittedStatement(statement) ? setTextRange(setOriginalNode(createEmptyStatement(), statement), statement) : statement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears any EmitNode entries from parse-tree nodes.
|
||||
* @param sourceFile A source file.
|
||||
|
||||
@@ -468,6 +468,8 @@ namespace ts {
|
||||
visitNode(cbNode, (<JSDocPropertyLikeTag>node).typeExpression)
|
||||
: visitNode(cbNode, (<JSDocPropertyLikeTag>node).typeExpression) ||
|
||||
visitNode(cbNode, (<JSDocPropertyLikeTag>node).name));
|
||||
case SyntaxKind.JSDocAuthorTag:
|
||||
return visitNode(cbNode, (node as JSDocTag).tagName);
|
||||
case SyntaxKind.JSDocAugmentsTag:
|
||||
return visitNode(cbNode, (node as JSDocTag).tagName) ||
|
||||
visitNode(cbNode, (<JSDocAugmentsTag>node).class);
|
||||
@@ -6621,6 +6623,9 @@ namespace ts {
|
||||
|
||||
let tag: JSDocTag | undefined;
|
||||
switch (tagName.escapedText) {
|
||||
case "author":
|
||||
tag = parseAuthorTag(start, tagName, margin);
|
||||
break;
|
||||
case "augments":
|
||||
case "extends":
|
||||
tag = parseAugmentsTag(start, tagName);
|
||||
@@ -6900,6 +6905,69 @@ namespace ts {
|
||||
return finishNode(result);
|
||||
}
|
||||
|
||||
function parseAuthorTag(start: number, tagName: Identifier, indent: number): JSDocAuthorTag {
|
||||
const result = <JSDocAuthorTag>createNode(SyntaxKind.JSDocAuthorTag, start);
|
||||
result.tagName = tagName;
|
||||
|
||||
const authorInfoWithEmail = tryParse(() => tryParseAuthorNameAndEmail());
|
||||
if (!authorInfoWithEmail) {
|
||||
return finishNode(result);
|
||||
}
|
||||
|
||||
result.comment = authorInfoWithEmail;
|
||||
|
||||
if (lookAhead(() => nextToken() !== SyntaxKind.NewLineTrivia)) {
|
||||
const comment = parseTagComments(indent);
|
||||
if (comment) {
|
||||
result.comment += comment;
|
||||
}
|
||||
}
|
||||
|
||||
return finishNode(result);
|
||||
}
|
||||
|
||||
function tryParseAuthorNameAndEmail(): string | undefined {
|
||||
const comments: string[] = [];
|
||||
let seenLessThan = false;
|
||||
let seenGreaterThan = false;
|
||||
let token = scanner.getToken();
|
||||
|
||||
loop: while (true) {
|
||||
switch (token) {
|
||||
case SyntaxKind.Identifier:
|
||||
case SyntaxKind.WhitespaceTrivia:
|
||||
case SyntaxKind.DotToken:
|
||||
case SyntaxKind.AtToken:
|
||||
comments.push(scanner.getTokenText());
|
||||
break;
|
||||
case SyntaxKind.LessThanToken:
|
||||
if (seenLessThan || seenGreaterThan) {
|
||||
return;
|
||||
}
|
||||
seenLessThan = true;
|
||||
comments.push(scanner.getTokenText());
|
||||
break;
|
||||
case SyntaxKind.GreaterThanToken:
|
||||
if (!seenLessThan || seenGreaterThan) {
|
||||
return;
|
||||
}
|
||||
seenGreaterThan = true;
|
||||
comments.push(scanner.getTokenText());
|
||||
scanner.setTextPos(scanner.getTokenPos() + 1);
|
||||
break loop;
|
||||
case SyntaxKind.NewLineTrivia:
|
||||
case SyntaxKind.EndOfFileToken:
|
||||
break loop;
|
||||
}
|
||||
|
||||
token = nextTokenJSDoc();
|
||||
}
|
||||
|
||||
if (seenLessThan && seenGreaterThan) {
|
||||
return comments.length === 0 ? undefined : comments.join("");
|
||||
}
|
||||
}
|
||||
|
||||
function parseAugmentsTag(start: number, tagName: Identifier): JSDocAugmentsTag {
|
||||
const result = <JSDocAugmentsTag>createNode(SyntaxKind.JSDocAugmentsTag, start);
|
||||
result.tagName = tagName;
|
||||
|
||||
+19
-20
@@ -502,30 +502,29 @@ namespace ts {
|
||||
return output;
|
||||
}
|
||||
|
||||
export function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string {
|
||||
if (isString(messageText)) {
|
||||
return messageText;
|
||||
export function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent = 0): string {
|
||||
if (isString(diag)) {
|
||||
return diag;
|
||||
}
|
||||
else {
|
||||
let diagnosticChain = messageText;
|
||||
let result = "";
|
||||
else if (diag === undefined) {
|
||||
return "";
|
||||
}
|
||||
let result = "";
|
||||
if (indent) {
|
||||
result += newLine;
|
||||
|
||||
let indent = 0;
|
||||
while (diagnosticChain) {
|
||||
if (indent) {
|
||||
result += newLine;
|
||||
|
||||
for (let i = 0; i < indent; i++) {
|
||||
result += " ";
|
||||
}
|
||||
}
|
||||
result += diagnosticChain.messageText;
|
||||
indent++;
|
||||
diagnosticChain = diagnosticChain.next;
|
||||
for (let i = 0; i < indent; i++) {
|
||||
result += " ";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
result += diag.messageText;
|
||||
indent++;
|
||||
if (diag.next) {
|
||||
for (const kid of diag.next) {
|
||||
result += flattenDiagnosticMessageText(kid, newLine, indent);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
|
||||
@@ -2086,6 +2086,8 @@ namespace ts {
|
||||
return token = SyntaxKind.CloseBracketToken;
|
||||
case CharacterCodes.lessThan:
|
||||
return token = SyntaxKind.LessThanToken;
|
||||
case CharacterCodes.greaterThan:
|
||||
return token = SyntaxKind.GreaterThanToken;
|
||||
case CharacterCodes.equals:
|
||||
return token = SyntaxKind.EqualsToken;
|
||||
case CharacterCodes.comma:
|
||||
|
||||
@@ -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))) {
|
||||
|
||||
+21
-5
@@ -17,6 +17,7 @@ namespace ts {
|
||||
| SyntaxKind.OpenBraceToken
|
||||
| SyntaxKind.CloseBraceToken
|
||||
| SyntaxKind.LessThanToken
|
||||
| SyntaxKind.GreaterThanToken
|
||||
| SyntaxKind.OpenBracketToken
|
||||
| SyntaxKind.CloseBracketToken
|
||||
| SyntaxKind.EqualsToken
|
||||
@@ -459,6 +460,7 @@ namespace ts {
|
||||
JSDocSignature,
|
||||
JSDocTag,
|
||||
JSDocAugmentsTag,
|
||||
JSDocAuthorTag,
|
||||
JSDocClassTag,
|
||||
JSDocCallbackTag,
|
||||
JSDocEnumTag,
|
||||
@@ -2455,6 +2457,10 @@ namespace ts {
|
||||
class: ExpressionWithTypeArguments & { expression: Identifier | PropertyAccessEntityNameExpression };
|
||||
}
|
||||
|
||||
export interface JSDocAuthorTag extends JSDocTag {
|
||||
kind: SyntaxKind.JSDocAuthorTag;
|
||||
}
|
||||
|
||||
export interface JSDocClassTag extends JSDocTag {
|
||||
kind: SyntaxKind.JSDocClassTag;
|
||||
}
|
||||
@@ -4269,13 +4275,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 */
|
||||
@@ -4563,7 +4579,7 @@ namespace ts {
|
||||
messageText: string;
|
||||
category: DiagnosticCategory;
|
||||
code: number;
|
||||
next?: DiagnosticMessageChain;
|
||||
next?: DiagnosticMessageChain[];
|
||||
}
|
||||
|
||||
export interface Diagnostic extends DiagnosticRelatedInformation {
|
||||
|
||||
+46
-30
@@ -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;
|
||||
}
|
||||
@@ -6071,6 +6071,10 @@ namespace ts {
|
||||
return node.kind === SyntaxKind.JSDocComment;
|
||||
}
|
||||
|
||||
export function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag {
|
||||
return node.kind === SyntaxKind.JSDocAuthorTag;
|
||||
}
|
||||
|
||||
export function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag {
|
||||
return node.kind === SyntaxKind.JSDocAugmentsTag;
|
||||
}
|
||||
@@ -7121,8 +7125,8 @@ namespace ts {
|
||||
};
|
||||
}
|
||||
|
||||
export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticMessageChain;
|
||||
export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage): DiagnosticMessageChain {
|
||||
export function chainDiagnosticMessages(details: DiagnosticMessageChain | DiagnosticMessageChain[] | undefined, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticMessageChain;
|
||||
export function chainDiagnosticMessages(details: DiagnosticMessageChain | DiagnosticMessageChain[] | undefined, message: DiagnosticMessage): DiagnosticMessageChain {
|
||||
let text = getLocaleSpecificMessage(message);
|
||||
|
||||
if (arguments.length > 2) {
|
||||
@@ -7134,18 +7138,17 @@ namespace ts {
|
||||
category: message.category,
|
||||
code: message.code,
|
||||
|
||||
next: details
|
||||
next: details === undefined || Array.isArray(details) ? details : [details]
|
||||
};
|
||||
}
|
||||
|
||||
export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain {
|
||||
export function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): void {
|
||||
let lastChain = headChain;
|
||||
while (lastChain.next) {
|
||||
lastChain = lastChain.next;
|
||||
lastChain = lastChain.next[0];
|
||||
}
|
||||
|
||||
lastChain.next = tailChain;
|
||||
return headChain;
|
||||
lastChain.next = [tailChain];
|
||||
}
|
||||
|
||||
function getDiagnosticFilePath(diagnostic: Diagnostic): string | undefined {
|
||||
@@ -7181,29 +7184,42 @@ namespace ts {
|
||||
}
|
||||
|
||||
function compareMessageText(t1: string | DiagnosticMessageChain, t2: string | DiagnosticMessageChain): Comparison {
|
||||
let text1: string | DiagnosticMessageChain | undefined = t1;
|
||||
let text2: string | DiagnosticMessageChain | undefined = t2;
|
||||
while (text1 && text2) {
|
||||
// We still have both chains.
|
||||
const string1 = isString(text1) ? text1 : text1.messageText;
|
||||
const string2 = isString(text2) ? text2 : text2.messageText;
|
||||
|
||||
const res = compareStringsCaseSensitive(string1, string2);
|
||||
if (typeof t1 === "string" && typeof t2 === "string") {
|
||||
return compareStringsCaseSensitive(t1, t2);
|
||||
}
|
||||
else if (typeof t1 === "string") {
|
||||
return Comparison.LessThan;
|
||||
}
|
||||
else if (typeof t2 === "string") {
|
||||
return Comparison.GreaterThan;
|
||||
}
|
||||
let res = compareStringsCaseSensitive(t1.messageText, t2.messageText);
|
||||
if (res) {
|
||||
return res;
|
||||
}
|
||||
if (!t1.next && !t2.next) {
|
||||
return Comparison.EqualTo;
|
||||
}
|
||||
if (!t1.next) {
|
||||
return Comparison.LessThan;
|
||||
}
|
||||
if (!t2.next) {
|
||||
return Comparison.GreaterThan;
|
||||
}
|
||||
const len = Math.min(t1.next.length, t2.next.length);
|
||||
for (let i = 0; i < len; i++) {
|
||||
res = compareMessageText(t1.next[i], t2.next[i]);
|
||||
if (res) {
|
||||
return res;
|
||||
}
|
||||
|
||||
text1 = isString(text1) ? undefined : text1.next;
|
||||
text2 = isString(text2) ? undefined : text2.next;
|
||||
}
|
||||
|
||||
if (!text1 && !text2) {
|
||||
// if the chains are done, then these messages are the same.
|
||||
return Comparison.EqualTo;
|
||||
if (t1.next.length < t2.next.length) {
|
||||
return Comparison.LessThan;
|
||||
}
|
||||
|
||||
// We still have one chain remaining. The shorter chain should come first.
|
||||
return text1 ? Comparison.GreaterThan : Comparison.LessThan;
|
||||
else if (t1.next.length > t2.next.length) {
|
||||
return Comparison.GreaterThan;
|
||||
}
|
||||
return Comparison.EqualTo;
|
||||
}
|
||||
|
||||
export function getEmitScriptTarget(compilerOptions: CompilerOptions) {
|
||||
@@ -8101,7 +8117,7 @@ namespace ts {
|
||||
visitDirectory(basePath, combinePaths(currentDirectory, basePath), depth);
|
||||
}
|
||||
|
||||
return flatten<string>(results);
|
||||
return flatten(results);
|
||||
|
||||
function visitDirectory(path: string, absolutePath: string, depth: number | undefined) {
|
||||
const canonicalPath = toCanonical(realpath(absolutePath));
|
||||
|
||||
@@ -1497,13 +1497,7 @@ Actual: ${stringify(fullActual)}`);
|
||||
const diagnostics = ts.getPreEmitDiagnostics(this.languageService.getProgram()!); // TODO: GH#18217
|
||||
for (const diagnostic of diagnostics) {
|
||||
if (!ts.isString(diagnostic.messageText)) {
|
||||
let chainedMessage: ts.DiagnosticMessageChain | undefined = diagnostic.messageText;
|
||||
let indentation = " ";
|
||||
while (chainedMessage) {
|
||||
resultString += indentation + chainedMessage.messageText + Harness.IO.newLine();
|
||||
chainedMessage = chainedMessage.next;
|
||||
indentation = indentation + " ";
|
||||
}
|
||||
resultString += this.flattenChainedMessage(diagnostic.messageText);
|
||||
}
|
||||
else {
|
||||
resultString += " " + diagnostic.messageText + Harness.IO.newLine();
|
||||
@@ -1521,6 +1515,17 @@ Actual: ${stringify(fullActual)}`);
|
||||
Harness.Baseline.runBaseline(ts.Debug.assertDefined(this.testData.globalOptions[MetadataOptionNames.baselineFile]), resultString);
|
||||
}
|
||||
|
||||
private flattenChainedMessage(diag: ts.DiagnosticMessageChain, indent = " ") {
|
||||
let result = "";
|
||||
result += indent + diag.messageText + Harness.IO.newLine();
|
||||
if (diag.next) {
|
||||
for (const kid of diag.next) {
|
||||
result += this.flattenChainedMessage(kid, indent + " ");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public baselineQuickInfo() {
|
||||
const baselineFile = this.getBaselineFileName();
|
||||
Harness.Baseline.runBaseline(
|
||||
|
||||
@@ -501,7 +501,7 @@ namespace Harness {
|
||||
}
|
||||
|
||||
function enumerateTestFiles(runner: RunnerBase) {
|
||||
return runner.enumerateTestFiles();
|
||||
return runner.getTestFiles();
|
||||
}
|
||||
|
||||
function listFiles(path: string, spec: RegExp, options: { recursive?: boolean } = {}) {
|
||||
@@ -1311,6 +1311,13 @@ namespace Harness {
|
||||
if (jsCode.length && jsCode.charCodeAt(jsCode.length - 1) !== ts.CharacterCodes.lineFeed) {
|
||||
jsCode += "\r\n";
|
||||
}
|
||||
if (!result.diagnostics.length && !ts.endsWith(file.file, ts.Extension.Json)) {
|
||||
const fileParseResult = ts.createSourceFile(file.file, file.text, options.target || ts.ScriptTarget.ES3, /*parentNodes*/ false, ts.endsWith(file.file, "x") ? ts.ScriptKind.JSX : ts.ScriptKind.JS);
|
||||
if (ts.length(fileParseResult.parseDiagnostics)) {
|
||||
jsCode += getErrorBaseline([file.asTestFile()], fileParseResult.parseDiagnostics);
|
||||
return;
|
||||
}
|
||||
}
|
||||
jsCode += fileOutput(file, harnessSettings);
|
||||
});
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@ type TestRunnerKind = CompilerTestKind | FourslashTestKind | "project" | "rwc" |
|
||||
type CompilerTestKind = "conformance" | "compiler";
|
||||
type FourslashTestKind = "fourslash" | "fourslash-shims" | "fourslash-shims-pp" | "fourslash-server";
|
||||
|
||||
let shards = 1;
|
||||
let shardId = 1;
|
||||
|
||||
abstract class RunnerBase {
|
||||
// contains the tests to run
|
||||
public tests: (string | Harness.FileBasedTest)[] = [];
|
||||
@@ -19,6 +22,14 @@ abstract class RunnerBase {
|
||||
|
||||
abstract enumerateTestFiles(): (string | Harness.FileBasedTest)[];
|
||||
|
||||
getTestFiles(): ReturnType<this["enumerateTestFiles"]> {
|
||||
const all = this.enumerateTestFiles();
|
||||
if (shards === 1) {
|
||||
return all as ReturnType<this["enumerateTestFiles"]>;
|
||||
}
|
||||
return all.filter((_val, idx) => idx % shards === (shardId - 1)) as ReturnType<this["enumerateTestFiles"]>;
|
||||
}
|
||||
|
||||
/** The working directory where tests are found. Needed for batch testing where the input path will differ from the output path inside baselines */
|
||||
public workingDirectory = "";
|
||||
|
||||
|
||||
@@ -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
@@ -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
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Vendored
+2468
-1306
File diff suppressed because it is too large
Load Diff
Vendored
+76
-35
@@ -63,16 +63,16 @@ interface FileList {
|
||||
|
||||
interface FormData {
|
||||
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the list.
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the list.
|
||||
*/
|
||||
entries(): IterableIterator<[string, FormDataEntryValue]>;
|
||||
/**
|
||||
* Returns a list of keys in the list.
|
||||
/**
|
||||
* Returns a list of keys in the list.
|
||||
*/
|
||||
keys(): IterableIterator<string>;
|
||||
/**
|
||||
* Returns a list of values in the list.
|
||||
/**
|
||||
* Returns a list of values in the list.
|
||||
*/
|
||||
values(): IterableIterator<FormDataEntryValue>;
|
||||
}
|
||||
@@ -99,16 +99,16 @@ interface HTMLSelectElement {
|
||||
|
||||
interface Headers {
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
/**
|
||||
* Returns an iterator allowing to go through all key/value pairs contained in this object.
|
||||
/**
|
||||
* Returns an iterator allowing to go through all key/value pairs contained in this object.
|
||||
*/
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
/**
|
||||
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
|
||||
/**
|
||||
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
|
||||
*/
|
||||
keys(): IterableIterator<string>;
|
||||
/**
|
||||
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
|
||||
/**
|
||||
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
|
||||
*/
|
||||
values(): IterableIterator<string>;
|
||||
}
|
||||
@@ -134,7 +134,7 @@ interface MediaList {
|
||||
}
|
||||
|
||||
interface MimeTypeArray {
|
||||
[Symbol.iterator](): IterableIterator<Plugin>;
|
||||
[Symbol.iterator](): IterableIterator<MimeType>;
|
||||
}
|
||||
|
||||
interface NamedNodeMap {
|
||||
@@ -147,32 +147,32 @@ interface Navigator {
|
||||
|
||||
interface NodeList {
|
||||
[Symbol.iterator](): IterableIterator<Node>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the list.
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the list.
|
||||
*/
|
||||
entries(): IterableIterator<[number, Node]>;
|
||||
/**
|
||||
* Returns an list of keys in the list.
|
||||
/**
|
||||
* Returns an list of keys in the list.
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
/**
|
||||
* Returns an list of values in the list.
|
||||
/**
|
||||
* Returns an list of values in the list.
|
||||
*/
|
||||
values(): IterableIterator<Node>;
|
||||
}
|
||||
|
||||
interface NodeListOf<TNode extends Node> {
|
||||
[Symbol.iterator](): IterableIterator<TNode>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the list.
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the list.
|
||||
*/
|
||||
entries(): IterableIterator<[number, TNode]>;
|
||||
/**
|
||||
* Returns an list of keys in the list.
|
||||
/**
|
||||
* Returns an list of keys in the list.
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
/**
|
||||
* Returns an list of values in the list.
|
||||
/**
|
||||
* Returns an list of values in the list.
|
||||
*/
|
||||
values(): IterableIterator<TNode>;
|
||||
}
|
||||
@@ -242,16 +242,16 @@ interface TouchList {
|
||||
|
||||
interface URLSearchParams {
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the search params.
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the search params.
|
||||
*/
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
/**
|
||||
* Returns a list of keys in the search params.
|
||||
/**
|
||||
* Returns a list of keys in the search params.
|
||||
*/
|
||||
keys(): IterableIterator<string>;
|
||||
/**
|
||||
* Returns a list of values in the search params.
|
||||
/**
|
||||
* Returns a list of values in the search params.
|
||||
*/
|
||||
values(): IterableIterator<string>;
|
||||
}
|
||||
@@ -272,7 +272,52 @@ interface WebAuthentication {
|
||||
makeCredential(accountInformation: Account, cryptoParameters: Iterable<ScopedCredentialParameters>, attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise<ScopedCredentialInfo>;
|
||||
}
|
||||
|
||||
interface WebGL2RenderingContextBase {
|
||||
invalidateFramebuffer(target: GLenum, attachments: Iterable<GLenum>): void;
|
||||
invalidateSubFramebuffer(target: GLenum, attachments: Iterable<GLenum>, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void;
|
||||
uniform1uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform2uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform3uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform4uiv(location: WebGLUniformLocation | null, data: Iterable<GLuint>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
vertexAttribI4iv(index: GLuint, values: Iterable<GLint>): void;
|
||||
vertexAttribI4uiv(index: GLuint, values: Iterable<GLuint>): void;
|
||||
drawBuffers(buffers: Iterable<GLenum>): void;
|
||||
clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLfloat>, srcOffset?: GLuint): void;
|
||||
clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLint>, srcOffset?: GLuint): void;
|
||||
clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable<GLuint>, srcOffset?: GLuint): void;
|
||||
transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable<string>, bufferMode: GLenum): void;
|
||||
getUniformIndices(program: WebGLProgram, uniformNames: Iterable<string>): Iterable<GLuint> | null;
|
||||
getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable<GLuint>, pname: GLenum): any;
|
||||
}
|
||||
|
||||
interface WebGL2RenderingContextOverloads {
|
||||
uniform1fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform2fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform3fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform4fv(location: WebGLUniformLocation | null, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform1iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform2iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform3iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniform4iv(location: WebGLUniformLocation | null, data: Iterable<GLint>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, data: Iterable<GLfloat>, srcOffset?: GLuint, srcLength?: GLuint): void;
|
||||
}
|
||||
|
||||
interface WebGLRenderingContextBase {
|
||||
vertexAttrib1fv(index: GLuint, values: Iterable<GLfloat>): void;
|
||||
vertexAttrib2fv(index: GLuint, values: Iterable<GLfloat>): void;
|
||||
vertexAttrib3fv(index: GLuint, values: Iterable<GLfloat>): void;
|
||||
vertexAttrib4fv(index: GLuint, values: Iterable<GLfloat>): void;
|
||||
}
|
||||
|
||||
interface WebGLRenderingContextOverloads {
|
||||
uniform1fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
|
||||
uniform2fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
|
||||
uniform3fv(location: WebGLUniformLocation | null, v: Iterable<GLfloat>): void;
|
||||
@@ -284,8 +329,4 @@ interface WebGLRenderingContextBase {
|
||||
uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
|
||||
uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
|
||||
uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Iterable<GLfloat>): void;
|
||||
vertexAttrib1fv(index: GLuint, values: Iterable<GLfloat>): void;
|
||||
vertexAttrib2fv(index: GLuint, values: Iterable<GLfloat>): void;
|
||||
vertexAttrib3fv(index: GLuint, values: Iterable<GLfloat>): void;
|
||||
vertexAttrib4fv(index: GLuint, values: Iterable<GLfloat>): void;
|
||||
}
|
||||
|
||||
Vendored
+9
-1
@@ -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 {
|
||||
/**
|
||||
|
||||
Vendored
+15
-7
@@ -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> {
|
||||
|
||||
Vendored
+59
@@ -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;
|
||||
}
|
||||
Vendored
+5
-4
@@ -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> {
|
||||
|
||||
Vendored
+1
@@ -1,4 +1,5 @@
|
||||
/// <reference lib="es2017" />
|
||||
/// <reference lib="es2018.asyncgenerator" />
|
||||
/// <reference lib="es2018.asynciterable" />
|
||||
/// <reference lib="es2018.promise" />
|
||||
/// <reference lib="es2018.regexp" />
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
"es2017.string",
|
||||
"es2017.intl",
|
||||
"es2017.typedarrays",
|
||||
"es2018.asyncgenerator",
|
||||
"es2018.asynciterable",
|
||||
"es2018.regexp",
|
||||
"es2018.promise",
|
||||
|
||||
Vendored
+1100
-67
File diff suppressed because it is too large
Load Diff
@@ -2841,8 +2841,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
|
||||
@@ -2859,8 +2860,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
|
||||
@@ -2896,8 +2898,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/* @internal */
|
||||
namespace ts.codefix {
|
||||
const fixId = "addMissingConst";
|
||||
const errorCodes = [
|
||||
Diagnostics.Cannot_find_name_0.code,
|
||||
Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code
|
||||
];
|
||||
|
||||
registerCodeFix({
|
||||
errorCodes,
|
||||
getCodeActions: (context) => {
|
||||
const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span.start, context.program));
|
||||
if (changes.length > 0) {
|
||||
return [createCodeFixAction(fixId, changes, Diagnostics.Add_const_to_unresolved_variable, fixId, Diagnostics.Add_const_to_all_unresolved_variables)];
|
||||
}
|
||||
},
|
||||
fixIds: [fixId],
|
||||
getAllCodeActions: context => {
|
||||
const fixedNodes = new NodeSet();
|
||||
return codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file, diag.start, context.program, fixedNodes));
|
||||
},
|
||||
});
|
||||
|
||||
function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, pos: number, program: Program, fixedNodes?: NodeSet<Node>) {
|
||||
const token = getTokenAtPosition(sourceFile, pos);
|
||||
const forInitializer = findAncestor(token, node =>
|
||||
isForInOrOfStatement(node.parent) ? node.parent.initializer === node :
|
||||
isPossiblyPartOfDestructuring(node) ? false : "quit"
|
||||
);
|
||||
if (forInitializer) return applyChange(changeTracker, forInitializer, sourceFile, fixedNodes);
|
||||
|
||||
const parent = token.parent;
|
||||
if (isBinaryExpression(parent) && isExpressionStatement(parent.parent)) {
|
||||
return applyChange(changeTracker, token, sourceFile, fixedNodes);
|
||||
}
|
||||
|
||||
if (isArrayLiteralExpression(parent)) {
|
||||
const checker = program.getTypeChecker();
|
||||
if (!every(parent.elements, element => arrayElementCouldBeVariableDeclaration(element, checker))) {
|
||||
return;
|
||||
}
|
||||
|
||||
return applyChange(changeTracker, parent, sourceFile, fixedNodes);
|
||||
}
|
||||
|
||||
const commaExpression = findAncestor(token, node =>
|
||||
isExpressionStatement(node.parent) ? true :
|
||||
isPossiblyPartOfCommaSeperatedInitializer(node) ? false : "quit"
|
||||
);
|
||||
if (commaExpression) {
|
||||
const checker = program.getTypeChecker();
|
||||
if (!expressionCouldBeVariableDeclaration(commaExpression, checker)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return applyChange(changeTracker, commaExpression, sourceFile, fixedNodes);
|
||||
}
|
||||
}
|
||||
|
||||
function applyChange(changeTracker: textChanges.ChangeTracker, initializer: Node, sourceFile: SourceFile, fixedNodes?: NodeSet<Node>) {
|
||||
if (!fixedNodes || fixedNodes.tryAdd(initializer)) {
|
||||
changeTracker.insertModifierBefore(sourceFile, SyntaxKind.ConstKeyword, initializer);
|
||||
}
|
||||
}
|
||||
|
||||
function isPossiblyPartOfDestructuring(node: Node): boolean {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
case SyntaxKind.ShorthandPropertyAssignment:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function arrayElementCouldBeVariableDeclaration(expression: Expression, checker: TypeChecker): boolean {
|
||||
const identifier =
|
||||
isIdentifier(expression) ? expression :
|
||||
isAssignmentExpression(expression, /*excludeCompoundAssignment*/ true) && isIdentifier(expression.left) ? expression.left :
|
||||
undefined;
|
||||
return !!identifier && !checker.getSymbolAtLocation(identifier);
|
||||
}
|
||||
|
||||
function isPossiblyPartOfCommaSeperatedInitializer(node: Node): boolean {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
case SyntaxKind.BinaryExpression:
|
||||
case SyntaxKind.CommaToken:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function expressionCouldBeVariableDeclaration(expression: Node, checker: TypeChecker): boolean {
|
||||
if (!isBinaryExpression(expression)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (expression.operatorToken.kind === SyntaxKind.CommaToken) {
|
||||
return every([expression.left, expression.right], expression => expressionCouldBeVariableDeclaration(expression, checker));
|
||||
}
|
||||
|
||||
return isIdentifier(expression.left) && !checker.getSymbolAtLocation(expression.left);
|
||||
}
|
||||
}
|
||||
@@ -72,9 +72,13 @@ namespace ts.SmartSelectionRange {
|
||||
function pushSelectionRange(start: number, end: number): void {
|
||||
// Skip empty ranges
|
||||
if (start !== end) {
|
||||
// Skip ranges that are identical to the parent
|
||||
const textSpan = createTextSpanFromBounds(start, end);
|
||||
if (!selectionRange || !textSpansEqual(textSpan, selectionRange.textSpan)) {
|
||||
if (!selectionRange || (
|
||||
// Skip ranges that are identical to the parent
|
||||
!textSpansEqual(textSpan, selectionRange.textSpan) &&
|
||||
// Skip ranges that don’t contain the original position
|
||||
textSpanIntersectsWithPosition(textSpan, pos)
|
||||
)) {
|
||||
selectionRange = { textSpan, ...selectionRange && { parent: selectionRange } };
|
||||
}
|
||||
}
|
||||
|
||||
+130
-104
@@ -847,9 +847,10 @@ namespace ts.textChanges {
|
||||
|
||||
/** Note: output node may be mutated input node. */
|
||||
export function getNonformattedText(node: Node, sourceFile: SourceFile | undefined, newLineCharacter: string): { text: string, node: Node } {
|
||||
const writer = new Writer(newLineCharacter);
|
||||
const omitTrailingSemicolon = !!sourceFile && !probablyUsesSemicolons(sourceFile);
|
||||
const writer = createWriter(newLineCharacter, omitTrailingSemicolon);
|
||||
const newLine = newLineCharacter === "\n" ? NewLineKind.LineFeed : NewLineKind.CarriageReturnLineFeed;
|
||||
createPrinter({ newLine, neverAsciiEscape: true }, writer).writeNode(EmitHint.Unspecified, node, sourceFile, writer);
|
||||
createPrinter({ newLine, neverAsciiEscape: true, omitTrailingSemicolon }, writer).writeNode(EmitHint.Unspecified, node, sourceFile, writer);
|
||||
return { text: writer.getText(), node: assignPositionsToNode(node) };
|
||||
}
|
||||
}
|
||||
@@ -887,143 +888,168 @@ namespace ts.textChanges {
|
||||
return nodeArray;
|
||||
}
|
||||
|
||||
class Writer implements EmitTextWriter, PrintHandlers {
|
||||
private lastNonTriviaPosition = 0;
|
||||
private readonly writer: EmitTextWriter;
|
||||
interface TextChangesWriter extends EmitTextWriter, PrintHandlers {}
|
||||
|
||||
public readonly onEmitNode: PrintHandlers["onEmitNode"];
|
||||
public readonly onBeforeEmitNodeArray: PrintHandlers["onBeforeEmitNodeArray"];
|
||||
public readonly onAfterEmitNodeArray: PrintHandlers["onAfterEmitNodeArray"];
|
||||
public readonly onBeforeEmitToken: PrintHandlers["onBeforeEmitToken"];
|
||||
public readonly onAfterEmitToken: PrintHandlers["onAfterEmitToken"];
|
||||
function createWriter(newLine: string, omitTrailingSemicolon?: boolean): TextChangesWriter {
|
||||
let lastNonTriviaPosition = 0;
|
||||
|
||||
constructor(newLine: string) {
|
||||
this.writer = createTextWriter(newLine);
|
||||
this.onEmitNode = (hint, node, printCallback) => {
|
||||
if (node) {
|
||||
setPos(node, this.lastNonTriviaPosition);
|
||||
}
|
||||
printCallback(hint, node);
|
||||
if (node) {
|
||||
setEnd(node, this.lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
this.onBeforeEmitNodeArray = nodes => {
|
||||
if (nodes) {
|
||||
setPos(nodes, this.lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
this.onAfterEmitNodeArray = nodes => {
|
||||
if (nodes) {
|
||||
setEnd(nodes, this.lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
this.onBeforeEmitToken = node => {
|
||||
if (node) {
|
||||
setPos(node, this.lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
this.onAfterEmitToken = node => {
|
||||
if (node) {
|
||||
setEnd(node, this.lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private setLastNonTriviaPosition(s: string, force: boolean) {
|
||||
const writer = omitTrailingSemicolon ? getTrailingSemicolonOmittingWriter(createTextWriter(newLine)) : createTextWriter(newLine);
|
||||
const onEmitNode: PrintHandlers["onEmitNode"] = (hint, node, printCallback) => {
|
||||
if (node) {
|
||||
setPos(node, lastNonTriviaPosition);
|
||||
}
|
||||
printCallback(hint, node);
|
||||
if (node) {
|
||||
setEnd(node, lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
const onBeforeEmitNodeArray: PrintHandlers["onBeforeEmitNodeArray"] = nodes => {
|
||||
if (nodes) {
|
||||
setPos(nodes, lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
const onAfterEmitNodeArray: PrintHandlers["onAfterEmitNodeArray"] = nodes => {
|
||||
if (nodes) {
|
||||
setEnd(nodes, lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
const onBeforeEmitToken: PrintHandlers["onBeforeEmitToken"] = node => {
|
||||
if (node) {
|
||||
setPos(node, lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
const onAfterEmitToken: PrintHandlers["onAfterEmitToken"] = node => {
|
||||
if (node) {
|
||||
setEnd(node, lastNonTriviaPosition);
|
||||
}
|
||||
};
|
||||
|
||||
function setLastNonTriviaPosition(s: string, force: boolean) {
|
||||
if (force || !isTrivia(s)) {
|
||||
this.lastNonTriviaPosition = this.writer.getTextPos();
|
||||
lastNonTriviaPosition = writer.getTextPos();
|
||||
let i = 0;
|
||||
while (isWhiteSpaceLike(s.charCodeAt(s.length - i - 1))) {
|
||||
i++;
|
||||
}
|
||||
// trim trailing whitespaces
|
||||
this.lastNonTriviaPosition -= i;
|
||||
lastNonTriviaPosition -= i;
|
||||
}
|
||||
}
|
||||
|
||||
write(s: string): void {
|
||||
this.writer.write(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function write(s: string): void {
|
||||
writer.write(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeComment(s: string): void {
|
||||
this.writer.writeComment(s);
|
||||
function writeComment(s: string): void {
|
||||
writer.writeComment(s);
|
||||
}
|
||||
writeKeyword(s: string): void {
|
||||
this.writer.writeKeyword(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function writeKeyword(s: string): void {
|
||||
writer.writeKeyword(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeOperator(s: string): void {
|
||||
this.writer.writeOperator(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function writeOperator(s: string): void {
|
||||
writer.writeOperator(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writePunctuation(s: string): void {
|
||||
this.writer.writePunctuation(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function writePunctuation(s: string): void {
|
||||
writer.writePunctuation(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeTrailingSemicolon(s: string): void {
|
||||
this.writer.writeTrailingSemicolon(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function writeTrailingSemicolon(s: string): void {
|
||||
writer.writeTrailingSemicolon(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeParameter(s: string): void {
|
||||
this.writer.writeParameter(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function writeParameter(s: string): void {
|
||||
writer.writeParameter(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeProperty(s: string): void {
|
||||
this.writer.writeProperty(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function writeProperty(s: string): void {
|
||||
writer.writeProperty(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeSpace(s: string): void {
|
||||
this.writer.writeSpace(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function writeSpace(s: string): void {
|
||||
writer.writeSpace(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeStringLiteral(s: string): void {
|
||||
this.writer.writeStringLiteral(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function writeStringLiteral(s: string): void {
|
||||
writer.writeStringLiteral(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeSymbol(s: string, sym: Symbol): void {
|
||||
this.writer.writeSymbol(s, sym);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function writeSymbol(s: string, sym: Symbol): void {
|
||||
writer.writeSymbol(s, sym);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeLine(): void {
|
||||
this.writer.writeLine();
|
||||
function writeLine(): void {
|
||||
writer.writeLine();
|
||||
}
|
||||
increaseIndent(): void {
|
||||
this.writer.increaseIndent();
|
||||
function increaseIndent(): void {
|
||||
writer.increaseIndent();
|
||||
}
|
||||
decreaseIndent(): void {
|
||||
this.writer.decreaseIndent();
|
||||
function decreaseIndent(): void {
|
||||
writer.decreaseIndent();
|
||||
}
|
||||
getText(): string {
|
||||
return this.writer.getText();
|
||||
function getText(): string {
|
||||
return writer.getText();
|
||||
}
|
||||
rawWrite(s: string): void {
|
||||
this.writer.rawWrite(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ false);
|
||||
function rawWrite(s: string): void {
|
||||
writer.rawWrite(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ false);
|
||||
}
|
||||
writeLiteral(s: string): void {
|
||||
this.writer.writeLiteral(s);
|
||||
this.setLastNonTriviaPosition(s, /*force*/ true);
|
||||
function writeLiteral(s: string): void {
|
||||
writer.writeLiteral(s);
|
||||
setLastNonTriviaPosition(s, /*force*/ true);
|
||||
}
|
||||
getTextPos(): number {
|
||||
return this.writer.getTextPos();
|
||||
function getTextPos(): number {
|
||||
return writer.getTextPos();
|
||||
}
|
||||
getLine(): number {
|
||||
return this.writer.getLine();
|
||||
function getLine(): number {
|
||||
return writer.getLine();
|
||||
}
|
||||
getColumn(): number {
|
||||
return this.writer.getColumn();
|
||||
function getColumn(): number {
|
||||
return writer.getColumn();
|
||||
}
|
||||
getIndent(): number {
|
||||
return this.writer.getIndent();
|
||||
function getIndent(): number {
|
||||
return writer.getIndent();
|
||||
}
|
||||
isAtStartOfLine(): boolean {
|
||||
return this.writer.isAtStartOfLine();
|
||||
function isAtStartOfLine(): boolean {
|
||||
return writer.isAtStartOfLine();
|
||||
}
|
||||
clear(): void {
|
||||
this.writer.clear();
|
||||
this.lastNonTriviaPosition = 0;
|
||||
function clear(): void {
|
||||
writer.clear();
|
||||
lastNonTriviaPosition = 0;
|
||||
}
|
||||
|
||||
return {
|
||||
onEmitNode,
|
||||
onBeforeEmitNodeArray,
|
||||
onAfterEmitNodeArray,
|
||||
onBeforeEmitToken,
|
||||
onAfterEmitToken,
|
||||
write,
|
||||
writeComment,
|
||||
writeKeyword,
|
||||
writeOperator,
|
||||
writePunctuation,
|
||||
writeTrailingSemicolon,
|
||||
writeParameter,
|
||||
writeProperty,
|
||||
writeSpace,
|
||||
writeStringLiteral,
|
||||
writeSymbol,
|
||||
writeLine,
|
||||
increaseIndent,
|
||||
decreaseIndent,
|
||||
getText,
|
||||
rawWrite,
|
||||
writeLiteral,
|
||||
getTextPos,
|
||||
getLine,
|
||||
getColumn,
|
||||
getIndent,
|
||||
isAtStartOfLine,
|
||||
clear
|
||||
};
|
||||
}
|
||||
|
||||
function getInsertionPositionAtSourceFileTop(sourceFile: SourceFile): number {
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
"codeFixProvider.ts",
|
||||
"refactorProvider.ts",
|
||||
"codefixes/addConvertToUnknownForNonOverlappingTypes.ts",
|
||||
"codefixes/addMissingConst.ts",
|
||||
"codefixes/addMissingInvocationForDecorator.ts",
|
||||
"codefixes/addNameToNamelessParameter.ts",
|
||||
"codefixes/annotateWithTypeFromJSDoc.ts",
|
||||
|
||||
@@ -1991,4 +1991,51 @@ namespace ts {
|
||||
});
|
||||
return typeIsAccessible ? res : undefined;
|
||||
}
|
||||
|
||||
export function syntaxUsuallyHasTrailingSemicolon(kind: SyntaxKind) {
|
||||
return kind === SyntaxKind.VariableStatement
|
||||
|| kind === SyntaxKind.ExpressionStatement
|
||||
|| kind === SyntaxKind.DoStatement
|
||||
|| kind === SyntaxKind.ContinueStatement
|
||||
|| kind === SyntaxKind.BreakStatement
|
||||
|| kind === SyntaxKind.ReturnStatement
|
||||
|| kind === SyntaxKind.ThrowStatement
|
||||
|| kind === SyntaxKind.DebuggerStatement
|
||||
|| kind === SyntaxKind.PropertyDeclaration
|
||||
|| kind === SyntaxKind.TypeAliasDeclaration
|
||||
|| kind === SyntaxKind.ImportDeclaration
|
||||
|| kind === SyntaxKind.ImportEqualsDeclaration
|
||||
|| kind === SyntaxKind.ExportDeclaration;
|
||||
}
|
||||
|
||||
export function probablyUsesSemicolons(sourceFile: SourceFile): boolean {
|
||||
let withSemicolon = 0;
|
||||
let withoutSemicolon = 0;
|
||||
const nStatementsToObserve = 5;
|
||||
forEachChild(sourceFile, function visit(node): boolean | undefined {
|
||||
if (syntaxUsuallyHasTrailingSemicolon(node.kind)) {
|
||||
const lastToken = node.getLastToken(sourceFile);
|
||||
if (lastToken && lastToken.kind === SyntaxKind.SemicolonToken) {
|
||||
withSemicolon++;
|
||||
}
|
||||
else {
|
||||
withoutSemicolon++;
|
||||
}
|
||||
}
|
||||
if (withSemicolon + withoutSemicolon >= nStatementsToObserve) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return forEachChild(node, visit);
|
||||
});
|
||||
|
||||
// One statement missing a semicolon isn’t sufficient evidence to say the user
|
||||
// doesn’t want semicolons, because they may not even be done writing that statement.
|
||||
if (withSemicolon === 0 && withoutSemicolon <= 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If even 2/5 places have a semicolon, the user probably wants semicolons
|
||||
return withSemicolon / withoutSemicolon > 1 / nStatementsToObserve;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
|
||||
*/
|
||||
initializeTests(): void {
|
||||
// Read in and evaluate the test list
|
||||
const testList = this.tests && this.tests.length ? this.tests : this.enumerateTestFiles();
|
||||
const testList = this.tests && this.tests.length ? this.tests : this.getTestFiles();
|
||||
|
||||
// tslint:disable-next-line:no-this-assignment
|
||||
const cls = this;
|
||||
@@ -113,7 +113,7 @@ class DockerfileRunner extends ExternalCompileRunnerBase {
|
||||
}
|
||||
initializeTests(): void {
|
||||
// Read in and evaluate the test list
|
||||
const testList = this.tests && this.tests.length ? this.tests : this.enumerateTestFiles();
|
||||
const testList = this.tests && this.tests.length ? this.tests : this.getTestFiles();
|
||||
|
||||
// tslint:disable-next-line:no-this-assignment
|
||||
const cls = this;
|
||||
@@ -201,7 +201,7 @@ function sanitizeTimestamps(result: string): string {
|
||||
function sanitizeVersionSpecifiers(result: string): string {
|
||||
return result
|
||||
.replace(/\d+.\d+.\d+-insiders.\d\d\d\d\d\d\d\d/g, "X.X.X-insiders.xxxxxxxx")
|
||||
.replace(/([@v])\d+\.\d+\.\d+/g, "$1X.X.X");
|
||||
.replace(/([@v\()])\d+\.\d+\.\d+/g, "$1X.X.X");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace Harness.Parallel.Host {
|
||||
console.log("Discovering runner-based tests...");
|
||||
const discoverStart = +(new Date());
|
||||
for (const runner of runners) {
|
||||
for (const test of runner.enumerateTestFiles()) {
|
||||
for (const test of runner.getTestFiles()) {
|
||||
const file = typeof test === "string" ? test : test.file;
|
||||
let size: number;
|
||||
if (!perfData) {
|
||||
@@ -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.`}`);
|
||||
|
||||
@@ -32,7 +32,11 @@ namespace project {
|
||||
|
||||
export class ProjectRunner extends RunnerBase {
|
||||
public enumerateTestFiles() {
|
||||
return this.enumerateFiles("tests/cases/project", /\.json$/, { recursive: true });
|
||||
const all = this.enumerateFiles("tests/cases/project", /\.json$/, { recursive: true });
|
||||
if (shards === 1) {
|
||||
return all;
|
||||
}
|
||||
return all.filter((_val, idx) => idx % shards === (shardId - 1));
|
||||
}
|
||||
|
||||
public kind(): TestRunnerKind {
|
||||
|
||||
@@ -80,6 +80,8 @@ interface TestConfig {
|
||||
timeout?: number;
|
||||
keepFailed?: boolean;
|
||||
skipPercent?: number;
|
||||
shardId?: number;
|
||||
shards?: number;
|
||||
}
|
||||
|
||||
interface TaskSet {
|
||||
@@ -114,6 +116,12 @@ function handleTestConfig() {
|
||||
if (testConfig.skipPercent !== undefined) {
|
||||
skipPercent = testConfig.skipPercent;
|
||||
}
|
||||
if (testConfig.shardId) {
|
||||
shardId = testConfig.shardId;
|
||||
}
|
||||
if (testConfig.shards) {
|
||||
shards = testConfig.shards;
|
||||
}
|
||||
|
||||
if (testConfig.stackTraceLimit === "full") {
|
||||
(<any>Error).stackTraceLimit = Infinity;
|
||||
@@ -129,6 +137,9 @@ function handleTestConfig() {
|
||||
|
||||
const runnerConfig = testConfig.runners || testConfig.test;
|
||||
if (runnerConfig && runnerConfig.length > 0) {
|
||||
if (testConfig.runners) {
|
||||
runUnitTests = runnerConfig.indexOf("unittest") !== -1;
|
||||
}
|
||||
for (const option of runnerConfig) {
|
||||
if (!option) {
|
||||
continue;
|
||||
|
||||
@@ -225,7 +225,7 @@ class RWCRunner extends RunnerBase {
|
||||
*/
|
||||
public initializeTests(): void {
|
||||
// Read in and evaluate the test list
|
||||
for (const test of this.tests && this.tests.length ? this.tests : this.enumerateTestFiles()) {
|
||||
for (const test of this.tests && this.tests.length ? this.tests : this.getTestFiles()) {
|
||||
this.runTest(typeof test === "string" ? test : test.file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class Test262BaselineRunner extends RunnerBase {
|
||||
public initializeTests() {
|
||||
// this will set up a series of describe/it blocks to run between the setup and cleanup phases
|
||||
if (this.tests.length === 0) {
|
||||
const testFiles = this.enumerateTestFiles();
|
||||
const testFiles = this.getTestFiles();
|
||||
testFiles.forEach(fn => {
|
||||
this.runTest(fn);
|
||||
});
|
||||
|
||||
@@ -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 } };
|
||||
|
||||
@@ -315,6 +315,11 @@ namespace ts {
|
||||
* {@link first link}
|
||||
* Inside {@link link text} thing
|
||||
* @see {@link second link text} and {@link Foo|a foo} as well.
|
||||
*/`);
|
||||
parsesCorrectly("authorTag",
|
||||
`/**
|
||||
* @author John Doe <john.doe@example.com>
|
||||
* @author John Doe <john.doe@example.com> unexpected comment
|
||||
*/`);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,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>
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"kind": "JSDocComment",
|
||||
"pos": 0,
|
||||
"end": 112,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"tags": {
|
||||
"0": {
|
||||
"kind": "JSDocAuthorTag",
|
||||
"pos": 7,
|
||||
"end": 50,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"tagName": {
|
||||
"kind": "Identifier",
|
||||
"pos": 8,
|
||||
"end": 14,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"escapedText": "author"
|
||||
},
|
||||
"comment": "John Doe <john.doe@example.com>"
|
||||
},
|
||||
"1": {
|
||||
"kind": "JSDocAuthorTag",
|
||||
"pos": 50,
|
||||
"end": 110,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"tagName": {
|
||||
"kind": "Identifier",
|
||||
"pos": 51,
|
||||
"end": 57,
|
||||
"modifierFlagsCache": 0,
|
||||
"transformFlags": 0,
|
||||
"escapedText": "author"
|
||||
},
|
||||
"comment": "John Doe <john.doe@example.com> unexpected comment"
|
||||
},
|
||||
"length": 2,
|
||||
"pos": 7,
|
||||
"end": 110
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
+28
-23
@@ -53,7 +53,7 @@ declare namespace ts {
|
||||
interface Iterator<T> {
|
||||
next(): {
|
||||
value: T;
|
||||
done: false;
|
||||
done?: false;
|
||||
} | {
|
||||
value: never;
|
||||
done: true;
|
||||
@@ -72,7 +72,7 @@ declare namespace ts {
|
||||
pos: number;
|
||||
end: number;
|
||||
}
|
||||
type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind;
|
||||
type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind;
|
||||
type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword;
|
||||
type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
|
||||
enum SyntaxKind {
|
||||
@@ -379,23 +379,24 @@ declare namespace ts {
|
||||
JSDocSignature = 299,
|
||||
JSDocTag = 300,
|
||||
JSDocAugmentsTag = 301,
|
||||
JSDocClassTag = 302,
|
||||
JSDocCallbackTag = 303,
|
||||
JSDocEnumTag = 304,
|
||||
JSDocParameterTag = 305,
|
||||
JSDocReturnTag = 306,
|
||||
JSDocThisTag = 307,
|
||||
JSDocTypeTag = 308,
|
||||
JSDocTemplateTag = 309,
|
||||
JSDocTypedefTag = 310,
|
||||
JSDocPropertyTag = 311,
|
||||
SyntaxList = 312,
|
||||
NotEmittedStatement = 313,
|
||||
PartiallyEmittedExpression = 314,
|
||||
CommaListExpression = 315,
|
||||
MergeDeclarationMarker = 316,
|
||||
EndOfDeclarationMarker = 317,
|
||||
Count = 318,
|
||||
JSDocAuthorTag = 302,
|
||||
JSDocClassTag = 303,
|
||||
JSDocCallbackTag = 304,
|
||||
JSDocEnumTag = 305,
|
||||
JSDocParameterTag = 306,
|
||||
JSDocReturnTag = 307,
|
||||
JSDocThisTag = 308,
|
||||
JSDocTypeTag = 309,
|
||||
JSDocTemplateTag = 310,
|
||||
JSDocTypedefTag = 311,
|
||||
JSDocPropertyTag = 312,
|
||||
SyntaxList = 313,
|
||||
NotEmittedStatement = 314,
|
||||
PartiallyEmittedExpression = 315,
|
||||
CommaListExpression = 316,
|
||||
MergeDeclarationMarker = 317,
|
||||
EndOfDeclarationMarker = 318,
|
||||
Count = 319,
|
||||
FirstAssignment = 60,
|
||||
LastAssignment = 72,
|
||||
FirstCompoundAssignment = 61,
|
||||
@@ -422,9 +423,9 @@ declare namespace ts {
|
||||
LastBinaryOperator = 72,
|
||||
FirstNode = 149,
|
||||
FirstJSDocNode = 289,
|
||||
LastJSDocNode = 311,
|
||||
LastJSDocNode = 312,
|
||||
FirstJSDocTagNode = 300,
|
||||
LastJSDocTagNode = 311,
|
||||
LastJSDocTagNode = 312,
|
||||
}
|
||||
enum NodeFlags {
|
||||
None = 0,
|
||||
@@ -1581,6 +1582,9 @@ declare namespace ts {
|
||||
expression: Identifier | PropertyAccessEntityNameExpression;
|
||||
};
|
||||
}
|
||||
interface JSDocAuthorTag extends JSDocTag {
|
||||
kind: SyntaxKind.JSDocAuthorTag;
|
||||
}
|
||||
interface JSDocClassTag extends JSDocTag {
|
||||
kind: SyntaxKind.JSDocClassTag;
|
||||
}
|
||||
@@ -2453,7 +2457,7 @@ declare namespace ts {
|
||||
messageText: string;
|
||||
category: DiagnosticCategory;
|
||||
code: number;
|
||||
next?: DiagnosticMessageChain;
|
||||
next?: DiagnosticMessageChain[];
|
||||
}
|
||||
interface Diagnostic extends DiagnosticRelatedInformation {
|
||||
/** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
|
||||
@@ -3533,6 +3537,7 @@ declare namespace ts {
|
||||
function isJSDocFunctionType(node: Node): node is JSDocFunctionType;
|
||||
function isJSDocVariadicType(node: Node): node is JSDocVariadicType;
|
||||
function isJSDoc(node: Node): node is JSDoc;
|
||||
function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag;
|
||||
function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag;
|
||||
function isJSDocClassTag(node: Node): node is JSDocClassTag;
|
||||
function isJSDocEnumTag(node: Node): node is JSDocEnumTag;
|
||||
@@ -4273,7 +4278,7 @@ declare namespace ts {
|
||||
function formatDiagnostics(diagnostics: ReadonlyArray<Diagnostic>, host: FormatDiagnosticsHost): string;
|
||||
function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
|
||||
function formatDiagnosticsWithColorAndContext(diagnostics: ReadonlyArray<Diagnostic>, host: FormatDiagnosticsHost): string;
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string;
|
||||
function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string;
|
||||
function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): ReadonlyArray<Diagnostic>;
|
||||
/**
|
||||
* Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
|
||||
|
||||
+28
-23
@@ -53,7 +53,7 @@ declare namespace ts {
|
||||
interface Iterator<T> {
|
||||
next(): {
|
||||
value: T;
|
||||
done: false;
|
||||
done?: false;
|
||||
} | {
|
||||
value: never;
|
||||
done: true;
|
||||
@@ -72,7 +72,7 @@ declare namespace ts {
|
||||
pos: number;
|
||||
end: number;
|
||||
}
|
||||
type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind;
|
||||
type JSDocSyntaxKind = SyntaxKind.EndOfFileToken | SyntaxKind.WhitespaceTrivia | SyntaxKind.AtToken | SyntaxKind.NewLineTrivia | SyntaxKind.AsteriskToken | SyntaxKind.OpenBraceToken | SyntaxKind.CloseBraceToken | SyntaxKind.LessThanToken | SyntaxKind.GreaterThanToken | SyntaxKind.OpenBracketToken | SyntaxKind.CloseBracketToken | SyntaxKind.EqualsToken | SyntaxKind.CommaToken | SyntaxKind.DotToken | SyntaxKind.Identifier | SyntaxKind.BacktickToken | SyntaxKind.Unknown | KeywordSyntaxKind;
|
||||
type KeywordSyntaxKind = SyntaxKind.AbstractKeyword | SyntaxKind.AnyKeyword | SyntaxKind.AsKeyword | SyntaxKind.BigIntKeyword | SyntaxKind.BooleanKeyword | SyntaxKind.BreakKeyword | SyntaxKind.CaseKeyword | SyntaxKind.CatchKeyword | SyntaxKind.ClassKeyword | SyntaxKind.ContinueKeyword | SyntaxKind.ConstKeyword | SyntaxKind.ConstructorKeyword | SyntaxKind.DebuggerKeyword | SyntaxKind.DeclareKeyword | SyntaxKind.DefaultKeyword | SyntaxKind.DeleteKeyword | SyntaxKind.DoKeyword | SyntaxKind.ElseKeyword | SyntaxKind.EnumKeyword | SyntaxKind.ExportKeyword | SyntaxKind.ExtendsKeyword | SyntaxKind.FalseKeyword | SyntaxKind.FinallyKeyword | SyntaxKind.ForKeyword | SyntaxKind.FromKeyword | SyntaxKind.FunctionKeyword | SyntaxKind.GetKeyword | SyntaxKind.IfKeyword | SyntaxKind.ImplementsKeyword | SyntaxKind.ImportKeyword | SyntaxKind.InKeyword | SyntaxKind.InferKeyword | SyntaxKind.InstanceOfKeyword | SyntaxKind.InterfaceKeyword | SyntaxKind.IsKeyword | SyntaxKind.KeyOfKeyword | SyntaxKind.LetKeyword | SyntaxKind.ModuleKeyword | SyntaxKind.NamespaceKeyword | SyntaxKind.NeverKeyword | SyntaxKind.NewKeyword | SyntaxKind.NullKeyword | SyntaxKind.NumberKeyword | SyntaxKind.ObjectKeyword | SyntaxKind.PackageKeyword | SyntaxKind.PrivateKeyword | SyntaxKind.ProtectedKeyword | SyntaxKind.PublicKeyword | SyntaxKind.ReadonlyKeyword | SyntaxKind.RequireKeyword | SyntaxKind.GlobalKeyword | SyntaxKind.ReturnKeyword | SyntaxKind.SetKeyword | SyntaxKind.StaticKeyword | SyntaxKind.StringKeyword | SyntaxKind.SuperKeyword | SyntaxKind.SwitchKeyword | SyntaxKind.SymbolKeyword | SyntaxKind.ThisKeyword | SyntaxKind.ThrowKeyword | SyntaxKind.TrueKeyword | SyntaxKind.TryKeyword | SyntaxKind.TypeKeyword | SyntaxKind.TypeOfKeyword | SyntaxKind.UndefinedKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.UnknownKeyword | SyntaxKind.VarKeyword | SyntaxKind.VoidKeyword | SyntaxKind.WhileKeyword | SyntaxKind.WithKeyword | SyntaxKind.YieldKeyword | SyntaxKind.AsyncKeyword | SyntaxKind.AwaitKeyword | SyntaxKind.OfKeyword;
|
||||
type JsxTokenSyntaxKind = SyntaxKind.LessThanSlashToken | SyntaxKind.EndOfFileToken | SyntaxKind.ConflictMarkerTrivia | SyntaxKind.JsxText | SyntaxKind.JsxTextAllWhiteSpaces | SyntaxKind.OpenBraceToken | SyntaxKind.LessThanToken;
|
||||
enum SyntaxKind {
|
||||
@@ -379,23 +379,24 @@ declare namespace ts {
|
||||
JSDocSignature = 299,
|
||||
JSDocTag = 300,
|
||||
JSDocAugmentsTag = 301,
|
||||
JSDocClassTag = 302,
|
||||
JSDocCallbackTag = 303,
|
||||
JSDocEnumTag = 304,
|
||||
JSDocParameterTag = 305,
|
||||
JSDocReturnTag = 306,
|
||||
JSDocThisTag = 307,
|
||||
JSDocTypeTag = 308,
|
||||
JSDocTemplateTag = 309,
|
||||
JSDocTypedefTag = 310,
|
||||
JSDocPropertyTag = 311,
|
||||
SyntaxList = 312,
|
||||
NotEmittedStatement = 313,
|
||||
PartiallyEmittedExpression = 314,
|
||||
CommaListExpression = 315,
|
||||
MergeDeclarationMarker = 316,
|
||||
EndOfDeclarationMarker = 317,
|
||||
Count = 318,
|
||||
JSDocAuthorTag = 302,
|
||||
JSDocClassTag = 303,
|
||||
JSDocCallbackTag = 304,
|
||||
JSDocEnumTag = 305,
|
||||
JSDocParameterTag = 306,
|
||||
JSDocReturnTag = 307,
|
||||
JSDocThisTag = 308,
|
||||
JSDocTypeTag = 309,
|
||||
JSDocTemplateTag = 310,
|
||||
JSDocTypedefTag = 311,
|
||||
JSDocPropertyTag = 312,
|
||||
SyntaxList = 313,
|
||||
NotEmittedStatement = 314,
|
||||
PartiallyEmittedExpression = 315,
|
||||
CommaListExpression = 316,
|
||||
MergeDeclarationMarker = 317,
|
||||
EndOfDeclarationMarker = 318,
|
||||
Count = 319,
|
||||
FirstAssignment = 60,
|
||||
LastAssignment = 72,
|
||||
FirstCompoundAssignment = 61,
|
||||
@@ -422,9 +423,9 @@ declare namespace ts {
|
||||
LastBinaryOperator = 72,
|
||||
FirstNode = 149,
|
||||
FirstJSDocNode = 289,
|
||||
LastJSDocNode = 311,
|
||||
LastJSDocNode = 312,
|
||||
FirstJSDocTagNode = 300,
|
||||
LastJSDocTagNode = 311,
|
||||
LastJSDocTagNode = 312,
|
||||
}
|
||||
enum NodeFlags {
|
||||
None = 0,
|
||||
@@ -1581,6 +1582,9 @@ declare namespace ts {
|
||||
expression: Identifier | PropertyAccessEntityNameExpression;
|
||||
};
|
||||
}
|
||||
interface JSDocAuthorTag extends JSDocTag {
|
||||
kind: SyntaxKind.JSDocAuthorTag;
|
||||
}
|
||||
interface JSDocClassTag extends JSDocTag {
|
||||
kind: SyntaxKind.JSDocClassTag;
|
||||
}
|
||||
@@ -2453,7 +2457,7 @@ declare namespace ts {
|
||||
messageText: string;
|
||||
category: DiagnosticCategory;
|
||||
code: number;
|
||||
next?: DiagnosticMessageChain;
|
||||
next?: DiagnosticMessageChain[];
|
||||
}
|
||||
interface Diagnostic extends DiagnosticRelatedInformation {
|
||||
/** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
|
||||
@@ -3533,6 +3537,7 @@ declare namespace ts {
|
||||
function isJSDocFunctionType(node: Node): node is JSDocFunctionType;
|
||||
function isJSDocVariadicType(node: Node): node is JSDocVariadicType;
|
||||
function isJSDoc(node: Node): node is JSDoc;
|
||||
function isJSDocAuthorTag(node: Node): node is JSDocAuthorTag;
|
||||
function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag;
|
||||
function isJSDocClassTag(node: Node): node is JSDocClassTag;
|
||||
function isJSDocEnumTag(node: Node): node is JSDocEnumTag;
|
||||
@@ -4273,7 +4278,7 @@ declare namespace ts {
|
||||
function formatDiagnostics(diagnostics: ReadonlyArray<Diagnostic>, host: FormatDiagnosticsHost): string;
|
||||
function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string;
|
||||
function formatDiagnosticsWithColorAndContext(diagnostics: ReadonlyArray<Diagnostic>, host: FormatDiagnosticsHost): string;
|
||||
function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string;
|
||||
function flattenDiagnosticMessageText(diag: string | DiagnosticMessageChain | undefined, newLine: string, indent?: number): string;
|
||||
function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): ReadonlyArray<Diagnostic>;
|
||||
/**
|
||||
* Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions'
|
||||
|
||||
@@ -27,9 +27,9 @@ class Derived extends Base {
|
||||
|
||||
// Arrow function as function argument
|
||||
window.setTimeout(() => null, 100);
|
||||
>window.setTimeout : Symbol(WindowOrWorkerGlobalScope.setTimeout, Decl(lib.dom.d.ts, --, --))
|
||||
>window.setTimeout : Symbol(setTimeout, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
>window : Symbol(window, Decl(lib.dom.d.ts, --, --))
|
||||
>setTimeout : Symbol(WindowOrWorkerGlobalScope.setTimeout, Decl(lib.dom.d.ts, --, --))
|
||||
>setTimeout : Symbol(setTimeout, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
|
||||
// Arrow function as value in array literal
|
||||
|
||||
@@ -108,9 +108,9 @@ module M2 {
|
||||
|
||||
// Arrow function as function argument
|
||||
window.setTimeout(() => null, 100);
|
||||
>window.setTimeout : Symbol(WindowOrWorkerGlobalScope.setTimeout, Decl(lib.dom.d.ts, --, --))
|
||||
>window.setTimeout : Symbol(setTimeout, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
>window : Symbol(window, Decl(lib.dom.d.ts, --, --))
|
||||
>setTimeout : Symbol(WindowOrWorkerGlobalScope.setTimeout, Decl(lib.dom.d.ts, --, --))
|
||||
>setTimeout : Symbol(setTimeout, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))
|
||||
|
||||
// Arrow function as value in array literal
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
=== tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts ===
|
||||
// Arrow function used in with statement
|
||||
with (window) {
|
||||
>window : Window
|
||||
>window : Window & typeof globalThis
|
||||
|
||||
var p = () => this;
|
||||
>p : any
|
||||
@@ -33,9 +33,9 @@ class Derived extends Base {
|
||||
// Arrow function as function argument
|
||||
window.setTimeout(() => null, 100);
|
||||
>window.setTimeout(() => null, 100) : number
|
||||
>window.setTimeout : (handler: TimerHandler, timeout?: number, ...arguments: any[]) => number
|
||||
>window : Window
|
||||
>setTimeout : (handler: TimerHandler, timeout?: number, ...arguments: any[]) => number
|
||||
>window.setTimeout : ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number)
|
||||
>window : Window & typeof globalThis
|
||||
>setTimeout : ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number)
|
||||
>() => null : () => any
|
||||
>null : null
|
||||
>100 : 100
|
||||
@@ -104,7 +104,7 @@ module M2 {
|
||||
|
||||
// Arrow function used in with statement
|
||||
with (window) {
|
||||
>window : Window
|
||||
>window : Window & typeof globalThis
|
||||
|
||||
var p = () => this;
|
||||
>p : any
|
||||
@@ -136,9 +136,9 @@ module M2 {
|
||||
// Arrow function as function argument
|
||||
window.setTimeout(() => null, 100);
|
||||
>window.setTimeout(() => null, 100) : number
|
||||
>window.setTimeout : (handler: TimerHandler, timeout?: number, ...arguments: any[]) => number
|
||||
>window : Window
|
||||
>setTimeout : (handler: TimerHandler, timeout?: number, ...arguments: any[]) => number
|
||||
>window.setTimeout : ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number)
|
||||
>window : Window & typeof globalThis
|
||||
>setTimeout : ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number) & ((handler: TimerHandler, timeout?: number, ...arguments: any[]) => number)
|
||||
>() => null : () => any
|
||||
>null : null
|
||||
>100 : 100
|
||||
|
||||
@@ -3,7 +3,7 @@ async () => {
|
||||
>async () => { if (window) return;} : () => Promise<void>
|
||||
|
||||
if (window)
|
||||
>window : Window
|
||||
>window : Window & typeof globalThis
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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,9 +1,30 @@
|
||||
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,33): error TS2345: 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(16,33): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(length?: number): BigInt64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 3, '(array: Iterable<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, any, undefined>'.
|
||||
Type 'IterableIterator<number>' is not assignable to type 'Iterator<bigint, any, undefined>'.
|
||||
Types of property 'next' are incompatible.
|
||||
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,35): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
|
||||
tests/cases/compiler/bigintWithLib.ts(28,35): error TS2769: No overload matches this call.
|
||||
Overload 1 of 3, '(length?: number): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'number'.
|
||||
Overload 2 of 3, '(array: Iterable<bigint>): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'Iterable<bigint>'.
|
||||
Overload 3 of 3, '(buffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): BigUint64Array', gave the following error.
|
||||
Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
|
||||
tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property.
|
||||
tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'.
|
||||
tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'.
|
||||
@@ -29,8 +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 TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
!!! error TS2345: 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);
|
||||
@@ -46,8 +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 TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
|
||||
!!! error TS2345: 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);
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2322: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
|
||||
Types of property 'children' are incompatible.
|
||||
Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
|
||||
Types of property 'length' are incompatible.
|
||||
Type '3' is not assignable to type '2'.
|
||||
tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2769: No overload matches this call.
|
||||
Overload 1 of 2, '(props: Readonly<ResizablePanelProps>): ResizablePanel', gave the following error.
|
||||
Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
|
||||
Types of property 'children' are incompatible.
|
||||
Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
|
||||
Types of property 'length' are incompatible.
|
||||
Type '3' is not assignable to type '2'.
|
||||
Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error.
|
||||
Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
|
||||
Types of property 'children' are incompatible.
|
||||
Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx (1 errors) ====
|
||||
@@ -24,11 +30,17 @@ tests/cases/conformance/jsx/checkJsxChildrenCanBeTupleType.tsx(17,18): error TS2
|
||||
|
||||
const testErr = <ResizablePanel>
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
|
||||
!!! error TS2322: Types of property 'children' are incompatible.
|
||||
!!! error TS2322: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
|
||||
!!! error TS2322: Types of property 'length' are incompatible.
|
||||
!!! error TS2322: Type '3' is not assignable to type '2'.
|
||||
!!! error TS2769: No overload matches this call.
|
||||
!!! error TS2769: Overload 1 of 2, '(props: Readonly<ResizablePanelProps>): ResizablePanel', gave the following error.
|
||||
!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
|
||||
!!! error TS2769: Types of property 'children' are incompatible.
|
||||
!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
|
||||
!!! error TS2769: Types of property 'length' are incompatible.
|
||||
!!! error TS2769: Type '3' is not assignable to type '2'.
|
||||
!!! error TS2769: Overload 2 of 2, '(props: ResizablePanelProps, context?: any): ResizablePanel', gave the following error.
|
||||
!!! error TS2769: Type '{ children: [Element, Element, Element]; }' is not assignable to type 'Readonly<ResizablePanelProps>'.
|
||||
!!! error TS2769: Types of property 'children' are incompatible.
|
||||
!!! error TS2769: Type '[Element, Element, Element]' is not assignable to type '[ReactNode, ReactNode]'.
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
|
||||
+98
-58
@@ -4,35 +4,55 @@ tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfin
|
||||
Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P] : GetProps<C>[P]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[P] | (TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[P]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[P]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] | (TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type '(Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]) | (Extract<number, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : GetProps<C>[Extract<number, keyof GetProps<C>>]) | (Extract<symbol, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : GetProps<C>[Extract<symbol, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type '(TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]) | GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] | GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[keyof GetProps<C> & string] | (TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P] : GetProps<C>[P]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[P]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] | (TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[Extract<string, keyof GetProps<C>>] | GetProps<C>[Extract<number, keyof GetProps<C>>] | GetProps<C>[Extract<symbol, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[Extract<string, keyof GetProps<C>>] | GetProps<C>[Extract<number, keyof GetProps<C>>] | GetProps<C>[Extract<symbol, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type '(Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]) | (Extract<number, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : GetProps<C>[Extract<number, keyof GetProps<C>>]) | (Extract<symbol, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : GetProps<C>[Extract<symbol, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type '(TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]) | GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] | GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]) | GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] | GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
Type 'GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P] : GetProps<C>[P]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.ts (1 errors) ====
|
||||
@@ -106,33 +126,53 @@ tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfin
|
||||
!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P] : GetProps<C>[P]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[P] | (TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[P]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[P]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] | (TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type '(Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]) | (Extract<number, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : GetProps<C>[Extract<number, keyof GetProps<C>>]) | (Extract<symbol, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : GetProps<C>[Extract<symbol, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]) | GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] | GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof GetProps<C> & string] | (TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P] : GetProps<C>[P]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[P]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] | (TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<string, keyof GetProps<C>>] | GetProps<C>[Extract<number, keyof GetProps<C>>] | GetProps<C>[Extract<symbol, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<string, keyof GetProps<C>>] | GetProps<C>[Extract<number, keyof GetProps<C>>] | GetProps<C>[Extract<symbol, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type '(Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]) | (Extract<number, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : GetProps<C>[Extract<number, keyof GetProps<C>>]) | (Extract<symbol, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : GetProps<C>[Extract<symbol, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]) | GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] | GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type '(TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]) | GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] | GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'TInjectedProps[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
|
||||
!!! error TS2344: Type 'GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P] : GetProps<C>[P]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.
|
||||
|
||||
@@ -21,7 +21,21 @@ export class Elem<
|
||||
new Elem(undefined as ElChildren.Void);
|
||||
new Elem('' as ElChildren.Text);
|
||||
new Elem('' as ElChildren.Void | ElChildren.Text); // error
|
||||
new Elem('' as ElChildren); // error
|
||||
new Elem('' as ElChildren); // error
|
||||
|
||||
// Repro from #31766
|
||||
|
||||
interface I { a: string }
|
||||
|
||||
type DeepPartial<T> =
|
||||
T extends object ? {[K in keyof T]?: DeepPartial<T[K]>} : T;
|
||||
|
||||
declare function f<T>(t: T, partial: DeepPartial<T>): T;
|
||||
|
||||
function g(p1: I, p2: Partial<I>): I {
|
||||
return f(p1, p2);
|
||||
}
|
||||
|
||||
|
||||
//// [conditionalTypeRelaxingConstraintAssignability.js]
|
||||
"use strict";
|
||||
@@ -37,3 +51,6 @@ new Elem(undefined);
|
||||
new Elem('');
|
||||
new Elem(''); // error
|
||||
new Elem(''); // error
|
||||
function g(p1, p2) {
|
||||
return f(p1, p2);
|
||||
}
|
||||
|
||||
@@ -71,3 +71,47 @@ new Elem('' as ElChildren); // error
|
||||
>Elem : Symbol(Elem, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 8, 83))
|
||||
>ElChildren : Symbol(ElChildren, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 0, 0), Decl(conditionalTypeRelaxingConstraintAssignability.ts, 2, 20))
|
||||
|
||||
// Repro from #31766
|
||||
|
||||
interface I { a: string }
|
||||
>I : Symbol(I, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 22, 27))
|
||||
>a : Symbol(I.a, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 26, 13))
|
||||
|
||||
type DeepPartial<T> =
|
||||
>DeepPartial : Symbol(DeepPartial, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 26, 25))
|
||||
>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17))
|
||||
|
||||
T extends object ? {[K in keyof T]?: DeepPartial<T[K]>} : T;
|
||||
>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17))
|
||||
>K : Symbol(K, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 29, 25))
|
||||
>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17))
|
||||
>DeepPartial : Symbol(DeepPartial, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 26, 25))
|
||||
>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17))
|
||||
>K : Symbol(K, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 29, 25))
|
||||
>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 28, 17))
|
||||
|
||||
declare function f<T>(t: T, partial: DeepPartial<T>): T;
|
||||
>f : Symbol(f, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 29, 64))
|
||||
>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 19))
|
||||
>t : Symbol(t, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 22))
|
||||
>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 19))
|
||||
>partial : Symbol(partial, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 27))
|
||||
>DeepPartial : Symbol(DeepPartial, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 26, 25))
|
||||
>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 19))
|
||||
>T : Symbol(T, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 19))
|
||||
|
||||
function g(p1: I, p2: Partial<I>): I {
|
||||
>g : Symbol(g, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 31, 56))
|
||||
>p1 : Symbol(p1, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 33, 11))
|
||||
>I : Symbol(I, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 22, 27))
|
||||
>p2 : Symbol(p2, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 33, 17))
|
||||
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
|
||||
>I : Symbol(I, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 22, 27))
|
||||
>I : Symbol(I, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 22, 27))
|
||||
|
||||
return f(p1, p2);
|
||||
>f : Symbol(f, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 29, 64))
|
||||
>p1 : Symbol(p1, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 33, 11))
|
||||
>p2 : Symbol(p2, Decl(conditionalTypeRelaxingConstraintAssignability.ts, 33, 17))
|
||||
}
|
||||
|
||||
|
||||
@@ -62,3 +62,30 @@ new Elem('' as ElChildren); // error
|
||||
>'' as ElChildren : ElChildren
|
||||
>'' : ""
|
||||
|
||||
// Repro from #31766
|
||||
|
||||
interface I { a: string }
|
||||
>a : string
|
||||
|
||||
type DeepPartial<T> =
|
||||
>DeepPartial : DeepPartial<T>
|
||||
|
||||
T extends object ? {[K in keyof T]?: DeepPartial<T[K]>} : T;
|
||||
|
||||
declare function f<T>(t: T, partial: DeepPartial<T>): T;
|
||||
>f : <T>(t: T, partial: DeepPartial<T>) => T
|
||||
>t : T
|
||||
>partial : DeepPartial<T>
|
||||
|
||||
function g(p1: I, p2: Partial<I>): I {
|
||||
>g : (p1: I, p2: Partial<I>) => I
|
||||
>p1 : I
|
||||
>p2 : Partial<I>
|
||||
|
||||
return f(p1, p2);
|
||||
>f(p1, p2) : I
|
||||
>f : <T>(t: T, partial: DeepPartial<T>) => T
|
||||
>p1 : I
|
||||
>p2 : Partial<I>
|
||||
}
|
||||
|
||||
|
||||
@@ -9,5 +9,8 @@ else
|
||||
|
||||
//// [constEnum4.js]
|
||||
if (1)
|
||||
;
|
||||
else if (2)
|
||||
;
|
||||
else
|
||||
;
|
||||
|
||||
@@ -2,8 +2,16 @@ 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,18): error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'.
|
||||
tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'number'.
|
||||
tests/cases/compiler/constructorOverloads1.ts(16,18): 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,18): 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.
|
||||
Argument of type 'any[]' is not assignable to parameter of type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ====
|
||||
@@ -36,10 +44,18 @@ tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of
|
||||
var f2 = new Foo(0);
|
||||
var f3 = new Foo(f1);
|
||||
~~
|
||||
!!! error TS2345: 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 TS2345: 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();
|
||||
|
||||
+56
-16
@@ -1,11 +1,31 @@
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,13): error TS2322: 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,13): error TS2322: Type '{ onClick: (k: any) => 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,13): error TS2322: 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,13): error TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(27,13): 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,13): 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,13): 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,13): 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'.
|
||||
Overload 2 of 2, '(linkProps: LinkProps): Element', gave the following error.
|
||||
Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & LinkProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(33,13): error TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps'.
|
||||
Property 'extra' does not exist on type 'IntrinsicAttributes & ButtonProps'.
|
||||
tests/cases/conformance/types/contextualTypes/jsxAttributes/file.tsx(36,13): error TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
@@ -41,20 +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 TS2322: Type '{ extra: true; onClick: (k: "left" | "right") => void; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: 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 TS2322: Type '{ onClick: (k: any) => void; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: 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 TS2322: Type '{ extra: true; goTo: "home"; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: 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 TS2322: Type '{ goTo: "home"; extra: true; }' is not assignable to type 'IntrinsicAttributes & LinkProps'.
|
||||
!!! error TS2322: 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
|
||||
|
||||
@@ -81,14 +81,14 @@ const b2 = <MainButton onClick={(k)=>{console.log(k)}} extra />; // k has type
|
||||
>b2 : JSX.Element
|
||||
><MainButton onClick={(k)=>{console.log(k)}} extra /> : JSX.Element
|
||||
>MainButton : { (buttonProps: ButtonProps): JSX.Element; (linkProps: LinkProps): JSX.Element; }
|
||||
>onClick : (k: any) => void
|
||||
>(k)=>{console.log(k)} : (k: any) => void
|
||||
>k : any
|
||||
>onClick : (k: "left" | "right") => void
|
||||
>(k)=>{console.log(k)} : (k: "left" | "right") => void
|
||||
>k : "left" | "right"
|
||||
>console.log(k) : void
|
||||
>console.log : (message?: any, ...optionalParams: any[]) => void
|
||||
>console : Console
|
||||
>log : (message?: any, ...optionalParams: any[]) => void
|
||||
>k : any
|
||||
>k : "left" | "right"
|
||||
>extra : true
|
||||
|
||||
const b3 = <MainButton {...{goTo:"home"}} extra />; // goTo has type"home" | "contact"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user