Merge branch 'master' into incrementalBuildInfo

This commit is contained in:
Sheetal Nandi
2019-02-14 12:19:10 -08:00
99 changed files with 1913 additions and 1068 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ language: node_js
node_js:
- 'node'
- '10'
- '6'
- '8'
sudo: false
+4
View File
@@ -618,6 +618,10 @@ const configureNightly = () => exec(process.execPath, ["scripts/configurePrerele
task("configure-nightly", series(buildScripts, configureNightly));
task("configure-nightly").description = "Runs scripts/configurePrerelease.ts to prepare a build for nightly publishing";
const configureInsiders = () => exec(process.execPath, ["scripts/configurePrerelease.js", "insiders", "package.json", "src/compiler/core.ts"])
task("configure-insiders", series(buildScripts, configureInsiders));
task("configure-insiders").description = "Runs scripts/configurePrerelease.ts to prepare a build for insiders publishing";
const publishNightly = () => exec("npm", ["publish", "--tag", "next"]);
task("publish-nightly", series(task("clean"), task("LKG"), task("clean"), task("runtests-parallel"), publishNightly));
task("publish-nightly").description = "Runs `npm publish --tag next` to create a new nightly build on npm";
+1 -1
View File
@@ -24,7 +24,7 @@ const host = process.env.TYPESCRIPT_HOST || process.env.host || "node";
const defaultTestTimeout = 40000;
const useBuilt =
process.env.USE_BUILT === "true" ? true :
(process.env.USE_BUILT === "true" || process.env.CI === "true") ? true :
process.env.LKG === "true" ? false :
false;
+1 -1
View File
@@ -3296,7 +3296,7 @@ namespace ts {
let transformFlags = subtreeFlags;
if (!node.variableDeclaration) {
transformFlags |= TransformFlags.AssertESNext;
transformFlags |= TransformFlags.AssertES2019;
}
else if (isBindingPattern(node.variableDeclaration.name)) {
transformFlags |= TransformFlags.AssertES2015;
+40 -41
View File
@@ -12693,10 +12693,11 @@ namespace ts {
else if (source.flags & TypeFlags.Conditional) {
if (target.flags & TypeFlags.Conditional) {
// Two conditional types 'T1 extends U1 ? X1 : Y1' and 'T2 extends U2 ? X2 : Y2' are related if
// one of T1 and T2 is related to the other, U1 and U2 are identical types, X1 is related to X2,
// and Y1 is related to Y2.
if (isTypeIdenticalTo((<ConditionalType>source).extendsType, (<ConditionalType>target).extendsType) &&
(isRelatedTo((<ConditionalType>source).checkType, (<ConditionalType>target).checkType) || isRelatedTo((<ConditionalType>target).checkType, (<ConditionalType>source).checkType))) {
// they have the same distributivity, T1 and T2 are identical types, U1 and U2 are identical
// types, X1 is related to X2, and Y1 is related to Y2.
if ((<ConditionalType>source).root.isDistributive === (<ConditionalType>target).root.isDistributive &&
isTypeIdenticalTo((<ConditionalType>source).extendsType, (<ConditionalType>target).extendsType) &&
isTypeIdenticalTo((<ConditionalType>source).checkType, (<ConditionalType>target).checkType)) {
if (result = isRelatedTo(getTrueTypeFromConditionalType(<ConditionalType>source), getTrueTypeFromConditionalType(<ConditionalType>target), reportErrors)) {
result &= isRelatedTo(getFalseTypeFromConditionalType(<ConditionalType>source), getFalseTypeFromConditionalType(<ConditionalType>target), reportErrors);
}
@@ -14472,26 +14473,15 @@ namespace ts {
inferFromTypes(source, getUnionType([getTrueTypeFromConditionalType(<ConditionalType>target), getFalseTypeFromConditionalType(<ConditionalType>target)]));
}
else if (target.flags & TypeFlags.UnionOrIntersection) {
const targetTypes = (<UnionOrIntersectionType>target).types;
let typeVariableCount = 0;
let typeVariable: TypeParameter | IndexedAccessType | undefined;
// First infer to each type in union or intersection that isn't a type variable
for (const t of targetTypes) {
if (getInferenceInfoForType(t)) {
typeVariable = <InstantiableType>t;
typeVariableCount++;
}
else {
inferFromTypes(source, t);
}
}
// Next, if target containings a single naked type variable, make a secondary inference to that type
// variable. This gives meaningful results for union types in co-variant positions and intersection
// types in contra-variant positions (such as callback parameters).
if (typeVariableCount === 1) {
for (const t of (<UnionOrIntersectionType>target).types) {
const savePriority = priority;
priority |= InferencePriority.NakedTypeVariable;
inferFromTypes(source, typeVariable!);
// Inferences directly to naked type variables are given lower priority as they are
// less specific. For example, when inferring from Promise<string> to T | Promise<T>,
// we want to infer string for T, not Promise<string> | string.
if (getInferenceInfoForType(t)) {
priority |= InferencePriority.NakedTypeVariable;
}
inferFromTypes(source, t);
priority = savePriority;
}
}
@@ -14579,11 +14569,11 @@ namespace ts {
return undefined;
}
function inferFromMappedTypeConstraint(source: Type, target: Type, constraintType: Type): boolean {
function inferToMappedType(source: Type, target: MappedType, constraintType: Type): boolean {
if (constraintType.flags & TypeFlags.Union) {
let result = false;
for (const type of (constraintType as UnionType).types) {
result = inferFromMappedTypeConstraint(source, target, type) || result;
result = inferToMappedType(source, target, type) || result;
}
return result;
}
@@ -14594,7 +14584,7 @@ namespace ts {
// such that direct inferences to T get priority over inferences to Partial<T>, for example.
const inference = getInferenceInfoForType((<IndexType>constraintType).type);
if (inference && !inference.isFixed) {
const inferredType = inferTypeForHomomorphicMappedType(source, <MappedType>target, constraintType as IndexType);
const inferredType = inferTypeForHomomorphicMappedType(source, target, <IndexType>constraintType);
if (inferredType) {
const savePriority = priority;
priority |= InferencePriority.HomomorphicMappedType;
@@ -14605,18 +14595,28 @@ namespace ts {
return true;
}
if (constraintType.flags & TypeFlags.TypeParameter) {
// We're inferring from some source type S to a mapped type { [P in T]: X }, where T is a type
// parameter. Infer from 'keyof S' to T and infer from a union of each property type in S to X.
// We're inferring from some source type S to a mapped type { [P in K]: X }, where K is a type
// parameter. First infer from 'keyof S' to K.
const savePriority = priority;
priority |= InferencePriority.MappedTypeConstraint;
inferFromTypes(getIndexType(source), constraintType);
priority = savePriority;
// If K is constrained to a type C, also infer to C. Thus, for a mapped type { [P in K]: X },
// where K extends keyof T, we make the same inferences as for a homomorphic mapped type
// { [P in keyof T]: X }. This enables us to make meaningful inferences when the target is a
// Pick<T, K>.
const extendedConstraint = getConstraintOfType(constraintType);
if (extendedConstraint && inferToMappedType(source, target, extendedConstraint)) {
return true;
}
// If no inferences can be made to K's constraint, infer from a union of the property types
// in the source to the template type X.
const valueTypes = compact([
getIndexTypeOfType(source, IndexKind.String),
getIndexTypeOfType(source, IndexKind.Number),
...map(getPropertiesOfType(source), getTypeOfSymbol)
]);
inferFromTypes(getUnionType(valueTypes), getTemplateTypeFromMappedType(<MappedType>target));
inferFromTypes(getUnionType(valueTypes), getTemplateTypeFromMappedType(target));
return true;
}
return false;
@@ -14631,7 +14631,7 @@ namespace ts {
}
if (getObjectFlags(target) & ObjectFlags.Mapped) {
const constraintType = getConstraintTypeFromMappedType(<MappedType>target);
if (inferFromMappedTypeConstraint(source, target, constraintType)) {
if (inferToMappedType(source, <MappedType>target, constraintType)) {
return;
}
}
@@ -21550,13 +21550,8 @@ namespace ts {
}
if (signature.hasRestParameter) {
const restType = getTypeOfSymbol(signature.parameters[paramCount]);
if (isTupleType(restType)) {
if (pos - paramCount < getLengthOfTupleType(restType)) {
return restType.typeArguments![pos - paramCount];
}
return getRestTypeOfTupleType(restType);
}
return getIndexTypeOfType(restType, IndexKind.Number);
const indexType = getLiteralType(pos - paramCount);
return getIndexedAccessType(restType, indexType);
}
return undefined;
}
@@ -21564,18 +21559,22 @@ namespace ts {
function getRestTypeAtPosition(source: Signature, pos: number): Type {
const paramCount = getParameterCount(source);
const restType = getEffectiveRestType(source);
if (restType && pos === paramCount - 1) {
const nonRestCount = paramCount - (restType ? 1 : 0);
if (restType && pos === nonRestCount) {
return restType;
}
const start = restType ? Math.min(pos, paramCount - 1) : pos;
const types = [];
const names = [];
for (let i = start; i < paramCount; i++) {
for (let i = pos; i < nonRestCount; i++) {
types.push(getTypeAtPosition(source, i));
names.push(getParameterNameAtPosition(source, i));
}
if (restType) {
types.push(getIndexedAccessType(restType, numberType));
names.push(getParameterNameAtPosition(source, nonRestCount));
}
const minArgumentCount = getMinArgumentCount(source);
const minLength = minArgumentCount < start ? 0 : minArgumentCount - start;
const minLength = minArgumentCount < pos ? 0 : minArgumentCount - pos;
return createTupleType(types, minLength, !!restType, /*readonly*/ false, names);
}
+8 -3
View File
@@ -15,6 +15,7 @@ namespace ts {
["es2016", "lib.es2016.d.ts"],
["es2017", "lib.es2017.d.ts"],
["es2018", "lib.es2018.d.ts"],
["es2019", "lib.es2019.d.ts"],
["esnext", "lib.esnext.d.ts"],
// Host only
["dom", "lib.dom.d.ts"],
@@ -42,8 +43,11 @@ namespace ts {
["es2018.intl", "lib.es2018.intl.d.ts"],
["es2018.promise", "lib.es2018.promise.d.ts"],
["es2018.regexp", "lib.es2018.regexp.d.ts"],
["esnext.array", "lib.esnext.array.d.ts"],
["esnext.symbol", "lib.esnext.symbol.d.ts"],
["es2019.array", "lib.es2019.array.d.ts"],
["es2019.string", "lib.es2019.string.d.ts"],
["es2019.symbol", "lib.es2019.symbol.d.ts"],
["esnext.array", "lib.es2019.array.d.ts"],
["esnext.symbol", "lib.es2019.symbol.d.ts"],
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
["esnext.intl", "lib.esnext.intl.d.ts"],
["esnext.bigint", "lib.esnext.bigint.d.ts"]
@@ -198,6 +202,7 @@ namespace ts {
es2016: ScriptTarget.ES2016,
es2017: ScriptTarget.ES2017,
es2018: ScriptTarget.ES2018,
es2019: ScriptTarget.ES2019,
esnext: ScriptTarget.ESNext,
}),
affectsSourceFile: true,
@@ -205,7 +210,7 @@ namespace ts {
paramType: Diagnostics.VERSION,
showInSimplifiedHelpView: true,
category: Diagnostics.Basic_Options,
description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT,
description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_ES2019_or_ESNEXT,
},
{
name: "module",
+4 -3
View File
@@ -1396,9 +1396,10 @@ namespace ts {
export function assign<T extends object>(t: T, ...args: (T | undefined)[]) {
for (const arg of args) {
for (const p in arg!) {
if (hasProperty(arg!, p)) {
t![p] = arg![p]; // TODO: GH#23368
if (arg === undefined) continue;
for (const p in arg) {
if (hasProperty(arg, p)) {
t[p] = arg[p];
}
}
}
+1 -1
View File
@@ -3109,7 +3109,7 @@
"category": "Message",
"code": 6014
},
"Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'.": {
"Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'.": {
"category": "Message",
"code": 6015
},
+4
View File
@@ -42,6 +42,10 @@ namespace ts {
transformers.push(transformESNext);
}
if (languageVersion < ScriptTarget.ES2019) {
transformers.push(transformES2019);
}
if (languageVersion < ScriptTarget.ES2018) {
transformers.push(transformES2018);
}
@@ -1012,7 +1012,9 @@ namespace ts {
if (!isPropertyAccessExpression(p.valueDeclaration)) {
return undefined;
}
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(p.valueDeclaration);
const type = resolver.createTypeOfDeclaration(p.valueDeclaration, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker);
getSymbolAccessibilityDiagnostic = oldDiag;
const varDecl = createVariableDeclaration(unescapeLeadingUnderscores(p.escapedName), type, /*initializer*/ undefined);
return createVariableStatement(/*modifiers*/ undefined, createVariableDeclarationList([varDecl]));
});
@@ -26,7 +26,8 @@ namespace ts {
| ImportEqualsDeclaration
| TypeAliasDeclaration
| ConstructorDeclaration
| IndexSignatureDeclaration;
| IndexSignatureDeclaration
| PropertyAccessExpression;
export function canProduceDiagnostics(node: Node): node is DeclarationDiagnosticProducing {
return isVariableDeclaration(node) ||
@@ -46,7 +47,8 @@ namespace ts {
isImportEqualsDeclaration(node) ||
isTypeAliasDeclaration(node) ||
isConstructorDeclaration(node) ||
isIndexSignatureDeclaration(node);
isIndexSignatureDeclaration(node) ||
isPropertyAccessExpression(node);
}
export function createGetSymbolAccessibilityDiagnosticForNodeName(node: DeclarationDiagnosticProducing) {
@@ -123,7 +125,7 @@ namespace ts {
}
export function createGetSymbolAccessibilityDiagnosticForNode(node: DeclarationDiagnosticProducing): (symbolAccessibilityResult: SymbolAccessibilityResult) => SymbolAccessibilityDiagnostic | undefined {
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
if (isVariableDeclaration(node) || isPropertyDeclaration(node) || isPropertySignature(node) || isPropertyAccessExpression(node) || isBindingElement(node) || isConstructorDeclaration(node)) {
return getVariableDeclarationTypeVisibilityError;
}
else if (isSetAccessor(node) || isGetAccessor(node)) {
@@ -164,7 +166,7 @@ namespace ts {
}
// This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit
// The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all.
else if (node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertySignature ||
else if (node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.PropertyAccessExpression || node.kind === SyntaxKind.PropertySignature ||
(node.kind === SyntaxKind.Parameter && hasModifier(node.parent, ModifierFlags.Private))) {
// TODO(jfreeman): Deal with computed properties in error reporting.
if (hasModifier(node, ModifierFlags.Static)) {
+37
View File
@@ -0,0 +1,37 @@
/*@internal*/
namespace ts {
export function transformES2019(context: TransformationContext) {
return chainBundle(transformSourceFile);
function transformSourceFile(node: SourceFile) {
if (node.isDeclarationFile) {
return node;
}
return visitEachChild(node, visitor, context);
}
function visitor(node: Node): VisitResult<Node> {
if ((node.transformFlags & TransformFlags.ContainsES2019) === 0) {
return node;
}
switch (node.kind) {
case SyntaxKind.CatchClause:
return visitCatchClause(node as CatchClause);
default:
return visitEachChild(node, visitor, context);
}
}
function visitCatchClause(node: CatchClause): CatchClause {
if (!node.variableDeclaration) {
return updateCatchClause(
node,
createVariableDeclaration(createTempVariable(/*recordTempVariable*/ undefined)),
visitNode(node.block, visitor, isBlock)
);
}
return visitEachChild(node, visitor, context);
}
}
}
-13
View File
@@ -16,22 +16,9 @@ namespace ts {
return node;
}
switch (node.kind) {
case SyntaxKind.CatchClause:
return visitCatchClause(node as CatchClause);
default:
return visitEachChild(node, visitor, context);
}
}
function visitCatchClause(node: CatchClause): CatchClause {
if (!node.variableDeclaration) {
return updateCatchClause(
node,
createVariableDeclaration(createTempVariable(/*recordTempVariable*/ undefined)),
visitNode(node.block, visitor, isBlock)
);
}
return visitEachChild(node, visitor, context);
}
}
}
+1
View File
@@ -31,6 +31,7 @@
"transformers/ts.ts",
"transformers/es2017.ts",
"transformers/es2018.ts",
"transformers/es2019.ts",
"transformers/esnext.ts",
"transformers/jsx.ts",
"transformers/es2016.ts",
+4 -1
View File
@@ -4722,7 +4722,8 @@ namespace ts {
ES2016 = 3,
ES2017 = 4,
ES2018 = 5,
ESNext = 6,
ES2019 = 6,
ESNext = 7,
JSON = 100,
Latest = ESNext,
}
@@ -5136,6 +5137,7 @@ namespace ts {
Super = 1 << 25,
ContainsSuper = 1 << 26,
ContainsES2018 = 1 << 27,
ContainsES2019 = 1 << 28,
// Please leave this as 1 << 29.
// It is the maximum bit we can set before we outgrow the size of a v8 small integer (SMI) on an x86 system.
@@ -5147,6 +5149,7 @@ namespace ts {
AssertTypeScript = TypeScript | ContainsTypeScript,
AssertJsx = ContainsJsx,
AssertESNext = ContainsESNext,
AssertES2019 = ContainsES2019,
AssertES2018 = ContainsES2018,
AssertES2017 = ContainsES2017,
AssertES2016 = ContainsES2016,
+2
View File
@@ -4608,6 +4608,8 @@ namespace ts {
switch (options.target) {
case ScriptTarget.ESNext:
return "lib.esnext.full.d.ts";
case ScriptTarget.ES2019:
return "lib.es2019.full.d.ts";
case ScriptTarget.ES2018:
return "lib.es2018.full.d.ts";
case ScriptTarget.ES2017:
+1
View File
@@ -56,6 +56,7 @@ namespace evaluator {
}
const evaluateText = `(function (module, exports, require, __dirname, __filename, ${globalNames.join(", ")}) { ${output.text} })`;
// tslint:disable-next-line:no-eval
const evaluateThunk = eval(evaluateText) as (module: any, exports: any, require: (id: string) => any, dirname: string, filename: string, ...globalArgs: any[]) => void;
const module: { exports: any; } = { exports: {} };
evaluateThunk.call(globals, module, module.exports, noRequire, vpath.dirname(output.file), output.file, FakeSymbol, ...globalArgs);
+1
View File
@@ -3159,6 +3159,7 @@ ${code}
const debug = new FourSlashInterface.Debug(state);
const format = new FourSlashInterface.Format(state);
const cancellation = new FourSlashInterface.Cancellation(state);
// tslint:disable-next-line:no-eval
const f = eval(wrappedCode);
f(test, goTo, plugins, verify, edit, debug, format, cancellation, FourSlashInterface.Classification, FourSlashInterface.Completion, verifyOperationIsCancelled);
}
+1
View File
@@ -77,6 +77,7 @@ namespace Utils {
const environment = getExecutionEnvironment();
switch (environment) {
case ExecutionEnvironment.Browser:
// tslint:disable-next-line:no-eval
eval(fileContents);
break;
case ExecutionEnvironment.Node:
+1
View File
@@ -766,6 +766,7 @@ namespace Harness.LanguageService {
}
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any {
// tslint:disable-next-line:ban
return setTimeout(callback, ms, args);
}
+4
View File
@@ -0,0 +1,4 @@
/// <reference lib="es2018" />
/// <reference lib="es2019.array" />
/// <reference lib="es2019.string" />
/// <reference lib="es2019.symbol" />
+5
View File
@@ -0,0 +1,5 @@
/// <reference lib="es2019" />
/// <reference lib="dom" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />
/// <reference lib="dom.iterable" />
+13
View File
@@ -0,0 +1,13 @@
interface String {
/** Removes the trailing white space and line terminator characters from a string. */
trimEnd(): string;
/** Removes the leading white space and line terminator characters from a string. */
trimStart(): string;
/** Removes the trailing white space and line terminator characters from a string. */
trimLeft(): string;
/** Removes the leading white space and line terminator characters from a string. */
trimRight(): string;
}
+1 -3
View File
@@ -1,5 +1,3 @@
/// <reference lib="es2018" />
/// <reference lib="esnext.array" />
/// <reference lib="es2019" />
/// <reference lib="esnext.bigint" />
/// <reference lib="esnext.symbol" />
/// <reference lib="esnext.intl" />
+5 -2
View File
@@ -6,6 +6,7 @@
"es2016",
"es2017",
"es2018",
"es2019",
"esnext",
// Host only
"dom.generated",
@@ -33,9 +34,10 @@
"es2018.regexp",
"es2018.promise",
"es2018.intl",
"esnext.array",
"es2019.array",
"es2019.string",
"es2019.symbol",
"esnext.bigint",
"esnext.symbol",
"esnext.intl",
// Default libraries
"es5.full",
@@ -43,6 +45,7 @@
"es2016.full",
"es2017.full",
"es2018.full",
"es2019.full",
"esnext.full"
],
"paths": {
-32
View File
@@ -7,7 +7,6 @@ namespace ts.server {
export const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
export const ProjectLoadingStartEvent = "projectLoadingStart";
export const ProjectLoadingFinishEvent = "projectLoadingFinish";
export const SurveyReady = "surveyReady";
export const LargeFileReferencedEvent = "largeFileReferenced";
export const ConfigFileDiagEvent = "configFileDiag";
export const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
@@ -30,11 +29,6 @@ namespace ts.server {
data: { project: Project; };
}
export interface SurveyReady {
eventName: typeof SurveyReady;
data: { surveyId: string; };
}
export interface LargeFileReferencedEvent {
eventName: typeof LargeFileReferencedEvent;
data: { file: string; fileSize: number; maxFileSize: number; };
@@ -146,7 +140,6 @@ namespace ts.server {
}
export type ProjectServiceEvent = LargeFileReferencedEvent |
SurveyReady |
ProjectsUpdatedInBackgroundEvent |
ProjectLoadingStartEvent |
ProjectLoadingFinishEvent |
@@ -518,9 +511,6 @@ namespace ts.server {
/** Tracks projects that we have already sent telemetry for. */
private readonly seenProjects = createMap<true>();
/** Tracks projects that we have already sent survey events for. */
private readonly seenSurveyProjects = createMap<true>();
/*@internal*/
readonly watchFactory: WatchFactory<WatchType, Project>;
@@ -722,14 +712,6 @@ namespace ts.server {
this.eventHandler(event);
}
/* @internal */
sendSurveyReadyEvent(surveyId: string) {
if (!this.eventHandler) {
return;
}
this.eventHandler({ eventName: SurveyReady, data: { surveyId } });
}
/* @internal */
sendLargeFileReferencedEvent(file: string, fileSize: number) {
if (!this.eventHandler) {
@@ -1611,20 +1593,6 @@ namespace ts.server {
return project;
}
/*@internal*/
sendSurveyReady(project: ExternalProject | ConfiguredProject): void {
if (this.seenSurveyProjects.has(project.projectName)) {
return;
}
if (project.getCompilerOptions().checkJs !== undefined) {
const name = "checkJs";
this.logger.info(`Survey ${name} is ready`);
this.sendSurveyReadyEvent(name);
this.seenSurveyProjects.set(project.projectName, true);
}
}
/*@internal*/
sendProjectTelemetry(project: ExternalProject | ConfiguredProject): void {
if (this.seenProjects.has(project.projectName)) {
-2
View File
@@ -1431,7 +1431,6 @@ namespace ts.server {
}
this.projectService.sendProjectLoadingFinishEvent(this);
this.projectService.sendProjectTelemetry(this);
this.projectService.sendSurveyReady(this);
return result;
}
@@ -1627,7 +1626,6 @@ namespace ts.server {
updateGraph() {
const result = super.updateGraph();
this.projectService.sendProjectTelemetry(this);
this.projectService.sendSurveyReady(this);
return result;
}
-4
View File
@@ -610,10 +610,6 @@ namespace ts.server {
diagnostics: bakedDiags
}, ConfigFileDiagEvent);
break;
case SurveyReady:
const { surveyId } = event.data;
this.event<protocol.SurveyReadyEventBody>({ surveyId }, SurveyReady);
break;
case ProjectLanguageServiceStateEvent: {
const eventName: protocol.ProjectLanguageServiceStateEventName = ProjectLanguageServiceStateEvent;
this.event<protocol.ProjectLanguageServiceStateEventBody>({
+2
View File
@@ -302,6 +302,7 @@ namespace Harness.Parallel.Host {
worker.timer = undefined;
}
else {
// tslint:disable-next-line:ban
worker.timer = setTimeout(killChild, data.payload.duration, data.payload);
}
break;
@@ -623,6 +624,7 @@ namespace Harness.Parallel.Host {
shimNoopTestInterface(global);
}
// tslint:disable-next-line:ban
setTimeout(() => startDelayed(perfData, totalCost), 0); // Do real startup on next tick, so all unit tests have been collected
}
}
-1
View File
@@ -117,7 +117,6 @@
"unittests/tsserver/events/projectLanguageServiceState.ts",
"unittests/tsserver/events/projectLoading.ts",
"unittests/tsserver/events/projectUpdatedInBackground.ts",
"unittests/tsserver/events/surveyReady.ts",
"unittests/tsserver/externalProjects.ts",
"unittests/tsserver/forceConsistentCasingInFileNames.ts",
"unittests/tsserver/formatSettings.ts",
@@ -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', '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', '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', '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.string', 'es2019.symbol', '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,
@@ -161,7 +161,7 @@ namespace ts {
start: undefined,
length: undefined,
}, {
messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'esnext'.",
messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'esnext'.",
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category,
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
@@ -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', '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', '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', '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.string', 'es2019.symbol', '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', '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', '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', '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.string', 'es2019.symbol', '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,
@@ -238,7 +238,7 @@ namespace ts {
file: undefined,
start: 0,
length: 0,
messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'esnext'.",
messageText: "Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'esnext'.",
code: Diagnostics.Argument_for_0_option_must_be_Colon_1.code,
category: Diagnostics.Argument_for_0_option_must_be_Colon_1.category
}]
@@ -1,111 +0,0 @@
namespace ts.projectSystem {
describe("unittests:: tsserver:: events:: SurveyReady", () => {
function createSessionWithEventHandler(host: TestServerHost) {
const { session, events: surveyEvents } = createSessionWithEventTracking<server.SurveyReady>(host, server.SurveyReady);
return { session, verifySurveyReadyEvent };
function verifySurveyReadyEvent(numberOfEvents: number) {
assert.equal(surveyEvents.length, numberOfEvents);
const expectedEvents = numberOfEvents === 0 ? [] : [{
eventName: server.SurveyReady,
data: { surveyId: "checkJs" }
}];
assert.deepEqual(surveyEvents, expectedEvents);
}
}
it("doesn't log an event when checkJs isn't set", () => {
const projectRoot = "/user/username/projects/project";
const file: File = {
path: `${projectRoot}/src/file.ts`,
content: "export var y = 10;"
};
const tsconfig: File = {
path: `${projectRoot}/tsconfig.json`,
content: JSON.stringify({ compilerOptions: {} }),
};
const host = createServerHost([file, tsconfig]);
const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host);
const service = session.getProjectService();
openFilesForSession([file], session);
checkNumberOfProjects(service, { configuredProjects: 1 });
const project = service.configuredProjects.get(tsconfig.path)!;
checkProjectActualFiles(project, [file.path, tsconfig.path]);
verifySurveyReadyEvent(0);
});
it("logs an event when checkJs is set", () => {
const projectRoot = "/user/username/projects/project";
const file: File = {
path: `${projectRoot}/src/file.ts`,
content: "export var y = 10;"
};
const tsconfig: File = {
path: `${projectRoot}/tsconfig.json`,
content: JSON.stringify({ compilerOptions: { checkJs: true } }),
};
const host = createServerHost([file, tsconfig]);
const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host);
openFilesForSession([file], session);
verifySurveyReadyEvent(1);
});
it("logs an event when checkJs is set, only the first time", () => {
const projectRoot = "/user/username/projects/project";
const file: File = {
path: `${projectRoot}/src/file.ts`,
content: "export var y = 10;"
};
const rando: File = {
path: `/rando/calrissian.ts`,
content: "export function f() { }"
};
const tsconfig: File = {
path: `${projectRoot}/tsconfig.json`,
content: JSON.stringify({ compilerOptions: { checkJs: true } }),
};
const host = createServerHost([file, tsconfig]);
const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host);
openFilesForSession([file], session);
verifySurveyReadyEvent(1);
closeFilesForSession([file], session);
openFilesForSession([rando], session);
openFilesForSession([file], session);
verifySurveyReadyEvent(1);
});
it("logs an event when checkJs is set after closing and reopening", () => {
const projectRoot = "/user/username/projects/project";
const file: File = {
path: `${projectRoot}/src/file.ts`,
content: "export var y = 10;"
};
const rando: File = {
path: `/rando/calrissian.ts`,
content: "export function f() { }"
};
const tsconfig: File = {
path: `${projectRoot}/tsconfig.json`,
content: JSON.stringify({}),
};
const host = createServerHost([file, tsconfig]);
const { session, verifySurveyReadyEvent } = createSessionWithEventHandler(host);
openFilesForSession([file], session);
verifySurveyReadyEvent(0);
closeFilesForSession([file], session);
openFilesForSession([rando], session);
host.writeFile(tsconfig.path, JSON.stringify({ compilerOptions: { checkJs: true } }));
openFilesForSession([file], session);
verifySurveyReadyEvent(1);
});
});
}
+1
View File
@@ -705,6 +705,7 @@ namespace ts.server {
// stat due to inconsistencies of fs.watch
// and efficiency of stat on modern filesystems
function startWatchTimer() {
// tslint:disable-next-line:ban
setInterval(() => {
let count = 0;
let nextToCheck = nextFileToCheck;
+5 -13
View File
@@ -2612,9 +2612,10 @@ declare namespace ts {
ES2016 = 3,
ES2017 = 4,
ES2018 = 5,
ESNext = 6,
ES2019 = 6,
ESNext = 7,
JSON = 100,
Latest = 6
Latest = 7
}
enum LanguageVariant {
Standard = 0,
@@ -8392,7 +8393,7 @@ declare namespace ts.server {
excludedFiles: ReadonlyArray<NormalizedPath>;
private typeAcquisition;
updateGraph(): boolean;
getExcludedFiles(): ReadonlyArray<NormalizedPath>;
getExcludedFiles(): readonly NormalizedPath[];
getTypeAcquisition(): TypeAcquisition;
setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void;
}
@@ -8402,7 +8403,6 @@ declare namespace ts.server {
const ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
const ProjectLoadingStartEvent = "projectLoadingStart";
const ProjectLoadingFinishEvent = "projectLoadingFinish";
const SurveyReady = "surveyReady";
const LargeFileReferencedEvent = "largeFileReferenced";
const ConfigFileDiagEvent = "configFileDiag";
const ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
@@ -8427,12 +8427,6 @@ declare namespace ts.server {
project: Project;
};
}
interface SurveyReady {
eventName: typeof SurveyReady;
data: {
surveyId: string;
};
}
interface LargeFileReferencedEvent {
eventName: typeof LargeFileReferencedEvent;
data: {
@@ -8517,7 +8511,7 @@ declare namespace ts.server {
interface OpenFileInfo {
readonly checkJs: boolean;
}
type ProjectServiceEvent = LargeFileReferencedEvent | SurveyReady | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent;
type ProjectServiceEvent = LargeFileReferencedEvent | ProjectsUpdatedInBackgroundEvent | ProjectLoadingStartEvent | ProjectLoadingFinishEvent | ConfigFileDiagEvent | ProjectLanguageServiceStateEvent | ProjectInfoTelemetryEvent | OpenFileInfoTelemetryEvent;
type ProjectServiceEventHandler = (event: ProjectServiceEvent) => void;
interface SafeList {
[name: string]: {
@@ -8634,8 +8628,6 @@ declare namespace ts.server {
readonly syntaxOnly?: boolean;
/** Tracks projects that we have already sent telemetry for. */
private readonly seenProjects;
/** Tracks projects that we have already sent survey events for. */
private readonly seenSurveyProjects;
constructor(opts: ProjectServiceOptions);
toPath(fileName: string): Path;
private loadTypesMap;
+3 -2
View File
@@ -2612,9 +2612,10 @@ declare namespace ts {
ES2016 = 3,
ES2017 = 4,
ES2018 = 5,
ESNext = 6,
ES2019 = 6,
ESNext = 7,
JSON = 100,
Latest = 6
Latest = 7
}
enum LanguageVariant {
Standard = 0,
@@ -4,17 +4,17 @@ const array: number[] = [];
const readonlyArray: ReadonlyArray<number> = [];
>readonlyArray : Symbol(readonlyArray, Decl(arrayFlatMap.ts, 1, 5))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.esnext.array.d.ts, --, --))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --))
array.flatMap((): ReadonlyArray<number> => []); // ok
>array.flatMap : Symbol(Array.flatMap, Decl(lib.esnext.array.d.ts, --, --))
>array.flatMap : Symbol(Array.flatMap, Decl(lib.es2019.array.d.ts, --, --))
>array : Symbol(array, Decl(arrayFlatMap.ts, 0, 5))
>flatMap : Symbol(Array.flatMap, Decl(lib.esnext.array.d.ts, --, --))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.esnext.array.d.ts, --, --))
>flatMap : Symbol(Array.flatMap, Decl(lib.es2019.array.d.ts, --, --))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --))
readonlyArray.flatMap((): ReadonlyArray<number> => []); // ok
>readonlyArray.flatMap : Symbol(ReadonlyArray.flatMap, Decl(lib.esnext.array.d.ts, --, --))
>readonlyArray.flatMap : Symbol(ReadonlyArray.flatMap, Decl(lib.es2019.array.d.ts, --, --))
>readonlyArray : Symbol(readonlyArray, Decl(arrayFlatMap.ts, 1, 5))
>flatMap : Symbol(ReadonlyArray.flatMap, Decl(lib.esnext.array.d.ts, --, --))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.esnext.array.d.ts, --, --))
>flatMap : Symbol(ReadonlyArray.flatMap, Decl(lib.es2019.array.d.ts, --, --))
>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --), Decl(lib.es2019.array.d.ts, --, --))
@@ -34,7 +34,7 @@ key = "abc";
key = Symbol();
>key : Symbol(key, Decl(a.ts, 9, 3))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
key = 123n; // should error
>key : Symbol(key, Decl(a.ts, 9, 3))
@@ -53,7 +53,7 @@ typedArray[bigNum] = 0xAA; // should error
typedArray[String(bigNum)] = 0xAA;
>typedArray : Symbol(typedArray, Decl(a.ts, 17, 5))
>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 2 more)
>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 3 more)
>bigNum : Symbol(bigNum, Decl(a.ts, 16, 5))
typedArray["1"] = 0xBB;
@@ -120,9 +120,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as
>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) as BuildPubSubRecordType<SO_FAR & {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}> : BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }>
>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; }>
>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }>
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; }
>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
@@ -144,9 +144,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as
>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) as BuildPubSubRecordType<SO_FAR & {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}> : BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }>
>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; }>
>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }>
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; }
>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
@@ -337,16 +337,16 @@ export enum PubSubRecordIsStoredInRedisAsA {
buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType<SO_FAR & {maxMsToWaitBeforePublishing: 0}>,
>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) as BuildPubSubRecordType<SO_FAR & {maxMsToWaitBeforePublishing: 0}> : BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: 0; }>
>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: number; }>
>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: 0; }>
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : SO_FAR & { maxMsToWaitBeforePublishing: number; }
>Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : SO_FAR & { maxMsToWaitBeforePublishing: 0; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>soFar : SO_FAR
>{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: number; }
>maxMsToWaitBeforePublishing : number
>{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: 0; }
>maxMsToWaitBeforePublishing : 0
>0 : 0
>maxMsToWaitBeforePublishing : 0
}
@@ -1,29 +1,38 @@
tests/cases/conformance/types/conditional/conditionalTypes2.ts(15,5): error TS2322: Type 'Covariant<A>' is not assignable to type 'Covariant<B>'.
Type 'A' is not assignable to type 'B'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(19,5): error TS2322: Type 'Contravariant<B>' is not assignable to type 'Contravariant<A>'.
Type 'A' is not assignable to type 'B'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(24,5): error TS2322: Type 'Invariant<B>' is not assignable to type 'Invariant<A>'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(16,5): error TS2322: Type 'Covariant<B>' is not assignable to type 'Covariant<A>'.
Types of property 'foo' are incompatible.
Type 'B extends string ? B : number' is not assignable to type 'A extends string ? A : number'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(17,5): error TS2322: Type 'Covariant<A>' is not assignable to type 'Covariant<B>'.
Types of property 'foo' are incompatible.
Type 'A extends string ? A : number' is not assignable to type 'B extends string ? B : number'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(21,5): error TS2322: Type 'Contravariant<B>' is not assignable to type 'Contravariant<A>'.
Types of property 'foo' are incompatible.
Type 'B extends string ? keyof B : number' is not assignable to type 'A extends string ? keyof A : number'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(22,5): error TS2322: Type 'Contravariant<A>' is not assignable to type 'Contravariant<B>'.
Types of property 'foo' are incompatible.
Type 'A extends string ? keyof A : number' is not assignable to type 'B extends string ? keyof B : number'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(26,5): error TS2322: Type 'Invariant<B>' is not assignable to type 'Invariant<A>'.
Types of property 'foo' are incompatible.
Type 'B extends string ? keyof B : B' is not assignable to type 'A extends string ? keyof A : A'.
Type 'keyof B' is not assignable to type 'keyof A'.
Type 'string | number | symbol' is not assignable to type 'keyof A'.
Type 'string' is not assignable to type 'keyof A'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(25,5): error TS2322: Type 'Invariant<A>' is not assignable to type 'Invariant<B>'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(27,5): error TS2322: Type 'Invariant<A>' is not assignable to type 'Invariant<B>'.
Types of property 'foo' are incompatible.
Type 'A extends string ? keyof A : A' is not assignable to type 'B extends string ? keyof B : B'.
Type 'A' is not assignable to type 'B'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(73,12): error TS2345: Argument of type 'Extract<Extract<T, Foo>, Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2345: Argument of type 'Extract<Extract<T, Foo>, Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'.
Property 'bat' is missing in type 'Bar & Foo' but required in type '{ foo: string; bat: string; }'.
Type 'Extract<Foo & T, Bar>' is not assignable to type '{ foo: string; bat: string; }'.
Property 'bat' is missing in type 'Bar & Foo' but required in type '{ foo: string; bat: string; }'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(74,12): error TS2345: Argument of type 'Extract<T, Foo & Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(76,12): error TS2345: Argument of type 'Extract<T, Foo & Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'.
Property 'bat' is missing in type 'Foo & Bar' but required in type '{ foo: string; bat: string; }'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2345: Argument of type 'Extract2<T, Foo, Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(77,12): error TS2345: Argument of type 'Extract2<T, Foo, Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'.
Type 'T extends Bar ? T : never' is not assignable to type '{ foo: string; bat: string; }'.
Type 'Bar & Foo & T' is not assignable to type '{ foo: string; bat: string; }'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(165,5): error TS2322: Type 'MyElement<A>' is not assignable to type 'MyElement<B>'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(170,5): error TS2322: Type 'MyAcceptor<B>' is not assignable to type 'MyAcceptor<A>'.
tests/cases/conformance/types/conditional/conditionalTypes2.ts(177,5): error TS2322: Type 'Dist<T>' is not assignable to type 'Aux<{ a: T; }>'.
==== tests/cases/conformance/types/conditional/conditionalTypes2.ts (7 errors) ====
==== tests/cases/conformance/types/conditional/conditionalTypes2.ts (12 errors) ====
// #27118: Conditional types are now invariant in the check type.
interface Covariant<T> {
foo: T extends string ? T : number;
}
@@ -37,19 +46,29 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
}
function f1<A, B extends A>(a: Covariant<A>, b: Covariant<B>) {
a = b;
a = b; // Error
~
!!! error TS2322: Type 'Covariant<B>' is not assignable to type 'Covariant<A>'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'B extends string ? B : number' is not assignable to type 'A extends string ? A : number'.
b = a; // Error
~
!!! error TS2322: Type 'Covariant<A>' is not assignable to type 'Covariant<B>'.
!!! error TS2322: Type 'A' is not assignable to type 'B'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'A extends string ? A : number' is not assignable to type 'B extends string ? B : number'.
}
function f2<A, B extends A>(a: Contravariant<A>, b: Contravariant<B>) {
a = b; // Error
~
!!! error TS2322: Type 'Contravariant<B>' is not assignable to type 'Contravariant<A>'.
!!! error TS2322: Type 'A' is not assignable to type 'B'.
b = a;
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'B extends string ? keyof B : number' is not assignable to type 'A extends string ? keyof A : number'.
b = a; // Error
~
!!! error TS2322: Type 'Contravariant<A>' is not assignable to type 'Contravariant<B>'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'A extends string ? keyof A : number' is not assignable to type 'B extends string ? keyof B : number'.
}
function f3<A, B extends A>(a: Invariant<A>, b: Invariant<B>) {
@@ -58,15 +77,11 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
!!! error TS2322: Type 'Invariant<B>' is not assignable to type 'Invariant<A>'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'B extends string ? keyof B : B' is not assignable to type 'A extends string ? keyof A : A'.
!!! error TS2322: Type 'keyof B' is not assignable to type 'keyof A'.
!!! error TS2322: Type 'string | number | symbol' is not assignable to type 'keyof A'.
!!! error TS2322: Type 'string' is not assignable to type 'keyof A'.
b = a; // Error
~
!!! error TS2322: Type 'Invariant<A>' is not assignable to type 'Invariant<B>'.
!!! error TS2322: Types of property 'foo' are incompatible.
!!! error TS2322: Type 'A extends string ? keyof A : A' is not assignable to type 'B extends string ? keyof B : B'.
!!! error TS2322: Type 'A' is not assignable to type 'B'.
}
// Extract<T, Function> is a T that is known to be a Function
@@ -120,13 +135,13 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
!!! error TS2345: Property 'bat' is missing in type 'Bar & Foo' but required in type '{ foo: string; bat: string; }'.
!!! error TS2345: Type 'Extract<Foo & T, Bar>' is not assignable to type '{ foo: string; bat: string; }'.
!!! error TS2345: Property 'bat' is missing in type 'Bar & Foo' but required in type '{ foo: string; bat: string; }'.
!!! related TS2728 tests/cases/conformance/types/conditional/conditionalTypes2.ts:62:43: 'bat' is declared here.
!!! related TS2728 tests/cases/conformance/types/conditional/conditionalTypes2.ts:62:43: 'bat' is declared here.
!!! related TS2728 tests/cases/conformance/types/conditional/conditionalTypes2.ts:64:43: 'bat' is declared here.
!!! related TS2728 tests/cases/conformance/types/conditional/conditionalTypes2.ts:64:43: 'bat' is declared here.
fooBat(y); // Error
~
!!! error TS2345: Argument of type 'Extract<T, Foo & Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'.
!!! error TS2345: Property 'bat' is missing in type 'Foo & Bar' but required in type '{ foo: string; bat: string; }'.
!!! related TS2728 tests/cases/conformance/types/conditional/conditionalTypes2.ts:62:43: 'bat' is declared here.
!!! related TS2728 tests/cases/conformance/types/conditional/conditionalTypes2.ts:64:43: 'bat' is declared here.
fooBat(z); // Error
~
!!! error TS2345: Argument of type 'Extract2<T, Foo, Bar>' is not assignable to parameter of type '{ foo: string; bat: string; }'.
@@ -134,38 +149,6 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
!!! error TS2345: Type 'Bar & Foo & T' is not assignable to type '{ foo: string; bat: string; }'.
}
// Repros from #22860
class Opt<T> {
toVector(): Vector<T> {
return <any>undefined;
}
}
interface Seq<T> {
tail(): Opt<Seq<T>>;
}
class Vector<T> implements Seq<T> {
tail(): Opt<Vector<T>> {
return <any>undefined;
}
partition2<U extends T>(predicate:(v:T)=>v is U): [Vector<U>,Vector<Exclude<T, U>>];
partition2(predicate:(x:T)=>boolean): [Vector<T>,Vector<T>];
partition2<U extends T>(predicate:(v:T)=>boolean): [Vector<U>,Vector<any>] {
return <any>undefined;
}
}
interface A1<T> {
bat: B1<A1<T>>;
}
interface B1<T> extends A1<T> {
bat: B1<B1<T>>;
boom: T extends any ? true : true
}
// Repro from #22899
declare function toString1(value: object | Function): string ;
@@ -246,4 +229,29 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
};
type PCCA = ProductComplementComplement['a'];
type PCCB = ProductComplementComplement['b'];
// Repros from #27118
type MyElement<A> = [A] extends [[infer E]] ? E : never;
function oops<A, B extends A>(arg: MyElement<A>): MyElement<B> {
return arg; // Unsound, should be error
~~~~~~~~~~~
!!! error TS2322: Type 'MyElement<A>' is not assignable to type 'MyElement<B>'.
}
type MyAcceptor<A> = [A] extends [[infer E]] ? (arg: E) => void : never;
function oops2<A, B extends A>(arg: MyAcceptor<B>): MyAcceptor<A> {
return arg; // Unsound, should be error
~~~~~~~~~~~
!!! error TS2322: Type 'MyAcceptor<B>' is not assignable to type 'MyAcceptor<A>'.
}
type Dist<T> = T extends number ? number : string;
type Aux<A extends { a: unknown }> = A["a"] extends number ? number : string;
type Nondist<T> = Aux<{a: T}>;
function oops3<T>(arg: Dist<T>): Nondist<T> {
return arg; // Unsound, should be error
~~~~~~~~~~~
!!! error TS2322: Type 'Dist<T>' is not assignable to type 'Aux<{ a: T; }>'.
}
+47 -74
View File
@@ -1,4 +1,6 @@
//// [conditionalTypes2.ts]
// #27118: Conditional types are now invariant in the check type.
interface Covariant<T> {
foo: T extends string ? T : number;
}
@@ -12,13 +14,13 @@ interface Invariant<T> {
}
function f1<A, B extends A>(a: Covariant<A>, b: Covariant<B>) {
a = b;
a = b; // Error
b = a; // Error
}
function f2<A, B extends A>(a: Contravariant<A>, b: Contravariant<B>) {
a = b; // Error
b = a;
b = a; // Error
}
function f3<A, B extends A>(a: Invariant<A>, b: Invariant<B>) {
@@ -76,38 +78,6 @@ function f21<T>(x: Extract<Extract<T, Foo>, Bar>, y: Extract<T, Foo & Bar>, z: E
fooBat(z); // Error
}
// Repros from #22860
class Opt<T> {
toVector(): Vector<T> {
return <any>undefined;
}
}
interface Seq<T> {
tail(): Opt<Seq<T>>;
}
class Vector<T> implements Seq<T> {
tail(): Opt<Vector<T>> {
return <any>undefined;
}
partition2<U extends T>(predicate:(v:T)=>v is U): [Vector<U>,Vector<Exclude<T, U>>];
partition2(predicate:(x:T)=>boolean): [Vector<T>,Vector<T>];
partition2<U extends T>(predicate:(v:T)=>boolean): [Vector<U>,Vector<any>] {
return <any>undefined;
}
}
interface A1<T> {
bat: B1<A1<T>>;
}
interface B1<T> extends A1<T> {
bat: B1<B1<T>>;
boom: T extends any ? true : true
}
// Repro from #22899
declare function toString1(value: object | Function): string ;
@@ -188,17 +158,37 @@ type ProductComplementComplement = {
};
type PCCA = ProductComplementComplement['a'];
type PCCB = ProductComplementComplement['b'];
// Repros from #27118
type MyElement<A> = [A] extends [[infer E]] ? E : never;
function oops<A, B extends A>(arg: MyElement<A>): MyElement<B> {
return arg; // Unsound, should be error
}
type MyAcceptor<A> = [A] extends [[infer E]] ? (arg: E) => void : never;
function oops2<A, B extends A>(arg: MyAcceptor<B>): MyAcceptor<A> {
return arg; // Unsound, should be error
}
type Dist<T> = T extends number ? number : string;
type Aux<A extends { a: unknown }> = A["a"] extends number ? number : string;
type Nondist<T> = Aux<{a: T}>;
function oops3<T>(arg: Dist<T>): Nondist<T> {
return arg; // Unsound, should be error
}
//// [conditionalTypes2.js]
"use strict";
// #27118: Conditional types are now invariant in the check type.
function f1(a, b) {
a = b;
a = b; // Error
b = a; // Error
}
function f2(a, b) {
a = b; // Error
b = a;
b = a; // Error
}
function f3(a, b) {
a = b; // Error
@@ -239,32 +229,21 @@ function f21(x, y, z) {
fooBat(y); // Error
fooBat(z); // Error
}
// Repros from #22860
var Opt = /** @class */ (function () {
function Opt() {
}
Opt.prototype.toVector = function () {
return undefined;
};
return Opt;
}());
var Vector = /** @class */ (function () {
function Vector() {
}
Vector.prototype.tail = function () {
return undefined;
};
Vector.prototype.partition2 = function (predicate) {
return undefined;
};
return Vector;
}());
function foo(value) {
if (isFunction(value)) {
toString1(value);
toString2(value);
}
}
function oops(arg) {
return arg; // Unsound, should be error
}
function oops2(arg) {
return arg; // Unsound, should be error
}
function oops3(arg) {
return arg; // Unsound, should be error
}
//// [conditionalTypes2.d.ts]
@@ -302,24 +281,6 @@ declare function fooBat(x: {
declare type Extract2<T, U, V> = T extends U ? T extends V ? T : never : never;
declare function f20<T>(x: Extract<Extract<T, Foo>, Bar>, y: Extract<T, Foo & Bar>, z: Extract2<T, Foo, Bar>): void;
declare function f21<T>(x: Extract<Extract<T, Foo>, Bar>, y: Extract<T, Foo & Bar>, z: Extract2<T, Foo, Bar>): void;
declare class Opt<T> {
toVector(): Vector<T>;
}
interface Seq<T> {
tail(): Opt<Seq<T>>;
}
declare class Vector<T> implements Seq<T> {
tail(): Opt<Vector<T>>;
partition2<U extends T>(predicate: (v: T) => v is U): [Vector<U>, Vector<Exclude<T, U>>];
partition2(predicate: (x: T) => boolean): [Vector<T>, Vector<T>];
}
interface A1<T> {
bat: B1<A1<T>>;
}
interface B1<T> extends A1<T> {
bat: B1<B1<T>>;
boom: T extends any ? true : true;
}
declare function toString1(value: object | Function): string;
declare function toString2(value: Function): string;
declare function foo<T>(value: T): void;
@@ -392,3 +353,15 @@ declare type ProductComplementComplement = {
};
declare type PCCA = ProductComplementComplement['a'];
declare type PCCB = ProductComplementComplement['b'];
declare type MyElement<A> = [A] extends [[infer E]] ? E : never;
declare function oops<A, B extends A>(arg: MyElement<A>): MyElement<B>;
declare type MyAcceptor<A> = [A] extends [[infer E]] ? (arg: E) => void : never;
declare function oops2<A, B extends A>(arg: MyAcceptor<B>): MyAcceptor<A>;
declare type Dist<T> = T extends number ? number : string;
declare type Aux<A extends {
a: unknown;
}> = A["a"] extends number ? number : string;
declare type Nondist<T> = Aux<{
a: T;
}>;
declare function oops3<T>(arg: Dist<T>): Nondist<T>;
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,6 @@
=== tests/cases/conformance/types/conditional/conditionalTypes2.ts ===
// #27118: Conditional types are now invariant in the check type.
interface Covariant<T> {
foo: T extends string ? T : number;
>foo : T extends string ? T : number
@@ -19,7 +21,7 @@ function f1<A, B extends A>(a: Covariant<A>, b: Covariant<B>) {
>a : Covariant<A>
>b : Covariant<B>
a = b;
a = b; // Error
>a = b : Covariant<B>
>a : Covariant<A>
>b : Covariant<B>
@@ -40,7 +42,7 @@ function f2<A, B extends A>(a: Contravariant<A>, b: Contravariant<B>) {
>a : Contravariant<A>
>b : Contravariant<B>
b = a;
b = a; // Error
>b = a : Contravariant<A>
>b : Contravariant<B>
>a : Contravariant<A>
@@ -207,71 +209,6 @@ function f21<T>(x: Extract<Extract<T, Foo>, Bar>, y: Extract<T, Foo & Bar>, z: E
>z : Extract2<T, Foo, Bar>
}
// Repros from #22860
class Opt<T> {
>Opt : Opt<T>
toVector(): Vector<T> {
>toVector : () => Vector<T>
return <any>undefined;
><any>undefined : any
>undefined : undefined
}
}
interface Seq<T> {
tail(): Opt<Seq<T>>;
>tail : () => Opt<Seq<T>>
}
class Vector<T> implements Seq<T> {
>Vector : Vector<T>
tail(): Opt<Vector<T>> {
>tail : () => Opt<Vector<T>>
return <any>undefined;
><any>undefined : any
>undefined : undefined
}
partition2<U extends T>(predicate:(v:T)=>v is U): [Vector<U>,Vector<Exclude<T, U>>];
>partition2 : { <U extends T>(predicate: (v: T) => v is U): [Vector<U>, Vector<Exclude<T, U>>]; (predicate: (x: T) => boolean): [Vector<T>, Vector<T>]; }
>predicate : (v: T) => v is U
>v : T
partition2(predicate:(x:T)=>boolean): [Vector<T>,Vector<T>];
>partition2 : { <U extends T>(predicate: (v: T) => v is U): [Vector<U>, Vector<Exclude<T, U>>]; (predicate: (x: T) => boolean): [Vector<T>, Vector<T>]; }
>predicate : (x: T) => boolean
>x : T
partition2<U extends T>(predicate:(v:T)=>boolean): [Vector<U>,Vector<any>] {
>partition2 : { <U extends T>(predicate: (v: T) => v is U): [Vector<U>, Vector<Exclude<T, U>>]; (predicate: (x: T) => boolean): [Vector<T>, Vector<T>]; }
>predicate : (v: T) => boolean
>v : T
return <any>undefined;
><any>undefined : any
>undefined : undefined
}
}
interface A1<T> {
bat: B1<A1<T>>;
>bat : B1<A1<T>>
}
interface B1<T> extends A1<T> {
bat: B1<B1<T>>;
>bat : B1<B1<T>>
boom: T extends any ? true : true
>boom : T extends any ? true : true
>true : true
>true : true
}
// Repro from #22899
declare function toString1(value: object | Function): string ;
@@ -431,3 +368,47 @@ type PCCA = ProductComplementComplement['a'];
type PCCB = ProductComplementComplement['b'];
>PCCB : Product<"b", 1>
// Repros from #27118
type MyElement<A> = [A] extends [[infer E]] ? E : never;
>MyElement : MyElement<A>
function oops<A, B extends A>(arg: MyElement<A>): MyElement<B> {
>oops : <A, B extends A>(arg: MyElement<A>) => MyElement<B>
>arg : MyElement<A>
return arg; // Unsound, should be error
>arg : MyElement<A>
}
type MyAcceptor<A> = [A] extends [[infer E]] ? (arg: E) => void : never;
>MyAcceptor : MyAcceptor<A>
>arg : E
function oops2<A, B extends A>(arg: MyAcceptor<B>): MyAcceptor<A> {
>oops2 : <A, B extends A>(arg: MyAcceptor<B>) => MyAcceptor<A>
>arg : MyAcceptor<B>
return arg; // Unsound, should be error
>arg : MyAcceptor<B>
}
type Dist<T> = T extends number ? number : string;
>Dist : Dist<T>
type Aux<A extends { a: unknown }> = A["a"] extends number ? number : string;
>Aux : Aux<A>
>a : unknown
type Nondist<T> = Aux<{a: T}>;
>Nondist : Aux<{ a: T; }>
>a : T
function oops3<T>(arg: Dist<T>): Nondist<T> {
>oops3 : <T>(arg: Dist<T>) => Aux<{ a: T; }>
>arg : Dist<T>
return arg; // Unsound, should be error
>arg : Dist<T>
}
@@ -0,0 +1,14 @@
tests/cases/compiler/b.ts(4,1): error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"tests/cases/compiler/a"'.
==== tests/cases/compiler/a.ts (0 errors) ====
interface I {}
export function f(): I { return null as I; }
==== tests/cases/compiler/b.ts (1 errors) ====
import {f} from "./a";
export function q() {}
q.val = f();
~~~~~
!!! error TS4032: Property 'val' of exported interface has or is using name 'I' from private module '"tests/cases/compiler/a"'.
@@ -0,0 +1,31 @@
//// [tests/cases/compiler/declarationEmitExpandoPropertyPrivateName.ts] ////
//// [a.ts]
interface I {}
export function f(): I { return null as I; }
//// [b.ts]
import {f} from "./a";
export function q() {}
q.val = f();
//// [a.js]
"use strict";
exports.__esModule = true;
function f() { return null; }
exports.f = f;
//// [b.js]
"use strict";
exports.__esModule = true;
var a_1 = require("./a");
function q() { }
exports.q = q;
q.val = a_1.f();
//// [a.d.ts]
interface I {
}
export declare function f(): I;
export {};
@@ -0,0 +1,22 @@
=== tests/cases/compiler/a.ts ===
interface I {}
>I : Symbol(I, Decl(a.ts, 0, 0))
export function f(): I { return null as I; }
>f : Symbol(f, Decl(a.ts, 0, 14))
>I : Symbol(I, Decl(a.ts, 0, 0))
>I : Symbol(I, Decl(a.ts, 0, 0))
=== tests/cases/compiler/b.ts ===
import {f} from "./a";
>f : Symbol(f, Decl(b.ts, 0, 8))
export function q() {}
>q : Symbol(q, Decl(b.ts, 0, 22), Decl(b.ts, 2, 22))
q.val = f();
>q.val : Symbol(q.val, Decl(b.ts, 2, 22))
>q : Symbol(q, Decl(b.ts, 0, 22), Decl(b.ts, 2, 22))
>val : Symbol(q.val, Decl(b.ts, 2, 22))
>f : Symbol(f, Decl(b.ts, 0, 8))
@@ -0,0 +1,22 @@
=== tests/cases/compiler/a.ts ===
interface I {}
export function f(): I { return null as I; }
>f : () => I
>null as I : I
>null : null
=== tests/cases/compiler/b.ts ===
import {f} from "./a";
>f : () => I
export function q() {}
>q : typeof q
q.val = f();
>q.val = f() : I
>q.val : I
>q : typeof q
>val : I
>f() : I
>f : () => I
@@ -7,7 +7,7 @@ export const c1 = 1;
export const s0 = Symbol();
>s0 : Symbol(s0, Decl(module.ts, 2, 12))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
export interface T0 {
>T0 : Symbol(T0, Decl(module.ts, 2, 27))
@@ -62,19 +62,19 @@ t2 = t1;
const x = Symbol();
>x : Symbol(x, Decl(dynamicNamesErrors.ts, 26, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
const y = Symbol();
>y : Symbol(y, Decl(dynamicNamesErrors.ts, 27, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
const z = Symbol();
>z : Symbol(z, Decl(dynamicNamesErrors.ts, 28, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
const w = Symbol();
>w : Symbol(w, Decl(dynamicNamesErrors.ts, 29, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
export interface InterfaceMemberVisibility {
>InterfaceMemberVisibility : Symbol(InterfaceMemberVisibility, Decl(dynamicNamesErrors.ts, 29, 19))
@@ -1,13 +1,14 @@
//// [emitter.noCatchBinding.esnext.ts]
//// [emitter.noCatchBinding.es2019.ts]
function f() {
try { } catch { }
try { } catch {
try { } catch { }
}
try { } catch { } finally { }
}
}
//// [emitter.noCatchBinding.esnext.js]
//// [emitter.noCatchBinding.es2019.js]
function f() {
try { }
catch { }
@@ -0,0 +1,11 @@
=== tests/cases/conformance/emitter/es2019/noCatchBinding/emitter.noCatchBinding.es2019.ts ===
function f() {
>f : Symbol(f, Decl(emitter.noCatchBinding.es2019.ts, 0, 0))
try { } catch { }
try { } catch {
try { } catch { }
}
try { } catch { } finally { }
}
@@ -1,4 +1,4 @@
=== tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts ===
=== tests/cases/conformance/emitter/es2019/noCatchBinding/emitter.noCatchBinding.es2019.ts ===
function f() {
>f : () => void
@@ -8,3 +8,4 @@ function f() {
}
try { } catch { } finally { }
}
@@ -1,10 +0,0 @@
=== tests/cases/conformance/emitter/esnext/noCatchBinding/emitter.noCatchBinding.esnext.ts ===
function f() {
>f : Symbol(f, Decl(emitter.noCatchBinding.esnext.ts, 0, 0))
try { } catch { }
try { } catch {
try { } catch { }
}
try { } catch { } finally { }
}
@@ -149,7 +149,35 @@ var g2 = applySpec({ foo: { bar: { baz: (x: any) => true } } });
const foo = <T>(object: T, partial: Partial<T>) => object;
let o = {a: 5, b: 7};
foo(o, {b: 9});
o = foo(o, {b: 9});
o = foo(o, {b: 9});
// Inferring to { [P in K]: X }, where K extends keyof T, produces same inferences as
// inferring to { [P in keyof T]: X }.
declare function f20<T, K extends keyof T>(obj: Pick<T, K>): T;
declare function f21<T, K extends keyof T>(obj: Pick<T, K>): K;
declare function f22<T, K extends keyof T>(obj: Boxified<Pick<T, K>>): T;
declare function f23<T, U extends keyof T, K extends U>(obj: Pick<T, K>): T;
declare function f24<T, U, K extends keyof T | keyof U>(obj: Pick<T & U, K>): T & U;
let x0 = f20({ foo: 42, bar: "hello" });
let x1 = f21({ foo: 42, bar: "hello" });
let x2 = f22({ foo: { value: 42} , bar: { value: "hello" } });
let x3 = f23({ foo: 42, bar: "hello" });
let x4 = f24({ foo: 42, bar: "hello" });
// Repro from #29765
function getProps<T, K extends keyof T>(obj: T, list: K[]): Pick<T, K> {
return {} as any;
}
const myAny: any = {};
const o1 = getProps(myAny, ['foo', 'bar']);
const o2: { foo: any; bar: any } = getProps(myAny, ['foo', 'bar']);
//// [isomorphicMappedTypeInference.js]
function box(x) {
@@ -255,6 +283,18 @@ var foo = function (object, partial) { return object; };
var o = { a: 5, b: 7 };
foo(o, { b: 9 });
o = foo(o, { b: 9 });
var x0 = f20({ foo: 42, bar: "hello" });
var x1 = f21({ foo: 42, bar: "hello" });
var x2 = f22({ foo: { value: 42 }, bar: { value: "hello" } });
var x3 = f23({ foo: 42, bar: "hello" });
var x4 = f24({ foo: 42, bar: "hello" });
// Repro from #29765
function getProps(obj, list) {
return {};
}
var myAny = {};
var o1 = getProps(myAny, ['foo', 'bar']);
var o2 = getProps(myAny, ['foo', 'bar']);
//// [isomorphicMappedTypeInference.d.ts]
@@ -323,3 +363,35 @@ declare let o: {
a: number;
b: number;
};
declare function f20<T, K extends keyof T>(obj: Pick<T, K>): T;
declare function f21<T, K extends keyof T>(obj: Pick<T, K>): K;
declare function f22<T, K extends keyof T>(obj: Boxified<Pick<T, K>>): T;
declare function f23<T, U extends keyof T, K extends U>(obj: Pick<T, K>): T;
declare function f24<T, U, K extends keyof T | keyof U>(obj: Pick<T & U, K>): T & U;
declare let x0: {
foo: number;
bar: string;
};
declare let x1: "foo" | "bar";
declare let x2: {
foo: number;
bar: string;
};
declare let x3: {
foo: number;
bar: string;
};
declare let x4: {
foo: number;
bar: string;
} & {
foo: number;
bar: string;
};
declare function getProps<T, K extends keyof T>(obj: T, list: K[]): Pick<T, K>;
declare const myAny: any;
declare const o1: Pick<any, "foo" | "bar">;
declare const o2: {
foo: any;
bar: any;
};
@@ -486,3 +486,133 @@ o = foo(o, {b: 9});
>o : Symbol(o, Decl(isomorphicMappedTypeInference.ts, 148, 3))
>b : Symbol(b, Decl(isomorphicMappedTypeInference.ts, 150, 12))
// Inferring to { [P in K]: X }, where K extends keyof T, produces same inferences as
// inferring to { [P in keyof T]: X }.
declare function f20<T, K extends keyof T>(obj: Pick<T, K>): T;
>f20 : Symbol(f20, Decl(isomorphicMappedTypeInference.ts, 150, 19))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 155, 21))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 155, 23))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 155, 21))
>obj : Symbol(obj, Decl(isomorphicMappedTypeInference.ts, 155, 43))
>Pick : Symbol(Pick, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 155, 21))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 155, 23))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 155, 21))
declare function f21<T, K extends keyof T>(obj: Pick<T, K>): K;
>f21 : Symbol(f21, Decl(isomorphicMappedTypeInference.ts, 155, 63))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 156, 21))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 156, 23))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 156, 21))
>obj : Symbol(obj, Decl(isomorphicMappedTypeInference.ts, 156, 43))
>Pick : Symbol(Pick, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 156, 21))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 156, 23))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 156, 23))
declare function f22<T, K extends keyof T>(obj: Boxified<Pick<T, K>>): T;
>f22 : Symbol(f22, Decl(isomorphicMappedTypeInference.ts, 156, 63))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 157, 21))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 157, 23))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 157, 21))
>obj : Symbol(obj, Decl(isomorphicMappedTypeInference.ts, 157, 43))
>Boxified : Symbol(Boxified, Decl(isomorphicMappedTypeInference.ts, 2, 1))
>Pick : Symbol(Pick, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 157, 21))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 157, 23))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 157, 21))
declare function f23<T, U extends keyof T, K extends U>(obj: Pick<T, K>): T;
>f23 : Symbol(f23, Decl(isomorphicMappedTypeInference.ts, 157, 73))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 158, 21))
>U : Symbol(U, Decl(isomorphicMappedTypeInference.ts, 158, 23))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 158, 21))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 158, 42))
>U : Symbol(U, Decl(isomorphicMappedTypeInference.ts, 158, 23))
>obj : Symbol(obj, Decl(isomorphicMappedTypeInference.ts, 158, 56))
>Pick : Symbol(Pick, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 158, 21))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 158, 42))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 158, 21))
declare function f24<T, U, K extends keyof T | keyof U>(obj: Pick<T & U, K>): T & U;
>f24 : Symbol(f24, Decl(isomorphicMappedTypeInference.ts, 158, 76))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 159, 21))
>U : Symbol(U, Decl(isomorphicMappedTypeInference.ts, 159, 23))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 159, 26))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 159, 21))
>U : Symbol(U, Decl(isomorphicMappedTypeInference.ts, 159, 23))
>obj : Symbol(obj, Decl(isomorphicMappedTypeInference.ts, 159, 56))
>Pick : Symbol(Pick, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 159, 21))
>U : Symbol(U, Decl(isomorphicMappedTypeInference.ts, 159, 23))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 159, 26))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 159, 21))
>U : Symbol(U, Decl(isomorphicMappedTypeInference.ts, 159, 23))
let x0 = f20({ foo: 42, bar: "hello" });
>x0 : Symbol(x0, Decl(isomorphicMappedTypeInference.ts, 161, 3))
>f20 : Symbol(f20, Decl(isomorphicMappedTypeInference.ts, 150, 19))
>foo : Symbol(foo, Decl(isomorphicMappedTypeInference.ts, 161, 14))
>bar : Symbol(bar, Decl(isomorphicMappedTypeInference.ts, 161, 23))
let x1 = f21({ foo: 42, bar: "hello" });
>x1 : Symbol(x1, Decl(isomorphicMappedTypeInference.ts, 162, 3))
>f21 : Symbol(f21, Decl(isomorphicMappedTypeInference.ts, 155, 63))
>foo : Symbol(foo, Decl(isomorphicMappedTypeInference.ts, 162, 14))
>bar : Symbol(bar, Decl(isomorphicMappedTypeInference.ts, 162, 23))
let x2 = f22({ foo: { value: 42} , bar: { value: "hello" } });
>x2 : Symbol(x2, Decl(isomorphicMappedTypeInference.ts, 163, 3))
>f22 : Symbol(f22, Decl(isomorphicMappedTypeInference.ts, 156, 63))
>foo : Symbol(foo, Decl(isomorphicMappedTypeInference.ts, 163, 14))
>value : Symbol(value, Decl(isomorphicMappedTypeInference.ts, 163, 21))
>bar : Symbol(bar, Decl(isomorphicMappedTypeInference.ts, 163, 34))
>value : Symbol(value, Decl(isomorphicMappedTypeInference.ts, 163, 41))
let x3 = f23({ foo: 42, bar: "hello" });
>x3 : Symbol(x3, Decl(isomorphicMappedTypeInference.ts, 164, 3))
>f23 : Symbol(f23, Decl(isomorphicMappedTypeInference.ts, 157, 73))
>foo : Symbol(foo, Decl(isomorphicMappedTypeInference.ts, 164, 14))
>bar : Symbol(bar, Decl(isomorphicMappedTypeInference.ts, 164, 23))
let x4 = f24({ foo: 42, bar: "hello" });
>x4 : Symbol(x4, Decl(isomorphicMappedTypeInference.ts, 165, 3))
>f24 : Symbol(f24, Decl(isomorphicMappedTypeInference.ts, 158, 76))
>foo : Symbol(foo, Decl(isomorphicMappedTypeInference.ts, 165, 14))
>bar : Symbol(bar, Decl(isomorphicMappedTypeInference.ts, 165, 23))
// Repro from #29765
function getProps<T, K extends keyof T>(obj: T, list: K[]): Pick<T, K> {
>getProps : Symbol(getProps, Decl(isomorphicMappedTypeInference.ts, 165, 40))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 169, 18))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 169, 20))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 169, 18))
>obj : Symbol(obj, Decl(isomorphicMappedTypeInference.ts, 169, 40))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 169, 18))
>list : Symbol(list, Decl(isomorphicMappedTypeInference.ts, 169, 47))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 169, 20))
>Pick : Symbol(Pick, Decl(lib.es5.d.ts, --, --))
>T : Symbol(T, Decl(isomorphicMappedTypeInference.ts, 169, 18))
>K : Symbol(K, Decl(isomorphicMappedTypeInference.ts, 169, 20))
return {} as any;
}
const myAny: any = {};
>myAny : Symbol(myAny, Decl(isomorphicMappedTypeInference.ts, 173, 5))
const o1 = getProps(myAny, ['foo', 'bar']);
>o1 : Symbol(o1, Decl(isomorphicMappedTypeInference.ts, 175, 5))
>getProps : Symbol(getProps, Decl(isomorphicMappedTypeInference.ts, 165, 40))
>myAny : Symbol(myAny, Decl(isomorphicMappedTypeInference.ts, 173, 5))
const o2: { foo: any; bar: any } = getProps(myAny, ['foo', 'bar']);
>o2 : Symbol(o2, Decl(isomorphicMappedTypeInference.ts, 177, 5))
>foo : Symbol(foo, Decl(isomorphicMappedTypeInference.ts, 177, 11))
>bar : Symbol(bar, Decl(isomorphicMappedTypeInference.ts, 177, 21))
>getProps : Symbol(getProps, Decl(isomorphicMappedTypeInference.ts, 165, 40))
>myAny : Symbol(myAny, Decl(isomorphicMappedTypeInference.ts, 173, 5))
@@ -507,3 +507,116 @@ o = foo(o, {b: 9});
>b : number
>9 : 9
// Inferring to { [P in K]: X }, where K extends keyof T, produces same inferences as
// inferring to { [P in keyof T]: X }.
declare function f20<T, K extends keyof T>(obj: Pick<T, K>): T;
>f20 : <T, K extends keyof T>(obj: Pick<T, K>) => T
>obj : Pick<T, K>
declare function f21<T, K extends keyof T>(obj: Pick<T, K>): K;
>f21 : <T, K extends keyof T>(obj: Pick<T, K>) => K
>obj : Pick<T, K>
declare function f22<T, K extends keyof T>(obj: Boxified<Pick<T, K>>): T;
>f22 : <T, K extends keyof T>(obj: Boxified<Pick<T, K>>) => T
>obj : Boxified<Pick<T, K>>
declare function f23<T, U extends keyof T, K extends U>(obj: Pick<T, K>): T;
>f23 : <T, U extends keyof T, K extends U>(obj: Pick<T, K>) => T
>obj : Pick<T, K>
declare function f24<T, U, K extends keyof T | keyof U>(obj: Pick<T & U, K>): T & U;
>f24 : <T, U, K extends keyof T | keyof U>(obj: Pick<T & U, K>) => T & U
>obj : Pick<T & U, K>
let x0 = f20({ foo: 42, bar: "hello" });
>x0 : { foo: number; bar: string; }
>f20({ foo: 42, bar: "hello" }) : { foo: number; bar: string; }
>f20 : <T, K extends keyof T>(obj: Pick<T, K>) => T
>{ foo: 42, bar: "hello" } : { foo: number; bar: string; }
>foo : number
>42 : 42
>bar : string
>"hello" : "hello"
let x1 = f21({ foo: 42, bar: "hello" });
>x1 : "foo" | "bar"
>f21({ foo: 42, bar: "hello" }) : "foo" | "bar"
>f21 : <T, K extends keyof T>(obj: Pick<T, K>) => K
>{ foo: 42, bar: "hello" } : { foo: number; bar: string; }
>foo : number
>42 : 42
>bar : string
>"hello" : "hello"
let x2 = f22({ foo: { value: 42} , bar: { value: "hello" } });
>x2 : { foo: number; bar: string; }
>f22({ foo: { value: 42} , bar: { value: "hello" } }) : { foo: number; bar: string; }
>f22 : <T, K extends keyof T>(obj: Boxified<Pick<T, K>>) => T
>{ foo: { value: 42} , bar: { value: "hello" } } : { foo: { value: number; }; bar: { value: string; }; }
>foo : { value: number; }
>{ value: 42} : { value: number; }
>value : number
>42 : 42
>bar : { value: string; }
>{ value: "hello" } : { value: string; }
>value : string
>"hello" : "hello"
let x3 = f23({ foo: 42, bar: "hello" });
>x3 : { foo: number; bar: string; }
>f23({ foo: 42, bar: "hello" }) : { foo: number; bar: string; }
>f23 : <T, U extends keyof T, K extends U>(obj: Pick<T, K>) => T
>{ foo: 42, bar: "hello" } : { foo: number; bar: string; }
>foo : number
>42 : 42
>bar : string
>"hello" : "hello"
let x4 = f24({ foo: 42, bar: "hello" });
>x4 : { foo: number; bar: string; } & { foo: number; bar: string; }
>f24({ foo: 42, bar: "hello" }) : { foo: number; bar: string; } & { foo: number; bar: string; }
>f24 : <T, U, K extends keyof T | keyof U>(obj: Pick<T & U, K>) => T & U
>{ foo: 42, bar: "hello" } : { foo: number; bar: string; }
>foo : number
>42 : 42
>bar : string
>"hello" : "hello"
// Repro from #29765
function getProps<T, K extends keyof T>(obj: T, list: K[]): Pick<T, K> {
>getProps : <T, K extends keyof T>(obj: T, list: K[]) => Pick<T, K>
>obj : T
>list : K[]
return {} as any;
>{} as any : any
>{} : {}
}
const myAny: any = {};
>myAny : any
>{} : {}
const o1 = getProps(myAny, ['foo', 'bar']);
>o1 : Pick<any, "foo" | "bar">
>getProps(myAny, ['foo', 'bar']) : Pick<any, "foo" | "bar">
>getProps : <T, K extends keyof T>(obj: T, list: K[]) => Pick<T, K>
>myAny : any
>['foo', 'bar'] : ("foo" | "bar")[]
>'foo' : "foo"
>'bar' : "bar"
const o2: { foo: any; bar: any } = getProps(myAny, ['foo', 'bar']);
>o2 : { foo: any; bar: any; }
>foo : any
>bar : any
>getProps(myAny, ['foo', 'bar']) : Pick<any, "foo" | "bar">
>getProps : <T, K extends keyof T>(obj: T, list: K[]) => Pick<T, K>
>myAny : any
>['foo', 'bar'] : ("foo" | "bar")[]
>'foo' : "foo"
>'bar' : "bar"
+1 -1
View File
@@ -11,7 +11,7 @@ declare function shouldBeIdentity<T, U>(p: DoNothingAlias<T, U>): MyPromise<T, U
declare const p1: MyPromise<boolean, any>;
var p2 = shouldBeIdentity(p1);
var p2: MyPromise<boolean, {}>;
var p2: MyPromise<boolean, any>;
//// [jqueryInference.js]
@@ -48,7 +48,7 @@ var p2 = shouldBeIdentity(p1);
>shouldBeIdentity : Symbol(shouldBeIdentity, Decl(jqueryInference.ts, 6, 58))
>p1 : Symbol(p1, Decl(jqueryInference.ts, 10, 13))
var p2: MyPromise<boolean, {}>;
var p2: MyPromise<boolean, any>;
>p2 : Symbol(p2, Decl(jqueryInference.ts, 11, 3), Decl(jqueryInference.ts, 12, 3))
>MyPromise : Symbol(MyPromise, Decl(jqueryInference.ts, 0, 0))
@@ -22,11 +22,11 @@ declare const p1: MyPromise<boolean, any>;
>p1 : MyPromise<boolean, any>
var p2 = shouldBeIdentity(p1);
>p2 : MyPromise<boolean, {}>
>shouldBeIdentity(p1) : MyPromise<boolean, {}>
>p2 : MyPromise<boolean, any>
>shouldBeIdentity(p1) : MyPromise<boolean, any>
>shouldBeIdentity : <T, U>(p: DoNothingAlias<T, U>) => MyPromise<T, U>
>p1 : MyPromise<boolean, any>
var p2: MyPromise<boolean, {}>;
>p2 : MyPromise<boolean, {}>
var p2: MyPromise<boolean, any>;
>p2 : MyPromise<boolean, any>
@@ -2,7 +2,7 @@
const foo = Symbol.for("foo");
>foo : Symbol(foo, Decl(objectLiteralPropertyImplicitlyAny.ts, 0, 5))
>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
>for : Symbol(SymbolConstructor.for, Decl(lib.es2015.symbol.d.ts, --, --))
const o = { [foo]: undefined };
+1 -1
View File
@@ -602,7 +602,7 @@ let exclusive: { id: string, a: number, b: string, c: string, d: boolean } =
>d : boolean
f({ a: 1, b: 'yes' }, { c: 'no', d: false })
>f({ a: 1, b: 'yes' }, { c: 'no', d: false }) : { a: number; b: string; } & { c: string; d: boolean; } & { id: string; }
>f({ a: 1, b: 'yes' }, { c: 'no', d: false }) : { a: number; b: string; } & { c: string; d: false; } & { id: string; }
>f : <T, U>(t: T, u: U) => T & U & { id: string; }
>{ a: 1, b: 'yes' } : { a: number; b: string; }
>a : number
@@ -173,7 +173,7 @@ f0([]); // Error
>[] : never[]
f0([1]);
>f0([1]) : [number, {}]
>f0([1]) : [number, number]
>f0 : <T, U>(x: [T, ...U[]]) => [T, U]
>[1] : [number]
>1 : 1
@@ -1,7 +1,7 @@
tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts(56,7): error TS2345: Argument of type '(a: number, b: any, ...x: any[]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'.
tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts(56,7): error TS2345: Argument of type '(a: number, b: T[0], ...x: T[number][]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'.
Types of parameters 'b' and 'args' are incompatible.
Type 'T' is not assignable to type '[any, ...any[]]'.
Property '0' is missing in type 'any[]' but required in type '[any, ...any[]]'.
Type 'T' is not assignable to type '[T[0], ...T[number][]]'.
Property '0' is missing in type 'any[]' but required in type '[T[0], ...T[number][]]'.
==== tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts (1 errors) ====
@@ -62,10 +62,10 @@ tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts(56,7): error
f((a, ...x) => {});
f((a, b, ...x) => {});
~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(a: number, b: any, ...x: any[]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'.
!!! error TS2345: Argument of type '(a: number, b: T[0], ...x: T[number][]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'.
!!! error TS2345: Types of parameters 'b' and 'args' are incompatible.
!!! error TS2345: Type 'T' is not assignable to type '[any, ...any[]]'.
!!! error TS2345: Property '0' is missing in type 'any[]' but required in type '[any, ...any[]]'.
!!! error TS2345: Type 'T' is not assignable to type '[T[0], ...T[number][]]'.
!!! error TS2345: Property '0' is missing in type 'any[]' but required in type '[T[0], ...T[number][]]'.
}
// Repro from #25288
@@ -79,4 +79,18 @@ tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts(56,7): error
(function foo(...rest){}(1, ''));
take(function(...rest){});
// Repro from #29833
type ArgsUnion = [number, string] | [number, Error];
type TupleUnionFunc = (...params: ArgsUnion) => number;
const funcUnionTupleNoRest: TupleUnionFunc = (num, strOrErr) => {
return num;
};
const funcUnionTupleRest: TupleUnionFunc = (...params) => {
const [num, strOrErr] = params;
return num;
};
@@ -68,6 +68,20 @@ declare function take(cb: (a: number, b: string) => void): void;
(function foo(...rest){}(1, ''));
take(function(...rest){});
// Repro from #29833
type ArgsUnion = [number, string] | [number, Error];
type TupleUnionFunc = (...params: ArgsUnion) => number;
const funcUnionTupleNoRest: TupleUnionFunc = (num, strOrErr) => {
return num;
};
const funcUnionTupleRest: TupleUnionFunc = (...params) => {
const [num, strOrErr] = params;
return num;
};
//// [restTuplesFromContextualTypes.js]
@@ -274,6 +288,17 @@ take(function () {
rest[_i] = arguments[_i];
}
});
var funcUnionTupleNoRest = function (num, strOrErr) {
return num;
};
var funcUnionTupleRest = function () {
var params = [];
for (var _i = 0; _i < arguments.length; _i++) {
params[_i] = arguments[_i];
}
var num = params[0], strOrErr = params[1];
return num;
};
//// [restTuplesFromContextualTypes.d.ts]
@@ -286,3 +311,7 @@ declare function f3(cb: (x: number, ...args: typeof t3) => void): void;
declare function f4<T extends any[]>(t: T): void;
declare var tuple: [number, string];
declare function take(cb: (a: number, b: string) => void): void;
declare type ArgsUnion = [number, string] | [number, Error];
declare type TupleUnionFunc = (...params: ArgsUnion) => number;
declare const funcUnionTupleNoRest: TupleUnionFunc;
declare const funcUnionTupleRest: TupleUnionFunc;
@@ -265,3 +265,40 @@ take(function(...rest){});
>take : Symbol(take, Decl(restTuplesFromContextualTypes.ts, 61, 33))
>rest : Symbol(rest, Decl(restTuplesFromContextualTypes.ts, 68, 14))
// Repro from #29833
type ArgsUnion = [number, string] | [number, Error];
>ArgsUnion : Symbol(ArgsUnion, Decl(restTuplesFromContextualTypes.ts, 68, 26))
>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
type TupleUnionFunc = (...params: ArgsUnion) => number;
>TupleUnionFunc : Symbol(TupleUnionFunc, Decl(restTuplesFromContextualTypes.ts, 72, 52))
>params : Symbol(params, Decl(restTuplesFromContextualTypes.ts, 73, 23))
>ArgsUnion : Symbol(ArgsUnion, Decl(restTuplesFromContextualTypes.ts, 68, 26))
const funcUnionTupleNoRest: TupleUnionFunc = (num, strOrErr) => {
>funcUnionTupleNoRest : Symbol(funcUnionTupleNoRest, Decl(restTuplesFromContextualTypes.ts, 75, 5))
>TupleUnionFunc : Symbol(TupleUnionFunc, Decl(restTuplesFromContextualTypes.ts, 72, 52))
>num : Symbol(num, Decl(restTuplesFromContextualTypes.ts, 75, 46))
>strOrErr : Symbol(strOrErr, Decl(restTuplesFromContextualTypes.ts, 75, 50))
return num;
>num : Symbol(num, Decl(restTuplesFromContextualTypes.ts, 75, 46))
};
const funcUnionTupleRest: TupleUnionFunc = (...params) => {
>funcUnionTupleRest : Symbol(funcUnionTupleRest, Decl(restTuplesFromContextualTypes.ts, 79, 5))
>TupleUnionFunc : Symbol(TupleUnionFunc, Decl(restTuplesFromContextualTypes.ts, 72, 52))
>params : Symbol(params, Decl(restTuplesFromContextualTypes.ts, 79, 44))
const [num, strOrErr] = params;
>num : Symbol(num, Decl(restTuplesFromContextualTypes.ts, 80, 9))
>strOrErr : Symbol(strOrErr, Decl(restTuplesFromContextualTypes.ts, 80, 13))
>params : Symbol(params, Decl(restTuplesFromContextualTypes.ts, 79, 44))
return num;
>num : Symbol(num, Decl(restTuplesFromContextualTypes.ts, 80, 9))
};
@@ -332,8 +332,8 @@ function f4<T extends any[]>(t: T) {
f((...x) => {});
>f((...x) => {}) : void
>f : (cb: (x: number, ...args: T) => void) => void
>(...x) => {} : (x: number, ...args: any[]) => void
>x : [number, ...any[]]
>(...x) => {} : (x: number, ...args: T[number][]) => void
>x : [number, ...T[number][]]
f((a, ...x) => {});
>f((a, ...x) => {}) : void
@@ -345,10 +345,10 @@ function f4<T extends any[]>(t: T) {
f((a, b, ...x) => {});
>f((a, b, ...x) => {}) : void
>f : (cb: (x: number, ...args: T) => void) => void
>(a, b, ...x) => {} : (a: number, b: any, ...x: any[]) => void
>(a, b, ...x) => {} : (a: number, b: T[0], ...x: T[number][]) => void
>a : number
>b : any
>x : any[]
>b : T[0]
>x : T[number][]
}
// Repro from #25288
@@ -389,3 +389,38 @@ take(function(...rest){});
>function(...rest){} : (a: number, b: string) => void
>rest : [number, string]
// Repro from #29833
type ArgsUnion = [number, string] | [number, Error];
>ArgsUnion : ArgsUnion
type TupleUnionFunc = (...params: ArgsUnion) => number;
>TupleUnionFunc : TupleUnionFunc
>params : ArgsUnion
const funcUnionTupleNoRest: TupleUnionFunc = (num, strOrErr) => {
>funcUnionTupleNoRest : TupleUnionFunc
>(num, strOrErr) => { return num;} : (num: number, strOrErr: string | Error) => number
>num : number
>strOrErr : string | Error
return num;
>num : number
};
const funcUnionTupleRest: TupleUnionFunc = (...params) => {
>funcUnionTupleRest : TupleUnionFunc
>(...params) => { const [num, strOrErr] = params; return num;} : (...params: ArgsUnion) => number
>params : ArgsUnion
const [num, strOrErr] = params;
>num : number
>strOrErr : string | Error
>params : ArgsUnion
return num;
>num : number
};
+14
View File
@@ -0,0 +1,14 @@
//// [stringTrim.ts]
var trimmed: string;
trimmed = "abcde".trimEnd();
trimmed = "abcde".trimStart();
trimmed = "abcde".trimLeft();
trimmed = "abcde".trimRight();
//// [stringTrim.js]
var trimmed;
trimmed = "abcde".trimEnd();
trimmed = "abcde".trimStart();
trimmed = "abcde".trimLeft();
trimmed = "abcde".trimRight();
@@ -0,0 +1,24 @@
=== tests/cases/compiler/stringTrim.ts ===
var trimmed: string;
>trimmed : Symbol(trimmed, Decl(stringTrim.ts, 0, 3))
trimmed = "abcde".trimEnd();
>trimmed : Symbol(trimmed, Decl(stringTrim.ts, 0, 3))
>"abcde".trimEnd : Symbol(String.trimEnd, Decl(lib.es2019.string.d.ts, --, --))
>trimEnd : Symbol(String.trimEnd, Decl(lib.es2019.string.d.ts, --, --))
trimmed = "abcde".trimStart();
>trimmed : Symbol(trimmed, Decl(stringTrim.ts, 0, 3))
>"abcde".trimStart : Symbol(String.trimStart, Decl(lib.es2019.string.d.ts, --, --))
>trimStart : Symbol(String.trimStart, Decl(lib.es2019.string.d.ts, --, --))
trimmed = "abcde".trimLeft();
>trimmed : Symbol(trimmed, Decl(stringTrim.ts, 0, 3))
>"abcde".trimLeft : Symbol(String.trimLeft, Decl(lib.es2019.string.d.ts, --, --))
>trimLeft : Symbol(String.trimLeft, Decl(lib.es2019.string.d.ts, --, --))
trimmed = "abcde".trimRight();
>trimmed : Symbol(trimmed, Decl(stringTrim.ts, 0, 3))
>"abcde".trimRight : Symbol(String.trimRight, Decl(lib.es2019.string.d.ts, --, --))
>trimRight : Symbol(String.trimRight, Decl(lib.es2019.string.d.ts, --, --))
@@ -0,0 +1,36 @@
=== tests/cases/compiler/stringTrim.ts ===
var trimmed: string;
>trimmed : string
trimmed = "abcde".trimEnd();
>trimmed = "abcde".trimEnd() : string
>trimmed : string
>"abcde".trimEnd() : string
>"abcde".trimEnd : () => string
>"abcde" : "abcde"
>trimEnd : () => string
trimmed = "abcde".trimStart();
>trimmed = "abcde".trimStart() : string
>trimmed : string
>"abcde".trimStart() : string
>"abcde".trimStart : () => string
>"abcde" : "abcde"
>trimStart : () => string
trimmed = "abcde".trimLeft();
>trimmed = "abcde".trimLeft() : string
>trimmed : string
>"abcde".trimLeft() : string
>"abcde".trimLeft : () => string
>"abcde" : "abcde"
>trimLeft : () => string
trimmed = "abcde".trimRight();
>trimmed = "abcde".trimRight() : string
>trimmed : string
>"abcde".trimRight() : string
>"abcde".trimRight : () => string
>"abcde" : "abcde"
>trimRight : () => string
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": ["es5","es2015.promise"], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"lib": ["es5","es2015.core"], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -1,7 +1,7 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
@@ -71,6 +71,24 @@ declare var mbp: Man & Bear;
pigify(mbp).oinks; // OK, mbp is treated as Pig
pigify(mbp).walks; // Ok, mbp is treated as Man
// Repros from #29815
interface ITest {
name: 'test'
}
const createTestAsync = (): Promise<ITest> => Promise.resolve().then(() => ({ name: 'test' }))
const createTest = (): ITest => {
return { name: 'test' }
}
declare function f1<T, U>(x: T | U): T | U;
declare function f2<T, U>(x: T & U): T & U;
let x1: string = f1('a');
let x2: string = f2('a');
//// [unionAndIntersectionInference1.js]
@@ -80,7 +98,7 @@ function destructure(something, haveValue, haveY) {
return something === y ? haveY(y) : haveValue(something);
}
var value = Math.random() > 0.5 ? 'hey!' : undefined;
var result = destructure(value, function (text) { return 'string'; }, function (y) { return 'other one'; }); // text: string, y: Y
var result = destructure(value, text => 'string', y => 'other one'); // text: string, y: Y
// Repro from #4212
function isVoid(value) {
return undefined;
@@ -107,7 +125,13 @@ function baz1(value) {
function get(x) {
return null; // just an example
}
var foo;
let foo;
get(foo).toUpperCase(); // Ok
pigify(mbp).oinks; // OK, mbp is treated as Pig
pigify(mbp).walks; // Ok, mbp is treated as Man
const createTestAsync = () => Promise.resolve().then(() => ({ name: 'test' }));
const createTest = () => {
return { name: 'test' };
};
let x1 = f1('a');
let x2 = f2('a');
@@ -50,7 +50,7 @@ function destructure<a, r>(
var value = Math.random() > 0.5 ? 'hey!' : <Y>undefined;
>value : Symbol(value, Decl(unionAndIntersectionInference1.ts, 12, 3))
>Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
>random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --))
>Y : Symbol(Y, Decl(unionAndIntersectionInference1.ts, 0, 0))
>undefined : Symbol(undefined)
@@ -201,3 +201,59 @@ pigify(mbp).walks; // Ok, mbp is treated as Man
>mbp : Symbol(mbp, Decl(unionAndIntersectionInference1.ts, 68, 11))
>walks : Symbol(Man.walks, Decl(unionAndIntersectionInference1.ts, 55, 15))
// Repros from #29815
interface ITest {
>ITest : Symbol(ITest, Decl(unionAndIntersectionInference1.ts, 71, 18))
name: 'test'
>name : Symbol(ITest.name, Decl(unionAndIntersectionInference1.ts, 75, 17))
}
const createTestAsync = (): Promise<ITest> => Promise.resolve().then(() => ({ name: 'test' }))
>createTestAsync : Symbol(createTestAsync, Decl(unionAndIntersectionInference1.ts, 79, 5))
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
>ITest : Symbol(ITest, Decl(unionAndIntersectionInference1.ts, 71, 18))
>Promise.resolve().then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --))
>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
>name : Symbol(name, Decl(unionAndIntersectionInference1.ts, 79, 77))
const createTest = (): ITest => {
>createTest : Symbol(createTest, Decl(unionAndIntersectionInference1.ts, 81, 5))
>ITest : Symbol(ITest, Decl(unionAndIntersectionInference1.ts, 71, 18))
return { name: 'test' }
>name : Symbol(name, Decl(unionAndIntersectionInference1.ts, 82, 10))
}
declare function f1<T, U>(x: T | U): T | U;
>f1 : Symbol(f1, Decl(unionAndIntersectionInference1.ts, 83, 1))
>T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 85, 20))
>U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 85, 22))
>x : Symbol(x, Decl(unionAndIntersectionInference1.ts, 85, 26))
>T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 85, 20))
>U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 85, 22))
>T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 85, 20))
>U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 85, 22))
declare function f2<T, U>(x: T & U): T & U;
>f2 : Symbol(f2, Decl(unionAndIntersectionInference1.ts, 85, 43))
>T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 86, 20))
>U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 86, 22))
>x : Symbol(x, Decl(unionAndIntersectionInference1.ts, 86, 26))
>T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 86, 20))
>U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 86, 22))
>T : Symbol(T, Decl(unionAndIntersectionInference1.ts, 86, 20))
>U : Symbol(U, Decl(unionAndIntersectionInference1.ts, 86, 22))
let x1: string = f1('a');
>x1 : Symbol(x1, Decl(unionAndIntersectionInference1.ts, 88, 3))
>f1 : Symbol(f1, Decl(unionAndIntersectionInference1.ts, 83, 1))
let x2: string = f2('a');
>x2 : Symbol(x2, Decl(unionAndIntersectionInference1.ts, 89, 3))
>f2 : Symbol(f2, Decl(unionAndIntersectionInference1.ts, 85, 43))
@@ -179,3 +179,56 @@ pigify(mbp).walks; // Ok, mbp is treated as Man
>mbp : Man & Bear
>walks : boolean
// Repros from #29815
interface ITest {
name: 'test'
>name : "test"
}
const createTestAsync = (): Promise<ITest> => Promise.resolve().then(() => ({ name: 'test' }))
>createTestAsync : () => Promise<ITest>
>(): Promise<ITest> => Promise.resolve().then(() => ({ name: 'test' })) : () => Promise<ITest>
>Promise.resolve().then(() => ({ name: 'test' })) : Promise<ITest | { name: "test"; }>
>Promise.resolve().then : <TResult1 = void, TResult2 = never>(onfulfilled?: (value: void) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
>Promise.resolve() : Promise<void>
>Promise.resolve : { <T>(value: T | PromiseLike<T>): Promise<T>; (): Promise<void>; }
>Promise : PromiseConstructor
>resolve : { <T>(value: T | PromiseLike<T>): Promise<T>; (): Promise<void>; }
>then : <TResult1 = void, TResult2 = never>(onfulfilled?: (value: void) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
>() => ({ name: 'test' }) : () => { name: "test"; }
>({ name: 'test' }) : { name: "test"; }
>{ name: 'test' } : { name: "test"; }
>name : "test"
>'test' : "test"
const createTest = (): ITest => {
>createTest : () => ITest
>(): ITest => { return { name: 'test' }} : () => ITest
return { name: 'test' }
>{ name: 'test' } : { name: "test"; }
>name : "test"
>'test' : "test"
}
declare function f1<T, U>(x: T | U): T | U;
>f1 : <T, U>(x: T | U) => T | U
>x : T | U
declare function f2<T, U>(x: T & U): T & U;
>f2 : <T, U>(x: T & U) => T & U
>x : T & U
let x1: string = f1('a');
>x1 : string
>f1('a') : "a"
>f1 : <T, U>(x: T | U) => T | U
>'a' : "a"
let x2: string = f2('a');
>x2 : string
>f2('a') : "a"
>f2 : <T, U>(x: T & U) => T & U
>'a' : "a"
@@ -87,7 +87,7 @@ num['0'] = 'ok'
const sym = Symbol()
>sym : Symbol(sym, Decl(unionTypeWithIndexSignature.ts, 18, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
type Both = { s: number, '0': number, [sym]: boolean } | { [n: number]: number, [s: string]: string | number }
>Both : Symbol(Both, Decl(unionTypeWithIndexSignature.ts, 18, 20))
@@ -2,15 +2,15 @@
// declarations with call initializer
const constCall = Symbol();
>constCall : Symbol(constCall, Decl(uniqueSymbols.ts, 1, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
let letCall = Symbol();
>letCall : Symbol(letCall, Decl(uniqueSymbols.ts, 2, 3))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
var varCall = Symbol();
>varCall : Symbol(varCall, Decl(uniqueSymbols.ts, 3, 3))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
// ambient declaration with type
declare const constType: unique symbol;
@@ -19,7 +19,7 @@ declare const constType: unique symbol;
// declaration with type and call initializer
const constTypeAndCall: unique symbol = Symbol();
>constTypeAndCall : Symbol(constTypeAndCall, Decl(uniqueSymbols.ts, 9, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
// declaration from initializer
const constInitToConstCall = constCall;
@@ -157,26 +157,26 @@ class C {
static readonly readonlyStaticCall = Symbol();
>readonlyStaticCall : Symbol(C.readonlyStaticCall, Decl(uniqueSymbols.ts, 60, 9))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
static readonly readonlyStaticType: unique symbol;
>readonlyStaticType : Symbol(C.readonlyStaticType, Decl(uniqueSymbols.ts, 61, 50))
static readonly readonlyStaticTypeAndCall: unique symbol = Symbol();
>readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbols.ts, 62, 54))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
static readwriteStaticCall = Symbol();
>readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbols.ts, 63, 72))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
readonly readonlyCall = Symbol();
>readonlyCall : Symbol(C.readonlyCall, Decl(uniqueSymbols.ts, 64, 42))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
readwriteCall = Symbol();
>readwriteCall : Symbol(C.readwriteCall, Decl(uniqueSymbols.ts, 66, 37))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
}
declare const c: C;
>c : Symbol(c, Decl(uniqueSymbols.ts, 69, 13))
@@ -2,15 +2,15 @@
// declarations with call initializer
const constCall = Symbol();
>constCall : Symbol(constCall, Decl(uniqueSymbolsDeclarations.ts, 1, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
let letCall = Symbol();
>letCall : Symbol(letCall, Decl(uniqueSymbolsDeclarations.ts, 2, 3))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
var varCall = Symbol();
>varCall : Symbol(varCall, Decl(uniqueSymbolsDeclarations.ts, 3, 3))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
// ambient declaration with type
declare const constType: unique symbol;
@@ -19,7 +19,7 @@ declare const constType: unique symbol;
// declaration with type and call initializer
const constTypeAndCall: unique symbol = Symbol();
>constTypeAndCall : Symbol(constTypeAndCall, Decl(uniqueSymbolsDeclarations.ts, 9, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
// declaration from initializer
const constInitToConstCall = constCall;
@@ -152,26 +152,26 @@ class C {
static readonly readonlyStaticCall = Symbol();
>readonlyStaticCall : Symbol(C.readonlyStaticCall, Decl(uniqueSymbolsDeclarations.ts, 56, 9))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
static readonly readonlyStaticType: unique symbol;
>readonlyStaticType : Symbol(C.readonlyStaticType, Decl(uniqueSymbolsDeclarations.ts, 57, 50))
static readonly readonlyStaticTypeAndCall: unique symbol = Symbol();
>readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbolsDeclarations.ts, 58, 54))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
static readwriteStaticCall = Symbol();
>readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbolsDeclarations.ts, 59, 72))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
readonly readonlyCall = Symbol();
>readonlyCall : Symbol(C.readonlyCall, Decl(uniqueSymbolsDeclarations.ts, 60, 42))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
readwriteCall = Symbol();
>readwriteCall : Symbol(C.readwriteCall, Decl(uniqueSymbolsDeclarations.ts, 62, 37))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
}
declare const c: C;
>c : Symbol(c, Decl(uniqueSymbolsDeclarations.ts, 65, 13))
@@ -238,5 +238,5 @@ declare const invalidIntersection: unique symbol | unique symbol;
// https://github.com/Microsoft/TypeScript/issues/21584
const shouldNotBeAssignable: string = Symbol();
>shouldNotBeAssignable : Symbol(shouldNotBeAssignable, Decl(uniqueSymbolsErrors.ts, 86, 5))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --))
@@ -1,16 +1,16 @@
Exit Code: 1
Standard output:
../../../../built/local/lib.dom.d.ts(2388,11): error TS2300: Duplicate identifier 'CSSRule'.
../../../../built/local/lib.dom.d.ts(2407,13): error TS2300: Duplicate identifier 'CSSRule'.
../../../../built/local/lib.dom.d.ts(3267,11): error TS2300: Duplicate identifier 'Comment'.
../../../../built/local/lib.dom.d.ts(3270,13): error TS2300: Duplicate identifier 'Comment'.
../../../../built/local/lib.dom.d.ts(4963,11): error TS2300: Duplicate identifier 'Event'.
../../../../built/local/lib.dom.d.ts(5023,13): error TS2300: Duplicate identifier 'Event'.
../../../../built/local/lib.dom.d.ts(11214,11): error TS2300: Duplicate identifier 'Position'.
../../../../built/local/lib.dom.d.ts(11959,11): error TS2300: Duplicate identifier 'Request'.
../../../../built/local/lib.dom.d.ts(12039,13): error TS2300: Duplicate identifier 'Request'.
../../../../built/local/lib.dom.d.ts(16513,11): error TS2300: Duplicate identifier 'Window'.
../../../../built/local/lib.dom.d.ts(16644,13): error TS2300: Duplicate identifier 'Window'.
../../../../built/local/lib.dom.d.ts(2439,11): error TS2300: Duplicate identifier 'CSSRule'.
../../../../built/local/lib.dom.d.ts(2458,13): error TS2300: Duplicate identifier 'CSSRule'.
../../../../built/local/lib.dom.d.ts(3339,11): error TS2300: Duplicate identifier 'Comment'.
../../../../built/local/lib.dom.d.ts(3342,13): error TS2300: Duplicate identifier 'Comment'.
../../../../built/local/lib.dom.d.ts(5032,11): error TS2300: Duplicate identifier 'Event'.
../../../../built/local/lib.dom.d.ts(5092,13): error TS2300: Duplicate identifier 'Event'.
../../../../built/local/lib.dom.d.ts(11453,11): error TS2300: Duplicate identifier 'Position'.
../../../../built/local/lib.dom.d.ts(12214,11): error TS2300: Duplicate identifier 'Request'.
../../../../built/local/lib.dom.d.ts(12294,13): error TS2300: Duplicate identifier 'Request'.
../../../../built/local/lib.dom.d.ts(16941,11): error TS2300: Duplicate identifier 'Window'.
../../../../built/local/lib.dom.d.ts(17073,13): error TS2300: Duplicate identifier 'Window'.
../../../../built/local/lib.es5.d.ts(1416,11): error TS2300: Duplicate identifier 'ArrayLike'.
../../../../built/local/lib.es5.d.ts(1452,6): error TS2300: Duplicate identifier 'Record'.
../../../../node_modules/@types/node/index.d.ts(150,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{}', but here has type 'NodeModule'.
@@ -158,7 +158,7 @@ node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.
node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(391,50): error TS2345: Argument of type '0' is not assignable to parameter of type 'string'.
node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(393,50): error TS2345: Argument of type '-1' is not assignable to parameter of type 'string'.
node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(396,27): error TS2339: Property 'focus' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(447,26): error TS2339: Property 'breadcrumb' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(447,26): error TS2339: Property 'breadcrumb' does not exist on type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(457,30): error TS2339: Property 'breadcrumb' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(473,24): error TS2694: Namespace 'Protocol' has no exported member 'Accessibility'.
node_modules/chrome-devtools-frontend/front_end/accessibility/AXBreadcrumbsPane.js(481,17): error TS2339: Property 'setTextContentTruncatedIfNeeded' does not exist on type 'Element'.
@@ -699,10 +699,6 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(9093,1): error TS2554: Expected 0-2 arguments, but got 3.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(9117,1): error TS2554: Expected 0-2 arguments, but got 3.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(9467,15): error TS2339: Property 'axe' does not exist on type 'Window'.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(9708,34): error TS2345: Argument of type 'any[][]' is not assignable to parameter of type 'readonly [any, any][]'.
Type 'any[]' is missing the following properties from type '[any, any]': 0, 1
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(9948,10): error TS2693: 'ShadowRoot' only refers to a type, but is being used as a value here.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(9969,4): error TS2693: 'ShadowRoot' only refers to a type, but is being used as a value here.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(10092,16): error TS2304: Cannot find name 'd41d8cd98f00b204e9800998ecf8427e_LibraryDetectorTests'.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(10513,19): error TS2488: Type 'NodeListOf<Element>' must have a '[Symbol.iterator]()' method that returns an iterator.
node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(10811,19): error TS2304: Cannot find name 'getElementsInDocument'.
@@ -3755,6 +3751,7 @@ node_modules/chrome-devtools-frontend/front_end/common/ParsedURL.js(152,25): err
node_modules/chrome-devtools-frontend/front_end/common/ParsedURL.js(161,25): error TS2339: Property 'asParsedURL' does not exist on type 'string'.
node_modules/chrome-devtools-frontend/front_end/common/ParsedURL.js(211,34): error TS2339: Property 'asParsedURL' does not exist on type 'string'.
node_modules/chrome-devtools-frontend/front_end/common/ParsedURL.js(215,29): error TS2339: Property 'asParsedURL' does not exist on type 'string'.
node_modules/chrome-devtools-frontend/front_end/common/ParsedURL.js(318,32): error TS2554: Expected 0 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/common/ParsedURL.js(375,18): error TS2339: Property 'asParsedURL' does not exist on type 'String'.
node_modules/chrome-devtools-frontend/front_end/common/SegmentedRange.js(48,37): error TS2339: Property 'lowerBound' does not exist on type 'Segment[]'.
node_modules/chrome-devtools-frontend/front_end/common/Settings.js(49,10): error TS2339: Property 'runtime' does not exist on type 'Window'.
@@ -3906,6 +3903,7 @@ node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.j
node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(192,22): error TS2694: Namespace 'Common' has no exported member 'Event'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(200,22): error TS2694: Namespace 'Common' has no exported member 'Event'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(255,28): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(256,27): error TS2554: Expected 0 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(257,31): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(264,13): error TS2339: Property 'style' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(279,14): error TS2555: Expected at least 2 arguments, but got 1.
@@ -3981,7 +3979,7 @@ node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(107,9)
node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(111,9): error TS2339: Property 'ConsoleSidebar' does not exist on type '{ new (): Console; prototype: Console; }'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(119,47): error TS2339: Property 'createChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(122,25): error TS2345: Argument of type 'Element' is not assignable to parameter of type 'Icon'.
Type 'Element' is missing the following properties from type 'Icon': createdCallback, _descriptor, _spriteSheet, _iconType, and 116 more.
Type 'Element' is missing the following properties from type 'Icon': createdCallback, _descriptor, _spriteSheet, _iconType, and 117 more.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(133,9): error TS2339: Property 'ConsoleSidebar' does not exist on type '{ new (): Console; prototype: Console; }'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(147,27): error TS2322: Type 'Element' is not assignable to type 'Icon'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(177,60): error TS2555: Expected at least 2 arguments, but got 1.
@@ -4184,6 +4182,7 @@ node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(70
node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(733,19): error TS2339: Property 'removeChildren' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(735,35): error TS2339: Property 'createChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(736,31): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(750,27): error TS2554: Expected 0 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(803,34): error TS2339: Property 'style' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(804,31): error TS2339: Property 'style' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/console/ConsoleViewMessage.js(806,43): error TS2339: Property 'style' does not exist on type 'Element'.
@@ -4521,6 +4520,7 @@ node_modules/chrome-devtools-frontend/front_end/data_grid/DataGrid.js(98,48): er
node_modules/chrome-devtools-frontend/front_end/data_grid/DataGrid.js(109,26): error TS2352: Conversion of type 'DataGridNode<any>' to type 'NODE_TYPE' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
node_modules/chrome-devtools-frontend/front_end/data_grid/DataGrid.js(121,17): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/chrome-devtools-frontend/front_end/data_grid/DataGrid.js(123,17): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/chrome-devtools-frontend/front_end/data_grid/DataGrid.js(134,29): error TS2554: Expected 0 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/data_grid/DataGrid.js(135,15): error TS2339: Property 'title' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/data_grid/DataGrid.js(139,15): error TS2339: Property 'title' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/data_grid/DataGrid.js(159,33): error TS2694: Namespace 'DataGrid.DataGrid' has no exported member 'ColumnDescriptor'.
@@ -5065,8 +5065,6 @@ node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(25
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(253,61): error TS2339: Property 'host' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(254,17): error TS2339: Property 'host' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(261,16): error TS2339: Property 'getComponentSelection' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(265,28): error TS2693: 'ShadowRoot' only refers to a type, but is being used as a value here.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(265,48): error TS2339: Property 'getSelection' does not exist on type 'Node & ParentNode'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(265,70): error TS2339: Property 'window' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(271,16): error TS2339: Property 'hasSelection' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(273,23): error TS2339: Property 'querySelectorAll' does not exist on type 'Node'.
@@ -5149,7 +5147,7 @@ node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(74
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(745,48): error TS2339: Property 'pageX' does not exist on type 'Event'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(745,60): error TS2339: Property 'pageY' does not exist on type 'Event'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(753,20): error TS2339: Property 'deepElementFromPoint' does not exist on type 'Document'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(761,5): error TS2740: Type 'ShadowRoot' is missing the following properties from type 'Document': URL, alinkColor, all, anchors, and 169 more.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(761,5): error TS2740: Type 'ShadowRoot' is missing the following properties from type 'Document': URL, alinkColor, all, anchors, and 174 more.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(766,28): error TS2339: Property 'deepElementFromPoint' does not exist on type 'DocumentFragment'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(766,70): error TS2339: Property 'deepElementFromPoint' does not exist on type 'Document'.
node_modules/chrome-devtools-frontend/front_end/dom_extension/DOMExtension.js(771,20): error TS2339: Property 'deepActiveElement' does not exist on type 'Document'.
@@ -5367,7 +5365,7 @@ node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(575,10): error TS2339: Property 'style' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(576,10): error TS2339: Property 'style' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(580,10): error TS2339: Property 'scrollIntoViewIfNeeded' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(592,20): error TS2339: Property 'classList' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(592,20): error TS2339: Property 'classList' does not exist on type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(600,41): error TS2339: Property 'isAncestor' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(632,27): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(655,26): error TS2339: Property 'getComponentSelection' does not exist on type 'Element'.
@@ -5377,7 +5375,6 @@ node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(738,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(739,14): error TS7014: Function type, which lacks return-type annotation, implicitly has an 'any' return type.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(762,13): error TS2339: Property 'style' does not exist on type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(763,7): error TS2739: Type 'Node' is missing the following properties from type 'ChildNode': after, before, remove, replaceWith
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(767,32): error TS2339: Property 'style' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(772,10): error TS2339: Property 'runtime' does not exist on type 'Window'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(796,24): error TS2339: Property 'setMultilineEditing' does not exist on type 'TreeOutline'.
@@ -5385,7 +5382,6 @@ node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(803,60): error TS2339: Property 'visibleWidth' does not exist on type 'TreeOutline'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(828,34): error TS2339: Property 'style' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(832,15): error TS2339: Property 'style' does not exist on type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(833,9): error TS2322: Type 'Node' is not assignable to type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(837,26): error TS2339: Property 'setMultilineEditing' does not exist on type 'TreeOutline'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(851,18): error TS2339: Property 'altKey' does not exist on type 'Event'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeElement.js(851,35): error TS2339: Property 'shiftKey' does not exist on type 'Event'.
@@ -5466,7 +5462,7 @@ node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(755,33): error TS2339: Property 'enclosingNodeOrSelfWithClass' does not exist on type 'EventTarget'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(758,36): error TS2339: Property 'enclosingNodeOrSelfWithClass' does not exist on type 'EventTarget'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(813,22): error TS2339: Property 'index' does not exist on type 'DOMNode'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(920,9): error TS2740: Type 'Node & ParentNode' is missing the following properties from type 'Element': assignedSlot, attributes, classList, className, and 63 more.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(920,9): error TS2740: Type 'Node & ParentNode' is missing the following properties from type 'Element': assignedSlot, attributes, classList, className, and 64 more.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(930,13): error TS2339: Property 'type' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(1010,22): error TS2694: Namespace 'Common' has no exported member 'Event'.
node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(1025,22): error TS2694: Namespace 'Common' has no exported member 'Event'.
@@ -5658,14 +5654,13 @@ node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(10
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1040,69): error TS2339: Property 'selectorText' does not exist on type 'CSSRule'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1055,24): error TS2339: Property '_section' does not exist on type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1056,29): error TS2339: Property '_section' does not exist on type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1057,7): error TS2322: Type 'Node' is not assignable to type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1073,24): error TS2339: Property '_section' does not exist on type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1074,29): error TS2339: Property '_section' does not exist on type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1075,7): error TS2322: Type 'Node' is not assignable to type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1087,7): error TS2740: Type 'Node' is missing the following properties from type 'Element': assignedSlot, attributes, classList, className, and 71 more.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1075,7): error TS2739: Type 'Node' is missing the following properties from type 'ChildNode': after, before, remove, replaceWith
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1087,7): error TS2740: Type 'ChildNode' is missing the following properties from type 'Element': assignedSlot, attributes, classList, className, and 68 more.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1088,38): error TS2339: Property '_section' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1090,36): error TS2339: Property '_section' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1099,7): error TS2322: Type 'Node' is not assignable to type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1099,7): error TS2740: Type 'Node' is missing the following properties from type 'Element': assignedSlot, attributes, classList, className, and 72 more.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1100,38): error TS2339: Property '_section' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1102,36): error TS2339: Property '_section' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1106,22): error TS2694: Namespace 'Common' has no exported member 'Event'.
@@ -6143,7 +6138,6 @@ node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(13
node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(161,5): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(219,43): error TS2694: Namespace 'Protocol' has no exported member 'Network'.
node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(244,54): error TS2339: Property 'traverseNextNode' does not exist on type 'HTMLElement'.
node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(245,27): error TS2693: 'ShadowRoot' only refers to a type, but is being used as a value here.
node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(463,53): error TS2345: Argument of type '{ url: string; type: string; }' is not assignable to parameter of type '{ contentURL(): string; contentType(): ResourceType; contentEncoded(): Promise<boolean>; requestContent(): Promise<string>; searchInContent(query: string, caseSensitive: boolean, isRegex: boolean): Promise<...>; }'.
Type '{ url: string; type: string; }' is missing the following properties from type '{ contentURL(): string; contentType(): ResourceType; contentEncoded(): Promise<boolean>; requestContent(): Promise<string>; searchInContent(query: string, caseSensitive: boolean, isRegex: boolean): Promise<...>; }': contentURL, contentType, contentEncoded, requestContent, searchInContent
node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(471,22): error TS2339: Property 'valuesArray' does not exist on type 'Map<string, { contentURL(): string; contentType(): ResourceType; contentEncoded(): Promise<boolean>; requestContent(): Promise<string>; searchInContent(query: string, caseSensitive: boolean, isRegex: boolean): Promise<...>; }>'.
@@ -6927,7 +6921,6 @@ node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(852
node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(858,13): error TS2339: Property 'image' does not exist on type 'WebGLTexture'.
node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(861,81): error TS2339: Property 'image' does not exist on type 'WebGLTexture'.
node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(928,26): error TS2694: Namespace 'SDK' has no exported member 'SnapshotWithRect'.
node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(932,39): error TS2345: Argument of type 'any[][]' is not assignable to parameter of type 'readonly [any, any][]'.
node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(1080,24): error TS2694: Namespace 'Protocol' has no exported member 'DOM'.
node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(1098,15): error TS2304: Cannot find name 'CSSMatrix'.
node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(1143,19): error TS2694: Namespace 'SDK' has no exported member 'SnapshotWithRect'.
@@ -7762,6 +7755,7 @@ node_modules/chrome-devtools-frontend/front_end/object_ui/JavaScriptAutocomplete
node_modules/chrome-devtools-frontend/front_end/object_ui/JavaScriptAutocomplete.js(471,33): error TS2339: Property 'CompletionGroup' does not exist on type 'typeof JavaScriptAutocomplete'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPopoverHelper.js(82,35): error TS2694: Namespace 'SDK.DebuggerModel' has no exported member 'FunctionDetails'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPopoverHelper.js(91,29): error TS2339: Property 'createChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPopoverHelper.js(108,23): error TS2554: Expected 0 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPopoverHelper.js(114,48): error TS2339: Property 'createChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPopoverHelper.js(129,7): error TS2722: Cannot invoke an object which is possibly 'undefined'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPopoverHelper.js(145,50): error TS2339: Property 'createChild' does not exist on type 'Element'.
@@ -7774,6 +7768,7 @@ node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSectio
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(181,18): error TS2339: Property 'title' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(207,22): error TS2339: Property 'createChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(209,22): error TS2339: Property 'createTextChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(209,38): error TS2554: Expected 0 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(211,22): error TS2339: Property 'createTextChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(263,20): error TS2339: Property 'title' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/object_ui/ObjectPropertiesSection.js(268,22): error TS2339: Property 'setTextContentTruncatedIfNeeded' does not exist on type 'Element'.
@@ -8059,8 +8054,8 @@ node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(189,25):
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(196,23): error TS2339: Property '_labelElement' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(199,15): error TS2339: Property 'style' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(200,23): error TS2339: Property 'style' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(210,7): error TS2322: Type 'Node' is not assignable to type 'Element'.
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(215,7): error TS2322: Type 'Node' is not assignable to type 'Element'.
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(210,7): error TS2322: Type 'ChildNode' is not assignable to type 'Element'.
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(215,7): error TS2322: Type 'ChildNode' is not assignable to type 'Element'.
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(267,21): error TS2339: Property 'DividersData' does not exist on type 'typeof TimelineGrid'.
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(277,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/chrome-devtools-frontend/front_end/perf_ui/TimelineGrid.js(284,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
@@ -8253,6 +8248,7 @@ node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(125,15): e
node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(125,39): error TS2339: Property 'regexSpecialCharacters' does not exist on type 'StringConstructor'.
node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(132,8): error TS2339: Property 'filterRegex' does not exist on type 'StringConstructor'.
node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(133,27): error TS2339: Property 'regexSpecialCharacters' does not exist on type 'StringConstructor'.
node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(198,1): error TS2322: Type '(maxLength: number) => string' is not assignable to type '() => string'.
node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(250,8): error TS2339: Property 'hashCode' does not exist on type 'StringConstructor'.
node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(275,8): error TS2339: Property 'isDigitAt' does not exist on type 'StringConstructor'.
node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(320,8): error TS2339: Property 'naturalOrderComparator' does not exist on type 'StringConstructor'.
@@ -8343,7 +8339,212 @@ node_modules/chrome-devtools-frontend/front_end/product_registry/ProductRegistry
node_modules/chrome-devtools-frontend/front_end/product_registry/ProductRegistry.js(34,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value.
node_modules/chrome-devtools-frontend/front_end/product_registry/ProductRegistry.js(55,41): error TS2694: Namespace 'ProductRegistry.Registry' has no exported member 'ProductEntry'.
node_modules/chrome-devtools-frontend/front_end/product_registry/ProductRegistry.js(72,26): error TS2339: Property 'ProductEntry' does not exist on type 'typeof Registry'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1488,1): error TS2590: Expression produces a union type that is too complex to represent.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1559,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1563,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1604,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1605,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1606,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1865,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2136,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2136,64): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2136,86): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2208,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2269,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2270,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2322,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2323,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2503,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2856,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2857,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2858,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2859,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2860,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2861,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2862,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2863,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2864,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2865,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3126,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3572,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3573,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3574,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3575,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3576,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3747,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3748,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3770,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3771,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3772,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3773,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3774,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3775,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3776,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3780,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3819,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3826,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3873,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3874,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3957,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3958,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4068,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4069,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4138,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4139,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4203,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4230,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4260,104): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4264,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4265,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4266,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4312,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4480,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4832,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4833,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4834,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4835,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5127,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5137,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5159,70): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5175,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5186,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5202,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5249,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5522,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5523,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5524,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5525,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5539,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5565,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5612,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5613,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5614,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5615,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5616,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5617,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5618,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5619,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5684,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5789,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5820,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5852,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5858,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5859,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5860,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5970,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5971,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5972,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6145,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6151,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6152,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6153,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6154,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6180,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6181,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6182,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6183,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6184,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6185,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6186,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6187,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6193,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6194,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6195,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6196,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6197,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6198,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6199,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6217,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6218,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6225,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6227,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6228,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6229,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6230,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6231,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6232,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6233,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6243,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6270,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6272,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6276,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6294,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6296,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6297,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6298,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6299,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6300,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6303,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6305,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6323,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6324,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6325,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6326,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6327,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6333,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6334,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6335,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6336,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6337,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6338,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6339,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6340,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6341,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6342,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6343,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6344,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6345,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6346,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6347,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6348,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6349,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6350,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6351,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6360,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6361,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6362,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6363,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6364,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6365,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6369,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6382,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6388,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6389,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6404,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6405,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6406,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6425,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6441,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6442,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6445,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6481,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6521,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6560,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6573,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6574,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6575,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6576,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6577,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6578,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6579,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6580,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6581,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6582,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6583,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6615,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6620,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6629,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6637,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6661,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6668,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6675,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6689,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6690,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6699,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6726,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6735,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6737,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6738,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6741,42): error TS2741: Property 'type' is missing in type '{ "product": number; }' but required in type '{ product: number; type: number; }'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryImpl.js(27,41): error TS2694: Namespace 'ProductRegistry.Registry' has no exported member 'ProductEntry'.
node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryImpl.js(103,67): error TS2694: Namespace 'ProductRegistry.Registry' has no exported member 'ProductEntry'.
node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(83,15): error TS2339: Property '_remainingNodeInfos' does not exist on type 'ProfileDataGridNode'.
@@ -8772,8 +8973,6 @@ node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(57,23):
node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(78,46): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(79,46): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(80,45): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(84,17): error TS2345: Argument of type '(string | Element)[][]' is not assignable to parameter of type 'readonly [any, any][]'.
Type '(string | Element)[]' is missing the following properties from type '[any, any]': 0, 1
node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(136,59): error TS2339: Property 'profile' does not exist on type 'ProfileView'.
node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(136,78): error TS2339: Property 'adjustedTotal' does not exist on type 'ProfileView'.
node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(147,59): error TS2339: Property 'profile' does not exist on type 'ProfileView'.
@@ -10730,7 +10929,6 @@ node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(54,59):
node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(73,28): error TS2339: Property 'setSearchRegex' does not exist on type 'TreeElement'.
node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(80,23): error TS2339: Property 'setSearchRegex' does not exist on type 'TreeElement'.
node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(223,35): error TS2339: Property 'childElementCount' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(242,7): error TS2322: Type 'Node' is not assignable to type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(290,24): error TS2339: Property 'tagName' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(296,31): error TS2339: Property 'attributes' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/source_frame/XMLView.js(305,20): error TS2339: Property 'childElementCount' does not exist on type 'Node'.
@@ -10860,9 +11058,8 @@ node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSid
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(80,71): error TS2339: Property 'uiLocation' does not exist on type 'V'.
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(81,60): error TS2339: Property 'breakpoint' does not exist on type 'V'.
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(82,62): error TS2339: Property 'breakpoint' does not exist on type 'V'.
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(87,7): error TS2322: Type 'Node' is not assignable to type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(92,7): error TS2322: Type 'Node' is not assignable to type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(119,5): error TS2322: Type 'Promise<string>' is not assignable to type 'Promise<undefined>'.
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(131,38): error TS2554: Expected 0 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(141,29): error TS2339: Property 'enclosingNodeOrSelfWithClass' does not exist on type 'EventTarget'.
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(156,33): error TS2339: Property 'checkboxElement' does not exist on type 'EventTarget'.
node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(159,11): error TS2339: Property 'consume' does not exist on type 'Event'.
@@ -11345,8 +11542,6 @@ node_modules/chrome-devtools-frontend/front_end/sources_test_runner/SourcesTestR
node_modules/chrome-devtools-frontend/front_end/sources_test_runner/SourcesTestRunner.js(129,11): error TS2339: Property 'pushAll' does not exist on type 'any[]'.
node_modules/chrome-devtools-frontend/front_end/terminal/TerminalWidget.js(29,54): error TS2339: Property 'createChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/terminal/TerminalWidget.js(30,65): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/terminal/TerminalWidget.js(139,9): error TS2322: Type 'Node' is not assignable to type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/terminal/TerminalWidget.js(146,7): error TS2322: Type 'Node' is not assignable to type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/addons/fit/fit.js(19,34): error TS2307: Cannot find module '../../xterm'.
node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/addons/fit/fit.js(20,21): error TS2304: Cannot find name 'define'.
node_modules/chrome-devtools-frontend/front_end/terminal/xterm.js/addons/fit/fit.js(24,5): error TS2304: Cannot find name 'define'.
@@ -11500,7 +11695,6 @@ node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(683,28
node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(717,24): error TS2694: Namespace 'TestRunner' has no exported member 'CustomFormatters'.
node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(748,24): error TS2694: Namespace 'TestRunner' has no exported member 'CustomFormatters'.
node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(777,22): error TS2339: Property 'attributes' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(783,46): error TS2322: Type 'Node' is not assignable to type 'ChildNode'.
node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(785,14): error TS2339: Property 'shadowRoot' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(786,39): error TS2339: Property 'shadowRoot' does not exist on type 'Node'.
node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(805,12): error TS2339: Property 'shadowRoot' does not exist on type 'Node'.
@@ -11742,7 +11936,7 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelineEventOverview.j
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineEventOverview.js(246,68): error TS2339: Property 'peekLast' does not exist on type 'any[]'.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineEventOverview.js(248,81): error TS2339: Property '_overviewIndex' does not exist on type 'TimelineCategory'.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineEventOverview.js(384,7): error TS2322: Type 'Promise<new (width?: number, height?: number) => HTMLImageElement>' is not assignable to type 'Promise<HTMLImageElement>'.
Type 'new (width?: number, height?: number) => HTMLImageElement' is missing the following properties from type 'HTMLImageElement': align, alt, border, complete, and 259 more.
Type 'new (width?: number, height?: number) => HTMLImageElement' is missing the following properties from type 'HTMLImageElement': align, alt, border, complete, and 261 more.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineEventOverview.js(457,17): error TS2339: Property 'createChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineEventOverview.js(483,24): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineEventOverview.js(524,28): error TS2339: Property 'peekLast' does not exist on type 'TimelineFrame[]'.
@@ -12252,7 +12446,7 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1652
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1657,64): error TS2345: Argument of type 'new (width?: number, height?: number) => HTMLImageElement' is not assignable to parameter of type 'Node'.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1664,11): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1665,67): error TS2555: Expected at least 2 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1675,5): error TS2740: Type 'DocumentFragment' is missing the following properties from type 'Element': assignedSlot, attributes, classList, className, and 63 more.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1675,5): error TS2740: Type 'DocumentFragment' is missing the following properties from type 'Element': assignedSlot, attributes, classList, className, and 64 more.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1684,30): error TS2339: Property 'millisToString' does not exist on type 'NumberConstructor'.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1685,16): error TS2339: Property 'millisToString' does not exist on type 'NumberConstructor'.
node_modules/chrome-devtools-frontend/front_end/timeline/TimelineUIUtils.js(1687,13): error TS2339: Property 'createTextChild' does not exist on type 'Element'.
@@ -13027,7 +13221,7 @@ node_modules/chrome-devtools-frontend/front_end/ui/TextPrompt.js(592,35): error
node_modules/chrome-devtools-frontend/front_end/ui/TextPrompt.js(601,32): error TS2339: Property 'isAncestor' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/ui/TextPrompt.js(610,54): error TS2339: Property 'isAncestor' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/ui/TextPrompt.js(622,35): error TS2339: Property 'getComponentSelection' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/ui/TextPrompt.js(627,7): error TS2740: Type 'ChildNode' is missing the following properties from type 'Element': assignedSlot, attributes, classList, className, and 67 more.
node_modules/chrome-devtools-frontend/front_end/ui/TextPrompt.js(627,7): error TS2322: Type 'ChildNode' is not assignable to type 'Element'.
node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(43,50): error TS2339: Property 'createChild' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(48,45): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'.
node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(75,24): error TS2694: Namespace 'Common' has no exported member 'Event'.
@@ -13213,6 +13407,7 @@ node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1561,11): error TS
node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1562,17): error TS2339: Property 'value' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1570,25): error TS2339: Property 'value' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1574,11): error TS2339: Property 'value' does not exist on type 'Element'.
node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1633,64): error TS2554: Expected 0 arguments, but got 1.
node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1646,40): error TS2339: Property '_textWidthCache' does not exist on type '(context: CanvasRenderingContext2D, text: string) => number'.
node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1649,25): error TS2339: Property '_textWidthCache' does not exist on type '(context: CanvasRenderingContext2D, text: string) => number'.
node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(1715,20): error TS2339: Property 'type' does not exist on type 'Element'.
+2 -2
View File
@@ -802,9 +802,9 @@ node_modules/npm/lib/utils/error-handler.js(146,27): error TS2339: Property 'con
node_modules/npm/lib/utils/error-handler.js(166,14): error TS2339: Property 'code' does not exist on type 'Error'.
node_modules/npm/lib/utils/error-handler.js(167,16): error TS2339: Property 'code' does not exist on type 'Error'.
node_modules/npm/lib/utils/error-handler.js(168,8): error TS2339: Property 'code' does not exist on type 'Error'.
node_modules/npm/lib/utils/error-handler.js(186,40): error TS2345: Argument of type '{ (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | ... 1 more ... | undefined): string; }' is not assignable to parameter of type '(value: string, index: number, array: string[]) => string'.
node_modules/npm/lib/utils/error-handler.js(186,40): error TS2345: Argument of type '{ (value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | ... 1 more ... | undefined): string; }' is not assignable to parameter of type '(value: string, index: number, array: string[]) => string'.
Types of parameters 'replacer' and 'index' are incompatible.
Type 'number' is not assignable to type '((key: string, value: any) => any) | undefined'.
Type 'number' is not assignable to type '((this: any, key: string, value: any) => any) | undefined'.
node_modules/npm/lib/utils/error-handler.js(188,33): error TS2339: Property 'version' does not exist on type 'typeof EventEmitter'.
node_modules/npm/lib/utils/error-handler.js(205,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'.
node_modules/npm/lib/utils/error-handler.js(208,18): error TS2339: Property 'code' does not exist on type 'Error'.
+1 -1
View File
@@ -1,4 +1,4 @@
// @lib: esnext
// @lib: es2019
const array: number[] = [];
const readonlyArray: ReadonlyArray<number> = [];
@@ -0,0 +1,9 @@
// @declaration: true
// @filename: a.ts
interface I {}
export function f(): I { return null as I; }
// @filename: b.ts
import {f} from "./a";
export function q() {}
q.val = f();
+1 -1
View File
@@ -10,4 +10,4 @@ declare function shouldBeIdentity<T, U>(p: DoNothingAlias<T, U>): MyPromise<T, U
declare const p1: MyPromise<boolean, any>;
var p2 = shouldBeIdentity(p1);
var p2: MyPromise<boolean, {}>;
var p2: MyPromise<boolean, any>;
+7
View File
@@ -0,0 +1,7 @@
// @target: es2019
var trimmed: string;
trimmed = "abcde".trimEnd();
trimmed = "abcde".trimStart();
trimmed = "abcde".trimLeft();
trimmed = "abcde".trimRight();
@@ -1,8 +1,8 @@
// @target: esnext
// @target: es2019
function f() {
try { } catch { }
try { } catch {
try { } catch { }
}
try { } catch { } finally { }
}
}
@@ -1,6 +1,8 @@
// @strict: true
// @declaration: true
// #27118: Conditional types are now invariant in the check type.
interface Covariant<T> {
foo: T extends string ? T : number;
}
@@ -14,13 +16,13 @@ interface Invariant<T> {
}
function f1<A, B extends A>(a: Covariant<A>, b: Covariant<B>) {
a = b;
a = b; // Error
b = a; // Error
}
function f2<A, B extends A>(a: Contravariant<A>, b: Contravariant<B>) {
a = b; // Error
b = a;
b = a; // Error
}
function f3<A, B extends A>(a: Invariant<A>, b: Invariant<B>) {
@@ -78,38 +80,6 @@ function f21<T>(x: Extract<Extract<T, Foo>, Bar>, y: Extract<T, Foo & Bar>, z: E
fooBat(z); // Error
}
// Repros from #22860
class Opt<T> {
toVector(): Vector<T> {
return <any>undefined;
}
}
interface Seq<T> {
tail(): Opt<Seq<T>>;
}
class Vector<T> implements Seq<T> {
tail(): Opt<Vector<T>> {
return <any>undefined;
}
partition2<U extends T>(predicate:(v:T)=>v is U): [Vector<U>,Vector<Exclude<T, U>>];
partition2(predicate:(x:T)=>boolean): [Vector<T>,Vector<T>];
partition2<U extends T>(predicate:(v:T)=>boolean): [Vector<U>,Vector<any>] {
return <any>undefined;
}
}
interface A1<T> {
bat: B1<A1<T>>;
}
interface B1<T> extends A1<T> {
bat: B1<B1<T>>;
boom: T extends any ? true : true
}
// Repro from #22899
declare function toString1(value: object | Function): string ;
@@ -190,3 +160,22 @@ type ProductComplementComplement = {
};
type PCCA = ProductComplementComplement['a'];
type PCCB = ProductComplementComplement['b'];
// Repros from #27118
type MyElement<A> = [A] extends [[infer E]] ? E : never;
function oops<A, B extends A>(arg: MyElement<A>): MyElement<B> {
return arg; // Unsound, should be error
}
type MyAcceptor<A> = [A] extends [[infer E]] ? (arg: E) => void : never;
function oops2<A, B extends A>(arg: MyAcceptor<B>): MyAcceptor<A> {
return arg; // Unsound, should be error
}
type Dist<T> = T extends number ? number : string;
type Aux<A extends { a: unknown }> = A["a"] extends number ? number : string;
type Nondist<T> = Aux<{a: T}>;
function oops3<T>(arg: Dist<T>): Nondist<T> {
return arg; // Unsound, should be error
}
@@ -152,4 +152,31 @@ var g2 = applySpec({ foo: { bar: { baz: (x: any) => true } } });
const foo = <T>(object: T, partial: Partial<T>) => object;
let o = {a: 5, b: 7};
foo(o, {b: 9});
o = foo(o, {b: 9});
o = foo(o, {b: 9});
// Inferring to { [P in K]: X }, where K extends keyof T, produces same inferences as
// inferring to { [P in keyof T]: X }.
declare function f20<T, K extends keyof T>(obj: Pick<T, K>): T;
declare function f21<T, K extends keyof T>(obj: Pick<T, K>): K;
declare function f22<T, K extends keyof T>(obj: Boxified<Pick<T, K>>): T;
declare function f23<T, U extends keyof T, K extends U>(obj: Pick<T, K>): T;
declare function f24<T, U, K extends keyof T | keyof U>(obj: Pick<T & U, K>): T & U;
let x0 = f20({ foo: 42, bar: "hello" });
let x1 = f21({ foo: 42, bar: "hello" });
let x2 = f22({ foo: { value: 42} , bar: { value: "hello" } });
let x3 = f23({ foo: 42, bar: "hello" });
let x4 = f24({ foo: 42, bar: "hello" });
// Repro from #29765
function getProps<T, K extends keyof T>(obj: T, list: K[]): Pick<T, K> {
return {} as any;
}
const myAny: any = {};
const o1 = getProps(myAny, ['foo', 'bar']);
const o2: { foo: any; bar: any } = getProps(myAny, ['foo', 'bar']);
@@ -70,3 +70,17 @@ declare function take(cb: (a: number, b: string) => void): void;
(function foo(...rest){}(1, ''));
take(function(...rest){});
// Repro from #29833
type ArgsUnion = [number, string] | [number, Error];
type TupleUnionFunc = (...params: ArgsUnion) => number;
const funcUnionTupleNoRest: TupleUnionFunc = (num, strOrErr) => {
return num;
};
const funcUnionTupleRest: TupleUnionFunc = (...params) => {
const [num, strOrErr] = params;
return num;
};
@@ -1,3 +1,5 @@
// @target: es2015
// Repro from #2264
interface Y { 'i am a very certain type': Y }
@@ -70,3 +72,21 @@ declare var mbp: Man & Bear;
pigify(mbp).oinks; // OK, mbp is treated as Pig
pigify(mbp).walks; // Ok, mbp is treated as Man
// Repros from #29815
interface ITest {
name: 'test'
}
const createTestAsync = (): Promise<ITest> => Promise.resolve().then(() => ({ name: 'test' }))
const createTest = (): ITest => {
return { name: 'test' }
}
declare function f1<T, U>(x: T | U): T | U;
declare function f2<T, U>(x: T & U): T & U;
let x1: string = f1('a');
let x2: string = f2('a');
+6 -1
View File
@@ -5,6 +5,11 @@
"no-unnecessary-type-assertion": true,
"array-type": [true, "array"],
"ban": [
true,
"setInterval",
"setTimeout"
],
"ban-types": {
"options": [
["Object", "Avoid using the `Object` type. Did you mean `object`?"],
@@ -34,6 +39,7 @@
],
"no-bom": true,
"no-double-space": true,
"no-eval": true,
"no-in-operator": true,
"no-increment-decrement": true,
"no-inferrable-types": true,
@@ -100,7 +106,6 @@
"no-console": false,
"no-debugger": false,
"no-empty-interface": false,
"no-eval": false,
"no-object-literal-type-assertion": false,
"no-shadowed-variable": false,
"no-submodule-imports": false,