From e71b46b25db5388596e5647b7c68cb7d95b5cec7 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 15 Dec 2015 19:21:42 -0800 Subject: [PATCH 01/11] Refactored most of 'isSignatureAssignableTo' to a more general function based on 'signatureRelatedTo'. --- src/compiler/checker.ts | 49 ++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9acd3f321aa1a..87b7810d4bd52 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4963,6 +4963,10 @@ namespace ts { return checkTypeRelatedTo(source, target, identityRelation, /*errorNode*/ undefined) ? Ternary.True : Ternary.False; } + function compareTypesAssignable(source: Type, target: Type): Ternary { + return checkTypeRelatedTo(source, target, assignableRelation, /*errorNode*/ undefined) ? Ternary.True : Ternary.False; + } + function isTypeSubtypeOf(source: Type, target: Type): boolean { return checkTypeSubtypeOf(source, target, /*errorNode*/ undefined); } @@ -4979,16 +4983,26 @@ namespace ts { return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage, containingMessageChain); } + function isSignatureAssignableTo(source: Signature, + target: Signature, + ignoreReturnTypes: boolean): boolean { + return compareSignaturesRelated(source, target, ignoreReturnTypes, /*errorReporter*/ undefined, compareTypesAssignable) !== Ternary.False; + } + /** * See signatureRelatedTo, compareSignaturesIdentical */ - function isSignatureAssignableTo(source: Signature, target: Signature, ignoreReturnTypes: boolean): boolean { + function compareSignaturesRelated(source: Signature, + target: Signature, + ignoreReturnTypes: boolean, + errorReporter: (d: DiagnosticMessage, arg0?: string, arg1?: string) => void, + compareTypes: (s: Type, t: Type, reportErrors?: boolean) => Ternary): Ternary { // TODO (drosen): De-duplicate code between related functions. if (source === target) { - return true; + return Ternary.True; } if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return false; + return Ternary.False; } // Spec 1.0 Section 3.8.3 & 3.8.4: @@ -4996,36 +5010,49 @@ namespace ts { source = getErasedSignature(source); target = getErasedSignature(target); + let result = Ternary.True; + const sourceMax = getNumNonRestParameters(source); const targetMax = getNumNonRestParameters(target); const checkCount = getNumParametersToCheckForSignatureRelatability(source, sourceMax, target, targetMax); + const sourceParams = source.parameters; + const targetParams = target.parameters; for (let i = 0; i < checkCount; i++) { - const s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - const t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - const related = isTypeAssignableTo(t, s) || isTypeAssignableTo(s, t); + const s = i < sourceMax ? getTypeOfSymbol(sourceParams[i]) : getRestTypeOfSignature(source); + const t = i < targetMax ? getTypeOfSymbol(targetParams[i]) : getRestTypeOfSignature(target); + const related = compareTypes(t, s, /*reportErrors*/ false) || compareTypes(s, t, !!errorReporter); if (!related) { - return false; + if (errorReporter) { + errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, + sourceParams[i < sourceMax ? i : sourceMax].name, + targetParams[i < targetMax ? i : targetMax].name); + } + return Ternary.False; } + result &= related; } if (!ignoreReturnTypes) { const targetReturnType = getReturnTypeOfSignature(target); if (targetReturnType === voidType) { - return true; + return result; } const sourceReturnType = getReturnTypeOfSignature(source); // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions if (targetReturnType.flags & TypeFlags.PredicateType && (targetReturnType as PredicateType).predicate.kind === TypePredicateKind.Identifier) { if (!(sourceReturnType.flags & TypeFlags.PredicateType)) { - return false; + if (errorReporter) { + errorReporter(Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); + } + return Ternary.False; } } - return isTypeAssignableTo(sourceReturnType, targetReturnType); + result &= compareTypes(sourceReturnType, targetReturnType, !!errorReporter); } - return true; + return result; } function isImplementationCompatibleWithOverload(implementation: Signature, overload: Signature): boolean { From 5e69332cdadc6e3922df2cef89069180fbe87e22 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 15 Dec 2015 21:17:44 -0800 Subject: [PATCH 02/11] Have 'signatureRelatedTo' just use 'compareSignaturesRelated'. --- src/compiler/checker.ts | 71 ++--------------------------------------- 1 file changed, 2 insertions(+), 69 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 87b7810d4bd52..f111ce84cd181 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5735,77 +5735,10 @@ namespace ts { } /** - * See signatureAssignableTo, signatureAssignableTo + * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source: Signature, target: Signature, reportErrors: boolean): Ternary { - // TODO (drosen): De-duplicate code between related functions. - if (source === target) { - return Ternary.True; - } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return Ternary.False; - } - let sourceMax = source.parameters.length; - let targetMax = target.parameters.length; - let checkCount: number; - if (source.hasRestParameter && target.hasRestParameter) { - checkCount = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - checkCount = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - checkCount = sourceMax; - } - else { - checkCount = sourceMax < targetMax ? sourceMax : targetMax; - } - // Spec 1.0 Section 3.8.3 & 3.8.4: - // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N - source = getErasedSignature(source); - target = getErasedSignature(target); - let result = Ternary.True; - for (let i = 0; i < checkCount; i++) { - const s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - const t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - const saveErrorInfo = errorInfo; - let related = isRelatedTo(s, t, reportErrors); - if (!related) { - related = isRelatedTo(t, s, /*reportErrors*/ false); - if (!related) { - if (reportErrors) { - reportError(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, - source.parameters[i < sourceMax ? i : sourceMax].name, - target.parameters[i < targetMax ? i : targetMax].name); - } - return Ternary.False; - } - errorInfo = saveErrorInfo; - } - result &= related; - } - - const targetReturnType = getReturnTypeOfSignature(target); - if (targetReturnType === voidType) { - return result; - } - const sourceReturnType = getReturnTypeOfSignature(source); - - // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions - if (targetReturnType.flags & TypeFlags.PredicateType && (targetReturnType as PredicateType).predicate.kind === TypePredicateKind.Identifier) { - if (!(sourceReturnType.flags & TypeFlags.PredicateType)) { - if (reportErrors) { - reportError(Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return Ternary.False; - } - } - - return result & isRelatedTo(sourceReturnType, targetReturnType, reportErrors); + return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors && reportError, isRelatedTo); } function signaturesIdenticalTo(source: Type, target: Type, kind: SignatureKind): Ternary { From 520884c213fe0b770a3b596d67693c7ceda741eb Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 17 Dec 2015 17:23:19 -0800 Subject: [PATCH 03/11] Accepted regressive baselines. --- .../reference/assignmentCompatWithCallSignatures4.errors.txt | 4 ---- .../assignmentCompatWithConstructSignatures4.errors.txt | 4 ---- .../callSignatureAssignabilityInInheritance3.errors.txt | 4 ---- .../constructSignatureAssignabilityInInheritance3.errors.txt | 4 ---- 4 files changed, 16 deletions(-) diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index e00d1eea042b9..bc9a0509fbb0a 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -3,8 +3,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. - Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. @@ -69,8 +67,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. !!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. !!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2322: Types of property 'foo' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error, { foo: number } and Base are incompatible ~~ !!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index 6cd40f6c8c154..137d481d8e125 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -3,8 +3,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. - Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. @@ -83,8 +81,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. !!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. !!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2322: Types of property 'foo' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error ~~ !!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt index 7e9d75b1b4126..6120443285b92 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -10,8 +10,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. - Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts (2 errors) ==== @@ -89,8 +87,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign !!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. !!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. !!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2430: Types of property 'foo' are incompatible. -!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt index 8d6273804f77f..06fff422fffbe 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -10,8 +10,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. - Types of property 'foo' are incompatible. - Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts (2 errors) ==== @@ -79,8 +77,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc !!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. !!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. !!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. -!!! error TS2430: Types of property 'foo' are incompatible. -!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } From 1905eac824e6f07f91279aefc65e5f3c52e90836 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 11 Jan 2016 12:22:40 -0800 Subject: [PATCH 04/11] Don't rely on truthiness. --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 31ef24e537aab..6e1c35a84dda3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5636,7 +5636,7 @@ namespace ts { * See signatureAssignableTo, compareSignaturesIdentical */ function signatureRelatedTo(source: Signature, target: Signature, reportErrors: boolean): Ternary { - return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors && reportError, isRelatedTo); + return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors ? reportError : undefined, isRelatedTo); } function signaturesIdenticalTo(source: Type, target: Type, kind: SignatureKind): Ternary { From c87bb376b5d0ffa6562712a74e55b828ee9895a1 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 13 Jan 2016 23:11:49 -0800 Subject: [PATCH 05/11] Propagate forced re-elaboration through relation functions. --- src/compiler/checker.ts | 89 ++++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 226b3084293f5..bfee2d68a5cd7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2,6 +2,12 @@ /* @internal */ namespace ts { + const enum ReportErrors { + None = 0, + Basic, + Elaborate, + } + let nextSymbolId = 1; let nextNodeId = 1; let nextMergeId = 1; @@ -4927,7 +4933,7 @@ namespace ts { function isSignatureAssignableTo(source: Signature, target: Signature, ignoreReturnTypes: boolean): boolean { - return compareSignaturesRelated(source, target, ignoreReturnTypes, /*errorReporter*/ undefined, compareTypesAssignable) !== Ternary.False; + return compareSignaturesRelated(source, target, ignoreReturnTypes, ReportErrors.None, /*errorReporter*/ undefined, compareTypesAssignable) !== Ternary.False; } /** @@ -4936,8 +4942,9 @@ namespace ts { function compareSignaturesRelated(source: Signature, target: Signature, ignoreReturnTypes: boolean, + reportErrors: ReportErrors, errorReporter: (d: DiagnosticMessage, arg0?: string, arg1?: string) => void, - compareTypes: (s: Type, t: Type, reportErrors?: boolean) => Ternary): Ternary { + compareTypes: (s: Type, t: Type, reportErrors?: ReportErrors) => Ternary): Ternary { // TODO (drosen): De-duplicate code between related functions. if (source === target) { return Ternary.True; @@ -4961,9 +4968,9 @@ namespace ts { for (let i = 0; i < checkCount; i++) { const s = i < sourceMax ? getTypeOfSymbol(sourceParams[i]) : getRestTypeOfSignature(source); const t = i < targetMax ? getTypeOfSymbol(targetParams[i]) : getRestTypeOfSignature(target); - const related = compareTypes(t, s, /*reportErrors*/ false) || compareTypes(s, t, !!errorReporter); + const related = compareTypes(t, s, /*reportErrors*/ ReportErrors.None) || compareTypes(s, t, reportErrors); if (!related) { - if (errorReporter) { + if (reportErrors) { errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, sourceParams[i < sourceMax ? i : sourceMax].name, targetParams[i < targetMax ? i : targetMax].name); @@ -4983,14 +4990,14 @@ namespace ts { // The following block preserves behavior forbidding boolean returning functions from being assignable to type guard returning functions if (targetReturnType.flags & TypeFlags.PredicateType && (targetReturnType as PredicateType).predicate.kind === TypePredicateKind.Identifier) { if (!(sourceReturnType.flags & TypeFlags.PredicateType)) { - if (errorReporter) { + if (reportErrors) { errorReporter(Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); } return Ternary.False; } } - result &= compareTypes(sourceReturnType, targetReturnType, !!errorReporter); + result &= compareTypes(sourceReturnType, targetReturnType, reportErrors); } return result; @@ -5064,11 +5071,10 @@ namespace ts { let expandingFlags: number; let depth = 0; let overflow = false; - let elaborateErrors = false; Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - const result = isRelatedTo(source, target, errorNode !== undefined, headMessage); + const result = isRelatedTo(source, target, !!errorNode ? ReportErrors.Basic : ReportErrors.None, headMessage); if (overflow) { error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } @@ -5079,8 +5085,7 @@ namespace ts { // where errors were being reported. if (errorInfo.next === undefined) { errorInfo = undefined; - elaborateErrors = true; - isRelatedTo(source, target, errorNode !== undefined, headMessage); + isRelatedTo(source, target, !!errorNode ? ReportErrors.Elaborate : ReportErrors.None, headMessage); } if (containingMessageChain) { errorInfo = concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); @@ -5091,6 +5096,7 @@ namespace ts { return result !== Ternary.False; function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void { + Debug.assert(!!errorNode) errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } @@ -5108,7 +5114,7 @@ namespace ts { // Ternary.True if they are related with no assumptions, // Ternary.Maybe if they are related with assumptions of other relationships, or // Ternary.False if they are not related. - function isRelatedTo(source: Type, target: Type, reportErrors?: boolean, headMessage?: DiagnosticMessage): Ternary { + function isRelatedTo(source: Type, target: Type, reportErrors?: ReportErrors, headMessage?: DiagnosticMessage): Ternary { let result: Ternary; // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return Ternary.True; @@ -5196,7 +5202,7 @@ namespace ts { // A & B = (A & B) | (C & D). if (source.flags & TypeFlags.Intersection) { // If target is a union type the following check will report errors so we suppress them here - if (result = someTypeRelatedToType(source, target, reportErrors && !(target.flags & TypeFlags.Union))) { + if (result = someTypeRelatedToType(source, target, !(target.flags & TypeFlags.Union) ? reportErrors : ReportErrors.None)) { return result; } } @@ -5213,7 +5219,7 @@ namespace ts { constraint = emptyObjectType; } // Report constraint errors only if the constraint is not the empty object type - const reportConstraintErrors = reportErrors && constraint !== emptyObjectType; + const reportConstraintErrors = constraint !== emptyObjectType ? reportErrors : ReportErrors.None; if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { errorInfo = saveErrorInfo; return result; @@ -5234,7 +5240,7 @@ namespace ts { // relates to X. Thus, we include intersection types on the source side here. if (apparentType.flags & (TypeFlags.ObjectType | TypeFlags.Intersection) && target.flags & TypeFlags.ObjectType) { // Report structural errors only if we haven't reported any errors yet - const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; + const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo ? ReportErrors.Elaborate : ReportErrors.None; if (result = objectTypeRelatedTo(apparentType, source, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; @@ -5253,11 +5259,11 @@ namespace ts { if (source.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType) { if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) { // We have type references to same target type, see if all type arguments are identical - if (result = typeArgumentsRelatedTo(source, target, /*reportErrors*/ false)) { + if (result = typeArgumentsRelatedTo(source, target, ReportErrors.None)) { return result; } } - return objectTypeRelatedTo(source, source, target, /*reportErrors*/ false); + return objectTypeRelatedTo(source, source, target, ReportErrors.None); } if (source.flags & TypeFlags.Union && target.flags & TypeFlags.Union || source.flags & TypeFlags.Intersection && target.flags & TypeFlags.Intersection) { @@ -5292,7 +5298,7 @@ namespace ts { return false; } - function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: boolean): boolean { + function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: ReportErrors): boolean { if (!(target.flags & TypeFlags.ObjectLiteralPatternWithComputedProperties) && someConstituentTypeHasKind(target, TypeFlags.ObjectType)) { for (const prop of getPropertiesOfObjectType(source)) { if (!isKnownProperty(target, prop.name)) { @@ -5300,6 +5306,7 @@ namespace ts { // We know *exactly* where things went wrong when comparing the types. // Use this property as the error node as this will be more helpful in // reasoning about what went wrong. + Debug.assert(!!errorNode); errorNode = prop.valueDeclaration; reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(target)); @@ -5315,7 +5322,7 @@ namespace ts { let result = Ternary.True; const sourceTypes = source.types; for (const sourceType of sourceTypes) { - const related = typeRelatedToSomeType(sourceType, target, /*reportErrors*/ false); + const related = typeRelatedToSomeType(sourceType, target, ReportErrors.None); if (!related) { return Ternary.False; } @@ -5324,10 +5331,10 @@ namespace ts { return result; } - function typeRelatedToSomeType(source: Type, target: UnionOrIntersectionType, reportErrors: boolean): Ternary { + function typeRelatedToSomeType(source: Type, target: UnionOrIntersectionType, reportErrors: ReportErrors): Ternary { const targetTypes = target.types; for (let i = 0, len = targetTypes.length; i < len; i++) { - const related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); + const related = isRelatedTo(source, targetTypes[i], i === len - 1 ? reportErrors : ReportErrors.None); if (related) { return related; } @@ -5335,7 +5342,7 @@ namespace ts { return Ternary.False; } - function typeRelatedToEachType(source: Type, target: UnionOrIntersectionType, reportErrors: boolean): Ternary { + function typeRelatedToEachType(source: Type, target: UnionOrIntersectionType, reportErrors: ReportErrors): Ternary { let result = Ternary.True; const targetTypes = target.types; for (const targetType of targetTypes) { @@ -5348,10 +5355,10 @@ namespace ts { return result; } - function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean): Ternary { + function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: ReportErrors): Ternary { const sourceTypes = source.types; for (let i = 0, len = sourceTypes.length; i < len; i++) { - const related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1); + const related = isRelatedTo(sourceTypes[i], target, i === len - 1 ? reportErrors : ReportErrors.None); if (related) { return related; } @@ -5359,7 +5366,7 @@ namespace ts { return Ternary.False; } - function eachTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean): Ternary { + function eachTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: ReportErrors): Ternary { let result = Ternary.True; const sourceTypes = source.types; for (const sourceType of sourceTypes) { @@ -5372,7 +5379,7 @@ namespace ts { return result; } - function typeArgumentsRelatedTo(source: TypeReference, target: TypeReference, reportErrors: boolean): Ternary { + function typeArgumentsRelatedTo(source: TypeReference, target: TypeReference, reportErrors: ReportErrors): Ternary { const sources = source.typeArguments || emptyArray; const targets = target.typeArguments || emptyArray; if (sources.length !== targets.length && relation === identityRelation) { @@ -5395,14 +5402,14 @@ namespace ts { // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary { + function objectTypeRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: ReportErrors): Ternary { if (overflow) { return Ternary.False; } const id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; const related = relation[id]; if (related !== undefined) { - if (elaborateErrors && related === RelationComparisonResult.Failed) { + if (reportErrors === ReportErrors.Elaborate && related === RelationComparisonResult.Failed) { // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported // failure and continue computing the relation such that errors get reported. relation[id] = RelationComparisonResult.FailedAndReported; @@ -5472,7 +5479,7 @@ namespace ts { return result; } - function propertiesRelatedTo(source: Type, target: Type, reportErrors: boolean): Ternary { + function propertiesRelatedTo(source: Type, target: Type, reportErrors: ReportErrors): Ternary { if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } @@ -5580,7 +5587,7 @@ namespace ts { return result; } - function signaturesRelatedTo(source: Type, target: Type, kind: SignatureKind, reportErrors: boolean): Ternary { + function signaturesRelatedTo(source: Type, target: Type, kind: SignatureKind, reportErrors: ReportErrors): Ternary { if (relation === identityRelation) { return signaturesIdenticalTo(source, target, kind); } @@ -5617,7 +5624,7 @@ namespace ts { errorInfo = saveErrorInfo; continue outer; } - shouldElaborateErrors = false; + shouldElaborateErrors = ReportErrors.None; } } // don't elaborate the primitive apparent types (like Number) @@ -5636,8 +5643,8 @@ namespace ts { /** * See signatureAssignableTo, compareSignaturesIdentical */ - function signatureRelatedTo(source: Signature, target: Signature, reportErrors: boolean): Ternary { - return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors ? reportError : undefined, isRelatedTo); + function signatureRelatedTo(source: Signature, target: Signature, reportErrors: ReportErrors): Ternary { + return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source: Type, target: Type, kind: SignatureKind): Ternary { @@ -5657,7 +5664,7 @@ namespace ts { return result; } - function stringIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary { + function stringIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: ReportErrors): Ternary { if (relation === identityRelation) { return indexTypesIdenticalTo(IndexKind.String, source, target); } @@ -5687,7 +5694,7 @@ namespace ts { return Ternary.True; } - function numberIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary { + function numberIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: ReportErrors): Ternary { if (relation === identityRelation) { return indexTypesIdenticalTo(IndexKind.Number, source, target); } @@ -5709,7 +5716,7 @@ namespace ts { let related: Ternary; if (sourceStringType && sourceNumberType) { // If we know for sure we're testing both string and numeric index types then only report errors from the second one - related = isRelatedTo(sourceStringType, targetType, /*reportErrors*/ false) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, ReportErrors.None) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); @@ -8990,7 +8997,7 @@ namespace ts { getInferredTypes(context); } - function checkTypeArguments(signature: Signature, typeArgumentNodes: TypeNode[], typeArgumentTypes: Type[], reportErrors: boolean, headMessage?: DiagnosticMessage): boolean { + function checkTypeArguments(signature: Signature, typeArgumentNodes: TypeNode[], typeArgumentTypes: Type[], reportErrors: ReportErrors, headMessage?: DiagnosticMessage): boolean { const typeParameters = signature.typeParameters; let typeArgumentsAreAssignable = true; let mapper: TypeMapper; @@ -9020,7 +9027,7 @@ namespace ts { return typeArgumentsAreAssignable; } - function checkApplicableSignature(node: CallLikeExpression, args: Expression[], signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: boolean) { + function checkApplicableSignature(node: CallLikeExpression, args: Expression[], signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: ReportErrors) { const argCount = getEffectiveArgumentCount(node, args, signature); for (let i = 0; i < argCount; i++) { const arg = getEffectiveArgument(node, args, i); @@ -9468,12 +9475,12 @@ namespace ts { // in arguments too early. If possible, we'd like to only type them once we know the correct // overload. However, this matters for the case where the call is correct. When the call is // an error, we don't need to exclude any arguments, although it would cause no harm to do so. - checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true); + checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, ReportErrors.Basic); } else if (candidateForTypeArgumentError) { if (!isTaggedTemplate && !isDecorator && typeArguments) { const typeArguments = (node).typeArguments; - checkTypeArguments(candidateForTypeArgumentError, typeArguments, map(typeArguments, getTypeFromTypeNode), /*reportErrors*/ true, headMessage); + checkTypeArguments(candidateForTypeArgumentError, typeArguments, map(typeArguments, getTypeFromTypeNode), ReportErrors.Basic, headMessage); } else { Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); @@ -9541,7 +9548,7 @@ namespace ts { let typeArgumentTypes: Type[]; if (typeArguments) { typeArgumentTypes = map(typeArguments, getTypeFromTypeNode); - typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, ReportErrors.None); } else { inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); @@ -9553,7 +9560,7 @@ namespace ts { } candidate = getSignatureInstantiation(candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, ReportErrors.None)) { break; } const index = excludeArgument ? indexOf(excludeArgument, true) : -1; From 51787e3daa0481537c1fb7733b65b335751da3a5 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 13 Jan 2016 23:12:41 -0800 Subject: [PATCH 06/11] Don't report structural errors on primitive apparent types. --- src/compiler/checker.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index bfee2d68a5cd7..28748805ffaae 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5240,7 +5240,9 @@ namespace ts { // relates to X. Thus, we include intersection types on the source side here. if (apparentType.flags & (TypeFlags.ObjectType | TypeFlags.Intersection) && target.flags & TypeFlags.ObjectType) { // Report structural errors only if we haven't reported any errors yet - const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo ? ReportErrors.Elaborate : ReportErrors.None; + const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !isPrimitiveApparentType(apparentType) + ? ReportErrors.Elaborate + : ReportErrors.None; if (result = objectTypeRelatedTo(apparentType, source, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; @@ -5629,7 +5631,7 @@ namespace ts { } // don't elaborate the primitive apparent types (like Number) // because the actual primitives will have already been reported. - if (shouldElaborateErrors && !isPrimitiveApparentType(source)) { + if (shouldElaborateErrors) { reportError(Diagnostics.Type_0_provides_no_match_for_the_signature_1, typeToString(source), signatureToString(t, /*enclosingDeclaration*/ undefined, /*flags*/ undefined, kind)); From 45022139934a957e5f97146b390bf9092f5e6fa7 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 13 Jan 2016 23:16:55 -0800 Subject: [PATCH 07/11] Accepted baselines. --- .../reference/aliasAssignments.errors.txt | 2 -- ...indsToFunctionScopeArgumentList.errors.txt | 2 -- .../reference/arrayAssignmentTest1.errors.txt | 6 +++++ .../reference/arrayLiterals3.errors.txt | 2 -- .../reference/arraySigChecking.errors.txt | 2 -- .../reference/arrayTypeOfTypeOf.errors.txt | 2 -- .../reference/assignmentCompat1.errors.txt | 4 ---- ...gnmentCompatWithCallSignatures4.errors.txt | 12 ++++++++++ ...tCompatWithConstructSignatures4.errors.txt | 16 +++++++++++++ .../assignmentCompatability16.errors.txt | 4 +--- .../assignmentCompatability17.errors.txt | 4 +--- .../assignmentCompatability18.errors.txt | 4 +--- .../assignmentCompatability19.errors.txt | 4 +--- .../assignmentCompatability20.errors.txt | 4 +--- .../assignmentCompatability21.errors.txt | 4 +--- .../assignmentCompatability22.errors.txt | 4 +--- .../assignmentCompatability23.errors.txt | 4 +--- .../assignmentCompatability29.errors.txt | 4 +--- .../assignmentCompatability30.errors.txt | 4 +--- .../assignmentCompatability31.errors.txt | 4 +--- .../assignmentCompatability32.errors.txt | 4 +--- ...ember-off-of-function-interface.errors.txt | 4 ---- ...ember-off-of-function-interface.errors.txt | 4 ---- .../reference/booleanAssignment.errors.txt | 12 ---------- ...tureAssignabilityInInheritance3.errors.txt | 4 ++++ ...onAssignmentLHSCannotBeAssigned.errors.txt | 2 -- ...tureAssignabilityInInheritance3.errors.txt | 4 ++++ .../constructorReturnsInvalidType.errors.txt | 2 -- ...rWithAssignableReturnExpression.errors.txt | 2 -- .../reference/contextualTyping21.errors.txt | 4 +--- .../reference/contextualTyping33.errors.txt | 4 +++- ...ontextualTypingOfArrayLiterals1.errors.txt | 2 -- ...lTypingOfConditionalExpression2.errors.txt | 2 -- ...fGenericFunctionTypedArguments1.errors.txt | 2 -- ...rayBindingPatternAndAssignment2.errors.txt | 2 -- ...tructuringParameterDeclaration2.errors.txt | 4 ---- ...tructuringParameterDeclaration4.errors.txt | 2 -- ...tructuringParameterDeclaration5.errors.txt | 2 ++ ...ontShowCompilerGeneratedMembers.errors.txt | 2 -- .../reference/enumAssignability.errors.txt | 14 ----------- .../reference/enumAssignmentCompat.errors.txt | 4 ---- .../enumAssignmentCompat2.errors.txt | 4 ---- ...AnnotationAndInvalidInitializer.errors.txt | 2 -- ...ssignmentConstrainedGenericType.errors.txt | 2 -- .../reference/functionCall7.errors.txt | 2 -- ...functionConstraintSatisfaction2.errors.txt | 6 +++-- ...nstraintsTypeArgumentInference2.errors.txt | 2 -- .../reference/genericCombinators2.errors.txt | 2 -- ...DerivedTypeWithSpecializedBase2.errors.txt | 2 -- .../reference/genericRestArgs.errors.txt | 4 +--- .../instanceSubtypeCheck2.errors.txt | 2 -- .../reference/intTypeCheck.errors.txt | 8 ------- .../interfaceImplementation7.errors.txt | 2 -- .../intersectionAndUnionTypes.errors.txt | 22 +++++++++++++++++ .../invalidBooleanAssignments.errors.txt | 4 ---- .../invalidNumberAssignments.errors.txt | 8 ------- .../invalidStringAssignments.errors.txt | 8 ------- .../invalidVoidAssignments.errors.txt | 4 ---- .../lastPropertyInLiteralWins.errors.txt | 4 ++++ .../reference/maxConstraints.errors.txt | 4 +--- .../numericIndexerConstraint1.errors.txt | 2 -- .../objectLiteralIndexerErrors.errors.txt | 2 ++ ...ationInStrictModeByDefaultInES6.errors.txt | 2 -- .../reference/promiseChaining1.errors.txt | 2 -- .../reference/promiseChaining2.errors.txt | 2 -- .../reference/promisePermutations.errors.txt | 2 -- .../reference/promisePermutations2.errors.txt | 2 -- .../reference/promisePermutations3.errors.txt | 2 -- tests/baselines/reference/qualify.errors.txt | 4 ---- .../restArgAssignmentCompat.errors.txt | 2 -- .../reference/returnInConstructor1.errors.txt | 4 ---- .../subtypingWithNumericIndexer4.errors.txt | 4 ---- .../subtypingWithObjectMembers.errors.txt | 2 -- .../subtypingWithObjectMembers2.errors.txt | 2 -- .../subtypingWithStringIndexer4.errors.txt | 4 ---- ...peArgumentConstraintResolution1.errors.txt | 2 -- .../typeGuardFunctionErrors.errors.txt | 2 -- .../baselines/reference/typeName1.errors.txt | 24 ------------------- .../reference/typeOfOnTypeArg.errors.txt | 2 -- ...meterAsTypeParameterConstraint2.errors.txt | 4 +--- .../wrappedRecursiveGenericType.errors.txt | 2 -- 81 files changed, 95 insertions(+), 245 deletions(-) diff --git a/tests/baselines/reference/aliasAssignments.errors.txt b/tests/baselines/reference/aliasAssignments.errors.txt index fe13faba58199..18ea36c5d0045 100644 --- a/tests/baselines/reference/aliasAssignments.errors.txt +++ b/tests/baselines/reference/aliasAssignments.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. - Property 'someClass' is missing in type 'Number'. tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'. @@ -9,7 +8,6 @@ tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tes x = 1; // Should be error ~ !!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'. -!!! error TS2322: Property 'someClass' is missing in type 'Number'. var y = 1; y = moduleA; // should be error ~ diff --git a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt index 812bbe15da4ef..89ef8ded91c64 100644 --- a/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt +++ b/tests/baselines/reference/argumentsBindsToFunctionScopeArgumentList.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts (1 errors) ==== @@ -8,5 +7,4 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS arguments = 10; /// This shouldnt be of type number and result in error. ~~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'IArguments'. -!!! error TS2322: Property 'length' is missing in type 'Number'. } \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest1.errors.txt b/tests/baselines/reference/arrayAssignmentTest1.errors.txt index d3a7fafed0552..3cce5658c1368 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest1.errors.txt @@ -26,10 +26,13 @@ tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is Property 'C2M1' is missing in type 'C3'. tests/cases/compiler/arrayAssignmentTest1.ts(75,1): error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. Type 'C2' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'C2'. tests/cases/compiler/arrayAssignmentTest1.ts(76,1): error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. Type 'C1' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'C1'. tests/cases/compiler/arrayAssignmentTest1.ts(77,1): error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. Type 'I1' is not assignable to type 'C3'. + Property 'CM3M1' is missing in type 'I1'. tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. Property 'push' is missing in type '() => C1'. tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. @@ -159,14 +162,17 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n ~~~~~~ !!! error TS2322: Type 'C2[]' is not assignable to type 'C3[]'. !!! error TS2322: Type 'C2' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'C2'. arr_c3 = arr_c1_2; // should be an error - is ~~~~~~ !!! error TS2322: Type 'C1[]' is not assignable to type 'C3[]'. !!! error TS2322: Type 'C1' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'C1'. arr_c3 = arr_i1_2; // should be an error - is ~~~~~~ !!! error TS2322: Type 'I1[]' is not assignable to type 'C3[]'. !!! error TS2322: Type 'I1' is not assignable to type 'C3'. +!!! error TS2322: Property 'CM3M1' is missing in type 'I1'. arr_any = f1; // should be an error - is ~~~~~~~ diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt index 637fb3e3bc40d..5409075a55c0e 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -18,7 +18,6 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error Types of parameters 'items' and 'items' are incompatible. Type 'number | string' is not assignable to type 'Number'. Type 'string' is not assignable to type 'Number'. - Property 'toFixed' is missing in type 'String'. ==== tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts (6 errors) ==== @@ -82,5 +81,4 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error !!! error TS2322: Types of parameters 'items' and 'items' are incompatible. !!! error TS2322: Type 'number | string' is not assignable to type 'Number'. !!! error TS2322: Type 'string' is not assignable to type 'Number'. -!!! error TS2322: Property 'toFixed' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/arraySigChecking.errors.txt b/tests/baselines/reference/arraySigChecking.errors.txt index b70b659773c75..1968957363caa 100644 --- a/tests/baselines/reference/arraySigChecking.errors.txt +++ b/tests/baselines/reference/arraySigChecking.errors.txt @@ -4,7 +4,6 @@ tests/cases/compiler/arraySigChecking.ts(18,5): error TS2322: Type 'void[]' is n tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. Type 'number[]' is not assignable to type 'number[][]'. Type 'number' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/arraySigChecking.ts (3 errors) ==== @@ -39,7 +38,6 @@ tests/cases/compiler/arraySigChecking.ts(22,1): error TS2322: Type 'number[][]' !!! error TS2322: Type 'number[][]' is not assignable to type 'number[][][]'. !!! error TS2322: Type 'number[]' is not assignable to type 'number[][]'. !!! error TS2322: Type 'number' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. function isEmpty(l: { length: number }) { return l.length === 0; diff --git a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt index 41446dfceabd0..1c37f04be72b8 100644 --- a/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt +++ b/tests/baselines/reference/arrayTypeOfTypeOf.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. - Property 'isArray' is missing in type 'Number'. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,22): error TS1005: '=' expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(6,30): error TS1109: Expression expected. tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts(7,5): error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. @@ -16,7 +15,6 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfTypeOf.ts( var xs3: typeof Array; ~~~ !!! error TS2322: Type 'number' is not assignable to type 'ArrayConstructor'. -!!! error TS2322: Property 'isArray' is missing in type 'Number'. ~ !!! error TS1005: '=' expected. ~ diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index 7539af9288718..0936c532ab331 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -3,9 +3,7 @@ tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [index: st tests/cases/compiler/assignmentCompat1.ts(6,1): error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'. Property 'one' is missing in type '{ [index: number]: any; }'. tests/cases/compiler/assignmentCompat1.ts(8,1): error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'. - Index signature is missing in type 'String'. tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'. - Index signature is missing in type 'Boolean'. ==== tests/cases/compiler/assignmentCompat1.ts (4 errors) ==== @@ -25,11 +23,9 @@ tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'boolean' is y = "foo"; // Error ~ !!! error TS2322: Type 'string' is not assignable to type '{ [index: string]: any; }'. -!!! error TS2322: Index signature is missing in type 'String'. z = "foo"; // OK, string has numeric indexer z = false; // Error ~ !!! error TS2322: Type 'boolean' is not assignable to type '{ [index: number]: any; }'. -!!! error TS2322: Index signature is missing in type 'Boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt index bc9a0509fbb0a..a75b5fafac1c6 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.errors.txt @@ -3,9 +3,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts(53,9): error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type 'Base' is not assignable to type '{ foo: number; }'. + Types of property 'foo' are incompatible. + Type 'string' is not assignable to type 'number'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures4.ts (2 errors) ==== @@ -67,11 +73,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. !!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. !!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error, { foo: number } and Base are incompatible ~~ !!! error TS2322: Type '(x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type '(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var b10: (...x: T[]) => T; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt index 137d481d8e125..da9ffba1ee148 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.errors.txt @@ -3,9 +3,15 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(53,9): error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. Types of parameters 'y' and 'y' are incompatible. Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. + Types of parameters 'arg2' and 'arg2' are incompatible. + Type 'Base' is not assignable to type '{ foo: number; }'. + Types of property 'foo' are incompatible. + Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(77,9): error TS2322: Type 'new (x: (a: T) => T) => T[]' is not assignable to type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }'. Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: number): number; new (a?: number): number; }'. @@ -13,6 +19,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(78,9): error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. + Type '{ new (a: number): number; new (a?: number): number; }' provides no match for the signature '(a: any): any' tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(81,9): error TS2322: Type 'new (x: (a: T) => T) => any[]' is not assignable to type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }'. Types of parameters 'x' and 'x' are incompatible. Type '(a: any) => any' is not assignable to type '{ new (a: T): T; new (a: T): T; }'. @@ -20,6 +27,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts(82,9): error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. Types of parameters 'x' and 'x' are incompatible. Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. + Type '{ new (a: T): T; new (a: T): T; }' provides no match for the signature '(a: any): any' ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures4.ts (6 errors) ==== @@ -81,11 +89,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. !!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. !!! error TS2322: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'number' is not assignable to type 'string'. b8 = a8; // error ~~ !!! error TS2322: Type 'new (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived' is not assignable to type 'new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type '(arg2: Base) => Derived' is not assignable to type '(arg2: { foo: number; }) => any'. +!!! error TS2322: Types of parameters 'arg2' and 'arg2' are incompatible. +!!! error TS2322: Type 'Base' is not assignable to type '{ foo: number; }'. +!!! error TS2322: Types of property 'foo' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type 'number'. var b10: new (...x: T[]) => T; @@ -120,6 +134,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '{ new (x: { new (a: number): number; new (a?: number): number; }): number[]; new (x: { new (a: boolean): boolean; new (a?: boolean): boolean; }): boolean[]; }' is not assignable to type 'new (x: (a: T) => T) => T[]'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Type '{ new (a: number): number; new (a?: number): number; }' provides no match for the signature '(a: any): any' var b17: new (x: (a: T) => T) => any[]; a17 = b17; // error @@ -133,6 +148,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '{ new (x: { new (a: T): T; new (a: T): T; }): any[]; new (x: { new (a: T): T; new (a: T): T; }): any[]; }' is not assignable to type 'new (x: (a: T) => T) => any[]'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' is not assignable to type '(a: any) => any'. +!!! error TS2322: Type '{ new (a: T): T; new (a: T): T; }' provides no match for the signature '(a: any): any' } module WithGenericSignaturesInBaseType { diff --git a/tests/baselines/reference/assignmentCompatability16.errors.txt b/tests/baselines/reference/assignmentCompatability16.errors.txt index 266d72b3232fb..71a93f11b35f3 100644 --- a/tests/baselines/reference/assignmentCompatability16.errors.txt +++ b/tests/baselines/reference/assignmentCompatability16.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'any[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability16.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability16.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability17.errors.txt b/tests/baselines/reference/assignmentCompatability17.errors.txt index b37f39d082f70..a87bcff2e92ec 100644 --- a/tests/baselines/reference/assignmentCompatability17.errors.txt +++ b/tests/baselines/reference/assignmentCompatability17.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'any[]'. - Property 'push' is missing in type 'String'. ==== tests/cases/compiler/assignmentCompatability17.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability17.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: any[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'any[]'. -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability18.errors.txt b/tests/baselines/reference/assignmentCompatability18.errors.txt index 2be4a037575f2..8ab5e5dcd07c6 100644 --- a/tests/baselines/reference/assignmentCompatability18.errors.txt +++ b/tests/baselines/reference/assignmentCompatability18.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability18.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability18.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability19.errors.txt b/tests/baselines/reference/assignmentCompatability19.errors.txt index ae97af6aa7ecf..e84e665cefabc 100644 --- a/tests/baselines/reference/assignmentCompatability19.errors.txt +++ b/tests/baselines/reference/assignmentCompatability19.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'number[]'. - Property 'push' is missing in type 'String'. ==== tests/cases/compiler/assignmentCompatability19.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability19.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: number[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'number[]'. -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'number[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability20.errors.txt b/tests/baselines/reference/assignmentCompatability20.errors.txt index 750310ac5cc27..2e67a2a20337f 100644 --- a/tests/baselines/reference/assignmentCompatability20.errors.txt +++ b/tests/baselines/reference/assignmentCompatability20.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability20.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability20.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability21.errors.txt b/tests/baselines/reference/assignmentCompatability21.errors.txt index 8da52fe42c642..44e24e7d0b5cc 100644 --- a/tests/baselines/reference/assignmentCompatability21.errors.txt +++ b/tests/baselines/reference/assignmentCompatability21.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'string[]'. - Property 'push' is missing in type 'String'. ==== tests/cases/compiler/assignmentCompatability21.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability21.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: string[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'string[]'. -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'string[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability22.errors.txt b/tests/baselines/reference/assignmentCompatability22.errors.txt index f0799a92f5c75..cb42a7abaef74 100644 --- a/tests/baselines/reference/assignmentCompatability22.errors.txt +++ b/tests/baselines/reference/assignmentCompatability22.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability22.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability22.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability23.errors.txt b/tests/baselines/reference/assignmentCompatability23.errors.txt index a005eaa02d126..7b54e8559eb87 100644 --- a/tests/baselines/reference/assignmentCompatability23.errors.txt +++ b/tests/baselines/reference/assignmentCompatability23.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. Types of property 'two' are incompatible. Type 'string' is not assignable to type 'boolean[]'. - Property 'push' is missing in type 'String'. ==== tests/cases/compiler/assignmentCompatability23.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability23.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ two: boolean[]; }'. !!! error TS2322: Types of property 'two' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'boolean[]'. -!!! error TS2322: Property 'push' is missing in type 'String'. \ No newline at end of file +!!! error TS2322: Type 'string' is not assignable to type 'boolean[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability29.errors.txt b/tests/baselines/reference/assignmentCompatability29.errors.txt index 194ae4ab67529..9ba5c35d52832 100644 --- a/tests/baselines/reference/assignmentCompatability29.errors.txt +++ b/tests/baselines/reference/assignmentCompatability29.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'any[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability29.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability29.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: any[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability30.errors.txt b/tests/baselines/reference/assignmentCompatability30.errors.txt index b025705517c76..43f7f3f9c0a62 100644 --- a/tests/baselines/reference/assignmentCompatability30.errors.txt +++ b/tests/baselines/reference/assignmentCompatability30.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability30.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability30.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: number[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'number[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability31.errors.txt b/tests/baselines/reference/assignmentCompatability31.errors.txt index 8e19905eba7e3..8874ebf06a6e4 100644 --- a/tests/baselines/reference/assignmentCompatability31.errors.txt +++ b/tests/baselines/reference/assignmentCompatability31.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'string[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability31.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability31.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: string[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'string[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'string[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability32.errors.txt b/tests/baselines/reference/assignmentCompatability32.errors.txt index 6d6321f5e5067..00164a48fd621 100644 --- a/tests/baselines/reference/assignmentCompatability32.errors.txt +++ b/tests/baselines/reference/assignmentCompatability32.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. Types of property 'one' are incompatible. Type 'number' is not assignable to type 'boolean[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/assignmentCompatability32.ts (1 errors) ==== @@ -17,5 +16,4 @@ tests/cases/compiler/assignmentCompatability32.ts(9,1): error TS2322: Type 'inte ~~~~~~~~~~~~~~~~~~~ !!! error TS2322: Type 'interfaceWithPublicAndOptional' is not assignable to type '{ one: boolean[]; }'. !!! error TS2322: Types of property 'one' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type 'boolean[]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt index e5db4f9ab9621..33a2269f747f0 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-apply-member-off-of-function-interface.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Applicable'. - Property 'apply' is missing in type 'String'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Applicable'. Property 'apply' is missing in type 'string[]'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Applicable'. - Property 'apply' is missing in type 'Number'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Applicable'. Property 'apply' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Applicable'. @@ -26,7 +24,6 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi x = ''; ~ !!! error TS2322: Type 'string' is not assignable to type 'Applicable'. -!!! error TS2322: Property 'apply' is missing in type 'String'. x = ['']; ~ !!! error TS2322: Type 'string[]' is not assignable to type 'Applicable'. @@ -34,7 +31,6 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi x = 4; ~ !!! error TS2322: Type 'number' is not assignable to type 'Applicable'. -!!! error TS2322: Property 'apply' is missing in type 'Number'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Applicable'. diff --git a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt index f3ff6f1b79238..1651e5082ee96 100644 --- a/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt +++ b/tests/baselines/reference/assignmentCompatability_checking-call-member-off-of-function-interface.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type 'string' is not assignable to type 'Callable'. - Property 'call' is missing in type 'String'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(11,1): error TS2322: Type 'string[]' is not assignable to type 'Callable'. Property 'call' is missing in type 'string[]'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type 'number' is not assignable to type 'Callable'. - Property 'call' is missing in type 'Number'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(13,1): error TS2322: Type '{}' is not assignable to type 'Callable'. Property 'call' is missing in type '{}'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Callable'. @@ -26,7 +24,6 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio x = ''; ~ !!! error TS2322: Type 'string' is not assignable to type 'Callable'. -!!! error TS2322: Property 'call' is missing in type 'String'. x = ['']; ~ !!! error TS2322: Type 'string[]' is not assignable to type 'Callable'. @@ -34,7 +31,6 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio x = 4; ~ !!! error TS2322: Type 'number' is not assignable to type 'Callable'. -!!! error TS2322: Property 'call' is missing in type 'Number'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Callable'. diff --git a/tests/baselines/reference/booleanAssignment.errors.txt b/tests/baselines/reference/booleanAssignment.errors.txt index 454bd7ef70713..15b506d3df4bf 100644 --- a/tests/baselines/reference/booleanAssignment.errors.txt +++ b/tests/baselines/reference/booleanAssignment.errors.txt @@ -1,11 +1,5 @@ tests/cases/compiler/booleanAssignment.ts(2,1): error TS2322: Type 'number' is not assignable to type 'Boolean'. - Types of property 'valueOf' are incompatible. - Type '() => number' is not assignable to type '() => boolean'. - Type 'number' is not assignable to type 'boolean'. tests/cases/compiler/booleanAssignment.ts(3,1): error TS2322: Type 'string' is not assignable to type 'Boolean'. - Types of property 'valueOf' are incompatible. - Type '() => string' is not assignable to type '() => boolean'. - Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not assignable to type 'Boolean'. Types of property 'valueOf' are incompatible. Type '() => Object' is not assignable to type '() => boolean'. @@ -17,15 +11,9 @@ tests/cases/compiler/booleanAssignment.ts(4,1): error TS2322: Type '{}' is not a b = 1; // Error ~ !!! error TS2322: Type 'number' is not assignable to type 'Boolean'. -!!! error TS2322: Types of property 'valueOf' are incompatible. -!!! error TS2322: Type '() => number' is not assignable to type '() => boolean'. -!!! error TS2322: Type 'number' is not assignable to type 'boolean'. b = "a"; // Error ~ !!! error TS2322: Type 'string' is not assignable to type 'Boolean'. -!!! error TS2322: Types of property 'valueOf' are incompatible. -!!! error TS2322: Type '() => string' is not assignable to type '() => boolean'. -!!! error TS2322: Type 'string' is not assignable to type 'boolean'. b = {}; // Error ~ !!! error TS2322: Type '{}' is not assignable to type 'Boolean'. diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt index 6120443285b92..7e9d75b1b4126 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.errors.txt @@ -10,6 +10,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSignatureAssignabilityInInheritance3.ts (2 errors) ==== @@ -87,6 +89,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/callSign !!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. !!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. !!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt index 535e4eb1a30b4..6bbebeb6ec767 100644 --- a/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt +++ b/tests/baselines/reference/compoundAdditionAssignmentLHSCannotBeAssigned.errors.txt @@ -2,7 +2,6 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(8,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(11,1): error TS2322: Type 'string' is not assignable to type 'E'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(14,1): error TS2322: Type 'string' is not assignable to type '{ a: string; }'. - Property 'a' is missing in type 'String'. tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmentLHSCannotBeAssigned.ts(17,1): error TS2322: Type 'string' is not assignable to type 'void'. @@ -29,7 +28,6 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAdditionAssignmen x4 += ''; ~~ !!! error TS2322: Type 'string' is not assignable to type '{ a: string; }'. -!!! error TS2322: Property 'a' is missing in type 'String'. var x5: void; x5 += ''; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt index 06fff422fffbe..8d6273804f77f 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.errors.txt @@ -10,6 +10,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. Types of parameters 'arg2' and 'arg2' are incompatible. Type '{ foo: number; }' is not assignable to type 'Base'. + Types of property 'foo' are incompatible. + Type 'number' is not assignable to type 'string'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/constructSignatureAssignabilityInInheritance3.ts (2 errors) ==== @@ -77,6 +79,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/construc !!! error TS2430: Type '(arg2: { foo: number; }) => any' is not assignable to type '(arg2: Base) => Derived'. !!! error TS2430: Types of parameters 'arg2' and 'arg2' are incompatible. !!! error TS2430: Type '{ foo: number; }' is not assignable to type 'Base'. +!!! error TS2430: Types of property 'foo' are incompatible. +!!! error TS2430: Type 'number' is not assignable to type 'string'. a8: new (x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U; // error, type mismatch } diff --git a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt index a8fe1de470084..3b9a84fea98be 100644 --- a/tests/baselines/reference/constructorReturnsInvalidType.errors.txt +++ b/tests/baselines/reference/constructorReturnsInvalidType.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2322: Type 'number' is not assignable to type 'X'. - Property 'foo' is missing in type 'Number'. tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class @@ -9,7 +8,6 @@ tests/cases/compiler/constructorReturnsInvalidType.ts(3,16): error TS2409: Retur return 1; ~ !!! error TS2322: Type 'number' is not assignable to type 'X'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt index 1f7d7133bd753..421e629c113ff 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2322: Type 'number' is not assignable to type 'D'. - Property 'x' is missing in type 'Number'. tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(12,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignableReturnExpression.ts(26,16): error TS2322: Type '{ x: number; }' is not assignable to type 'F'. Types of property 'x' are incompatible. @@ -22,7 +21,6 @@ tests/cases/conformance/classes/constructorDeclarations/constructorWithAssignabl return 1; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'D'. -!!! error TS2322: Property 'x' is missing in type 'Number'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/contextualTyping21.errors.txt b/tests/baselines/reference/contextualTyping21.errors.txt index 362ead49ad388..db6ecd32b97f5 100644 --- a/tests/baselines/reference/contextualTyping21.errors.txt +++ b/tests/baselines/reference/contextualTyping21.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '({ id: number; } | number)[]' is not assignable to type '{ id: number; }[]'. Type '{ id: number; } | number' is not assignable to type '{ id: number; }'. Type 'number' is not assignable to type '{ id: number; }'. - Property 'id' is missing in type 'Number'. ==== tests/cases/compiler/contextualTyping21.ts (1 errors) ==== @@ -9,5 +8,4 @@ tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '({ id: num ~~~ !!! error TS2322: Type '({ id: number; } | number)[]' is not assignable to type '{ id: number; }[]'. !!! error TS2322: Type '{ id: number; } | number' is not assignable to type '{ id: number; }'. -!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'. -!!! error TS2322: Property 'id' is missing in type 'Number'. \ No newline at end of file +!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping33.errors.txt b/tests/baselines/reference/contextualTyping33.errors.txt index 4ed0787bde3bb..16c975391a325 100644 --- a/tests/baselines/reference/contextualTyping33.errors.txt +++ b/tests/baselines/reference/contextualTyping33.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. + Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTyping33.ts (1 errors) ==== @@ -8,4 +9,5 @@ tests/cases/compiler/contextualTyping33.ts(1,66): error TS2345: Argument of type ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '((() => number) | (() => string))[]' is not assignable to parameter of type '{ (): number; (i: number): number; }[]'. !!! error TS2345: Type '(() => number) | (() => string)' is not assignable to type '{ (): number; (i: number): number; }'. -!!! error TS2345: Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. \ No newline at end of file +!!! error TS2345: Type '() => string' is not assignable to type '{ (): number; (i: number): number; }'. +!!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt index a1bfaf56336dd..698a8e789f0d8 100644 --- a/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.errors.txt @@ -2,7 +2,6 @@ tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Typ Index signatures are incompatible. Type 'Date | number' is not assignable to type 'Date'. Type 'number' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'Number'. ==== tests/cases/compiler/contextualTypingOfArrayLiterals1.ts (1 errors) ==== @@ -16,7 +15,6 @@ tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Typ !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Date | number' is not assignable to type 'Date'. !!! error TS2322: Type 'number' is not assignable to type 'Date'. -!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var r2 = x3[1]; r2.getDate(); \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt index 08fe22c08e02e..be49b7b524963 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.errors.txt @@ -2,7 +2,6 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS Type '(b: number) => void' is not assignable to type '(a: A) => void'. Types of parameters 'b' and 'a' are incompatible. Type 'number' is not assignable to type 'A'. - Property 'foo' is missing in type 'Number'. ==== tests/cases/compiler/contextualTypingOfConditionalExpression2.ts (1 errors) ==== @@ -22,5 +21,4 @@ tests/cases/compiler/contextualTypingOfConditionalExpression2.ts(11,5): error TS !!! error TS2322: Type '(b: number) => void' is not assignable to type '(a: A) => void'. !!! error TS2322: Types of parameters 'b' and 'a' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'A'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt index a11f000901634..c7b15e8efefec 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(16,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. Type 'string' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'String'. tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. Type 'string' is not assignable to type 'Date'. @@ -25,7 +24,6 @@ tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32): ~ !!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. !!! error TS2345: Type 'string' is not assignable to type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'String'. var r6 = _.forEach(c2, (x) => { return x.toFixed() }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index 914052859734a..3348effe8225d 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -5,7 +5,6 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss Types of property '1' are incompatible. Type 'number' is not assignable to type 'boolean'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(17,6): error TS2322: Type 'string' is not assignable to type 'Number'. - Property 'toFixed' is missing in type 'String'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2322: Type 'number[]' is not assignable to type '[number, number]'. Property '0' is missing in type 'number[]'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(23,5): error TS2322: Type 'number[]' is not assignable to type '[string, string]'. @@ -43,7 +42,6 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss var [b3 = "string", b4, b5] = bar(); // Error ~~ !!! error TS2322: Type 'string' is not assignable to type 'Number'. -!!! error TS2322: Property 'toFixed' is missing in type 'String'. // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, // S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. diff --git a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt index c8037255a3293..8c0781571e4cf 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt @@ -8,7 +8,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( Type 'number | string[][] | string' is not assignable to type 'number | string[][]'. Type 'string' is not assignable to type 'number | string[][]'. Type 'string' is not assignable to type 'string[][]'. - Property 'push' is missing in type 'String'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,8): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,16): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(23,14): error TS2345: Argument of type '{ x: string; y: boolean; }' is not assignable to parameter of type '{ x: number; y: any; }'. @@ -34,7 +33,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(39,4): error TS2345: Argument of type '[number, number, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. Types of property '2' are incompatible. Type 'boolean' is not assignable to type '[[any]]'. - Property '0' is missing in type 'Boolean'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(40,4): error TS2345: Argument of type '[number, number, [[string]]]' is not assignable to parameter of type '[any, any, [[number]]]'. Types of property '2' are incompatible. Type '[[string]]' is not assignable to type '[[number]]'. @@ -78,7 +76,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( !!! error TS2345: Type 'number | string[][] | string' is not assignable to type 'number | string[][]'. !!! error TS2345: Type 'string' is not assignable to type 'number | string[][]'. !!! error TS2345: Type 'string' is not assignable to type 'string[][]'. -!!! error TS2345: Property 'push' is missing in type 'String'. // If the declaration includes an initializer expression (which is permitted only @@ -146,7 +143,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( !!! error TS2345: Argument of type '[number, number, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. !!! error TS2345: Types of property '2' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type '[[any]]'. -!!! error TS2345: Property '0' is missing in type 'Boolean'. c6([1, 2, [["string"]]]); // Error, implied type is [any, any, [[number]]] // Use initializer ~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '[number, number, [[string]]]' is not assignable to parameter of type '[any, any, [[number]]]'. diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index 7e71a2cd75315..b08c5b942d851 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -6,7 +6,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(22,4): error TS2345: Argument of type '[number, number, string, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. Types of property '2' are incompatible. Type 'string' is not assignable to type '[[any]]'. - Property '0' is missing in type 'String'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(23,4): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]]]'. Property '2' is missing in type '[number, number]'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(24,4): error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'. @@ -53,7 +52,6 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( !!! error TS2345: Argument of type '[number, number, string, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. !!! error TS2345: Types of property '2' are incompatible. !!! error TS2345: Type 'string' is not assignable to type '[[any]]'. -!!! error TS2345: Property '0' is missing in type 'String'. a5([1, 2]); // Error, parameter type is [any, any, [[any]]] ~~~~~~ !!! error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]]]'. diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt index c60e2b75c3759..2afb25502c7d7 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration5.errors.txt @@ -1,6 +1,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts(47,4): error TS2345: Argument of type '{ y: Class; }' is not assignable to parameter of type '{ y: D; }'. Types of property 'y' are incompatible. Type 'Class' is not assignable to type 'D'. + Property 'foo' is missing in type 'Class'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts(48,4): error TS2345: Argument of type '{}' is not assignable to parameter of type '{ y: D; }'. Property 'y' is missing in type '{}'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts(49,4): error TS2345: Argument of type '{ y: number; }' is not assignable to parameter of type '{ y: D; }'. @@ -63,6 +64,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration5.ts( !!! error TS2345: Argument of type '{ y: Class; }' is not assignable to parameter of type '{ y: D; }'. !!! error TS2345: Types of property 'y' are incompatible. !!! error TS2345: Type 'Class' is not assignable to type 'D'. +!!! error TS2345: Property 'foo' is missing in type 'Class'. d3({}); ~~ !!! error TS2345: Argument of type '{}' is not assignable to parameter of type '{ y: D; }'. diff --git a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt index c13a6b5fe2a72..d53571cc4a8ac 100644 --- a/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt +++ b/tests/baselines/reference/dontShowCompilerGeneratedMembers.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(1,5): error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. - Property 'x' is missing in type 'Number'. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(3,6): error TS1139: Type parameter declaration expected. tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Expression expected. @@ -8,7 +7,6 @@ tests/cases/compiler/dontShowCompilerGeneratedMembers.ts(4,1): error TS1109: Exp var f: { ~ !!! error TS2322: Type 'number' is not assignable to type '{ (): any; x: number; }'. -!!! error TS2322: Property 'x' is missing in type 'Number'. x: number; <- ~ diff --git a/tests/baselines/reference/enumAssignability.errors.txt b/tests/baselines/reference/enumAssignability.errors.txt index 1316727076f37..bfabb5eae8819 100644 --- a/tests/baselines/reference/enumAssignability.errors.txt +++ b/tests/baselines/reference/enumAssignability.errors.txt @@ -3,23 +3,16 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(29,9): error TS2322: Type 'E' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(30,9): error TS2322: Type 'E' is not assignable to type 'boolean'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(31,9): error TS2322: Type 'E' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(33,9): error TS2322: Type 'E' is not assignable to type 'void'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(36,9): error TS2322: Type 'E' is not assignable to type '() => {}'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(37,9): error TS2322: Type 'E' is not assignable to type 'Function'. - Property 'apply' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(38,9): error TS2322: Type 'E' is not assignable to type '(x: number) => string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(39,5): error TS2322: Type 'E' is not assignable to type 'C'. - Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(40,5): error TS2322: Type 'E' is not assignable to type 'I'. - Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(41,9): error TS2322: Type 'E' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(42,9): error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. - Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(43,9): error TS2322: Type 'E' is not assignable to type '(x: T) => T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(45,9): error TS2322: Type 'E' is not assignable to type 'String'. - Property 'charAt' is missing in type 'Number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(48,9): error TS2322: Type 'E' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(49,9): error TS2322: Type 'E' is not assignable to type 'U'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignability.ts(50,9): error TS2322: Type 'E' is not assignable to type 'V'. @@ -69,7 +62,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var ee: Date = e; ~~ !!! error TS2322: Type 'E' is not assignable to type 'Date'. -!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var f: any = e; // ok var g: void = e; ~ @@ -82,26 +74,21 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var k: Function = e; ~ !!! error TS2322: Type 'E' is not assignable to type 'Function'. -!!! error TS2322: Property 'apply' is missing in type 'Number'. var l: (x: number) => string = e; ~ !!! error TS2322: Type 'E' is not assignable to type '(x: number) => string'. ac = e; ~~ !!! error TS2322: Type 'E' is not assignable to type 'C'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. ai = e; ~~ !!! error TS2322: Type 'E' is not assignable to type 'I'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. var m: number[] = e; ~ !!! error TS2322: Type 'E' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. var n: { foo: string } = e; ~ !!! error TS2322: Type 'E' is not assignable to type '{ foo: string; }'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. var o: (x: T) => T = e; ~ !!! error TS2322: Type 'E' is not assignable to type '(x: T) => T'. @@ -109,7 +96,6 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi var q: String = e; ~ !!! error TS2322: Type 'E' is not assignable to type 'String'. -!!! error TS2322: Property 'charAt' is missing in type 'Number'. function foo(x: T, y: U, z: V) { x = e; diff --git a/tests/baselines/reference/enumAssignmentCompat.errors.txt b/tests/baselines/reference/enumAssignmentCompat.errors.txt index 3cddaf459666c..f1a01247146c0 100644 --- a/tests/baselines/reference/enumAssignmentCompat.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/enumAssignmentCompat.ts(26,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. tests/cases/compiler/enumAssignmentCompat.ts(28,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. - Property 'D' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat.ts(30,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. tests/cases/compiler/enumAssignmentCompat.ts(32,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. - Property 'a' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. @@ -40,7 +38,6 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' var b: typeof W = W.a; // error ~ !!! error TS2322: Type 'W' is not assignable to type 'typeof W'. -!!! error TS2322: Property 'D' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ @@ -49,7 +46,6 @@ tests/cases/compiler/enumAssignmentCompat.ts(33,5): error TS2322: Type 'number' var f: WStatic = W.a; // error ~ !!! error TS2322: Type 'W' is not assignable to type 'WStatic'. -!!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'WStatic'. diff --git a/tests/baselines/reference/enumAssignmentCompat2.errors.txt b/tests/baselines/reference/enumAssignmentCompat2.errors.txt index d87d6acf6a099..4e0660eaae3b5 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.errors.txt +++ b/tests/baselines/reference/enumAssignmentCompat2.errors.txt @@ -1,9 +1,7 @@ tests/cases/compiler/enumAssignmentCompat2.ts(25,5): error TS2322: Type 'typeof W' is not assignable to type 'number'. tests/cases/compiler/enumAssignmentCompat2.ts(27,5): error TS2322: Type 'W' is not assignable to type 'typeof W'. - Property 'a' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat2.ts(29,5): error TS2322: Type 'number' is not assignable to type 'typeof W'. tests/cases/compiler/enumAssignmentCompat2.ts(31,5): error TS2322: Type 'W' is not assignable to type 'WStatic'. - Property 'a' is missing in type 'Number'. tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' is not assignable to type 'WStatic'. @@ -39,7 +37,6 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' var b: typeof W = W.a; // error ~ !!! error TS2322: Type 'W' is not assignable to type 'typeof W'. -!!! error TS2322: Property 'a' is missing in type 'Number'. var c: typeof W.a = W.a; var d: typeof W = 3; // error ~ @@ -48,7 +45,6 @@ tests/cases/compiler/enumAssignmentCompat2.ts(32,5): error TS2322: Type 'number' var f: WStatic = W.a; // error ~ !!! error TS2322: Type 'W' is not assignable to type 'WStatic'. -!!! error TS2322: Property 'a' is missing in type 'Number'. var g: WStatic = 5; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'WStatic'. diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt index 1247844247275..fc1bcaa545a77 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.errors.txt @@ -1,7 +1,6 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(34,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(35,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(36,5): error TS2322: Type 'number' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'Number'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(38,5): error TS2322: Type 'number' is not assignable to type 'void'. tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAndInvalidInitializer.ts(40,5): error TS2322: Type 'D<{}>' is not assignable to type 'I'. Property 'id' is missing in type 'D<{}>'. @@ -76,7 +75,6 @@ tests/cases/conformance/statements/VariableStatements/everyTypeWithAnnotationAnd var aDate: Date = 9.9; ~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'Date'. -!!! error TS2322: Property 'toDateString' is missing in type 'Number'. var aVoid: void = 9.9; ~~~~~ diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt index 946bc8ee8b181..cf63c48925fde 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/externalModules/foo_1.ts(2,17): error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. - Property 'a' is missing in type 'Boolean'. ==== tests/cases/conformance/externalModules/foo_1.ts (1 errors) ==== @@ -7,7 +6,6 @@ tests/cases/conformance/externalModules/foo_1.ts(2,17): error TS2345: Argument o var x = new foo(true); // Should error ~~~~ !!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type '{ a: string; b: number; }'. -!!! error TS2345: Property 'a' is missing in type 'Boolean'. var y = new foo({a: "test", b: 42}); // Should be OK var z: number = y.test.b; ==== tests/cases/conformance/externalModules/foo_0.ts (0 errors) ==== diff --git a/tests/baselines/reference/functionCall7.errors.txt b/tests/baselines/reference/functionCall7.errors.txt index 19e572fa58ddd..576ea9c266e86 100644 --- a/tests/baselines/reference/functionCall7.errors.txt +++ b/tests/baselines/reference/functionCall7.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/functionCall7.ts(5,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/compiler/functionCall7.ts(6,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. - Property 'a' is missing in type 'Number'. tests/cases/compiler/functionCall7.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. @@ -15,7 +14,6 @@ tests/cases/compiler/functionCall7.ts(7,1): error TS2346: Supplied parameters do foo(4); ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'c1'. -!!! error TS2345: Property 'a' is missing in type 'Number'. foo(); ~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt index 7b3aa92828da4..d2299894c597d 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt +++ b/tests/baselines/reference/functionConstraintSatisfaction2.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(5,5): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Function'. - Property 'apply' is missing in type 'Number'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(6,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(7,1): error TS2346: Supplied parameters do not match any signature of call target. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(23,14): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. @@ -20,9 +19,11 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain Type 'F2' provides no match for the signature '(x: string): string' tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(37,10): error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. Type '() => void' is not assignable to type '(x: string) => string'. + Type 'void' is not assignable to type 'string'. tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts(38,10): error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. Type 'T' is not assignable to type '(x: string) => string'. Type '() => void' is not assignable to type '(x: string) => string'. + Type 'void' is not assignable to type 'string'. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts (13 errors) ==== @@ -33,7 +34,6 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain foo(1); ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Function'. -!!! error TS2345: Property 'apply' is missing in type 'Number'. foo(() => { }, 1); ~~~~~~~~~~~~~~~~~ !!! error TS2346: Supplied parameters do not match any signature of call target. @@ -97,10 +97,12 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstrain ~ !!! error TS2345: Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. !!! error TS2345: Type '() => void' is not assignable to type '(x: string) => string'. +!!! error TS2345: Type 'void' is not assignable to type 'string'. foo2(y); ~ !!! error TS2345: Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. !!! error TS2345: Type 'T' is not assignable to type '(x: string) => string'. !!! error TS2345: Type '() => void' is not assignable to type '(x: string) => string'. +!!! error TS2345: Type 'void' is not assignable to type 'string'. } \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt index 6ac3c9e670373..805bde82b640c 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts(11,26): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Date'. - Property 'toDateString' is missing in type 'Number'. ==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithConstraintsTypeArgumentInference2.ts (1 errors) ==== @@ -16,5 +15,4 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithCon var r4 = foo(1); // error ~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'Number'. var r5 = foo(new Date()); // no error \ No newline at end of file diff --git a/tests/baselines/reference/genericCombinators2.errors.txt b/tests/baselines/reference/genericCombinators2.errors.txt index d590f1030c316..5be717109c851 100644 --- a/tests/baselines/reference/genericCombinators2.errors.txt +++ b/tests/baselines/reference/genericCombinators2.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/genericCombinators2.ts(15,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. Type 'string' is not assignable to type 'Date'. - Property 'toDateString' is missing in type 'String'. tests/cases/compiler/genericCombinators2.ts(16,43): error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. Type 'string' is not assignable to type 'Date'. @@ -24,7 +23,6 @@ tests/cases/compiler/genericCombinators2.ts(16,43): error TS2345: Argument of ty ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. !!! error TS2345: Type 'string' is not assignable to type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'String'. var r5b = _.map(c2, rf1); ~~~ !!! error TS2345: Argument of type '(x: number, y: string) => string' is not assignable to parameter of type '(x: number, y: string) => Date'. diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt index 38818b59863a5..1e5e3b6ee9676 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. Types of property 'x' are incompatible. Type 'string' is not assignable to type '{ length: number; foo: number; }'. - Property 'foo' is missing in type 'String'. ==== tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts (1 errors) ==== @@ -20,5 +19,4 @@ tests/cases/compiler/genericDerivedTypeWithSpecializedBase2.ts(11,1): error TS23 !!! error TS2322: Type 'B' is not assignable to type 'A<{ length: number; foo: number; }>'. !!! error TS2322: Types of property 'x' are incompatible. !!! error TS2322: Type 'string' is not assignable to type '{ length: number; foo: number; }'. -!!! error TS2322: Property 'foo' is missing in type 'String'. \ No newline at end of file diff --git a/tests/baselines/reference/genericRestArgs.errors.txt b/tests/baselines/reference/genericRestArgs.errors.txt index 99106ebd7959e..8a97745295864 100644 --- a/tests/baselines/reference/genericRestArgs.errors.txt +++ b/tests/baselines/reference/genericRestArgs.errors.txt @@ -4,7 +4,6 @@ tests/cases/compiler/genericRestArgs.ts(5,34): error TS2345: Argument of type 's tests/cases/compiler/genericRestArgs.ts(10,12): error TS2453: The type argument for type parameter 'T' cannot be inferred from the usage. Consider specifying the type arguments explicitly. Type argument candidate 'number' is not a valid type argument because it is not a supertype of candidate 'string'. tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/genericRestArgs.ts (4 errors) ==== @@ -29,5 +28,4 @@ tests/cases/compiler/genericRestArgs.ts(12,30): error TS2345: Argument of type ' var a2Gb = makeArrayG(1, ""); var a2Gc = makeArrayG(1, ""); // error ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. -!!! error TS2345: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt index ba93c2ef1270a..81982ac3ec712 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.errors.txt +++ b/tests/baselines/reference/instanceSubtypeCheck2.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2415: Class 'C2' incorrectly extends base class 'C1'. Types of property 'x' are incompatible. Type 'string' is not assignable to type 'C2'. - Property 'x' is missing in type 'String'. ==== tests/cases/compiler/instanceSubtypeCheck2.ts (1 errors) ==== @@ -14,6 +13,5 @@ tests/cases/compiler/instanceSubtypeCheck2.ts(5,7): error TS2415: Class 'C2' !!! error TS2415: Class 'C2' incorrectly extends base class 'C1'. !!! error TS2415: Types of property 'x' are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'C2'. -!!! error TS2415: Property 'x' is missing in type 'String'. x: string } \ No newline at end of file diff --git a/tests/baselines/reference/intTypeCheck.errors.txt b/tests/baselines/reference/intTypeCheck.errors.txt index 3d805a65822fb..a860f5e360495 100644 --- a/tests/baselines/reference/intTypeCheck.errors.txt +++ b/tests/baselines/reference/intTypeCheck.errors.txt @@ -9,7 +9,6 @@ tests/cases/compiler/intTypeCheck.ts(101,5): error TS2322: Type 'Base' is not as tests/cases/compiler/intTypeCheck.ts(103,5): error TS2322: Type '() => void' is not assignable to type 'i1'. Property 'p' is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(106,5): error TS2322: Type 'boolean' is not assignable to type 'i1'. - Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(106,20): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(106,21): error TS2304: Cannot find name 'i1'. tests/cases/compiler/intTypeCheck.ts(107,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -38,7 +37,6 @@ tests/cases/compiler/intTypeCheck.ts(134,22): error TS2304: Cannot find name 'i3 tests/cases/compiler/intTypeCheck.ts(135,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(142,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(148,5): error TS2322: Type 'boolean' is not assignable to type 'i4'. - Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(148,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(148,22): error TS2304: Cannot find name 'i4'. tests/cases/compiler/intTypeCheck.ts(149,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -52,7 +50,6 @@ tests/cases/compiler/intTypeCheck.ts(157,5): error TS2322: Type 'Base' is not as tests/cases/compiler/intTypeCheck.ts(159,5): error TS2322: Type '() => void' is not assignable to type 'i5'. Property 'p' is missing in type '() => void'. tests/cases/compiler/intTypeCheck.ts(162,5): error TS2322: Type 'boolean' is not assignable to type 'i5'. - Property 'p' is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(162,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(162,22): error TS2304: Cannot find name 'i5'. tests/cases/compiler/intTypeCheck.ts(163,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -83,7 +80,6 @@ tests/cases/compiler/intTypeCheck.ts(190,22): error TS2304: Cannot find name 'i7 tests/cases/compiler/intTypeCheck.ts(191,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(198,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. tests/cases/compiler/intTypeCheck.ts(204,5): error TS2322: Type 'boolean' is not assignable to type 'i8'. - Index signature is missing in type 'Boolean'. tests/cases/compiler/intTypeCheck.ts(204,21): error TS1109: Expression expected. tests/cases/compiler/intTypeCheck.ts(204,22): error TS2304: Cannot find name 'i8'. tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. @@ -215,7 +211,6 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj9: i1 = new anyVar; ~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i1'. -!!! error TS2322: Property 'p' is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~ @@ -307,7 +302,6 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj42: i4 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i4'. -!!! error TS2322: Index signature is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~ @@ -344,7 +338,6 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj53: i5 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i5'. -!!! error TS2322: Property 'p' is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~ @@ -439,7 +432,6 @@ tests/cases/compiler/intTypeCheck.ts(205,17): error TS2351: Cannot use 'new' wit var obj86: i8 = new anyVar; ~~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'i8'. -!!! error TS2322: Index signature is missing in type 'Boolean'. ~ !!! error TS1109: Expression expected. ~~ diff --git a/tests/baselines/reference/interfaceImplementation7.errors.txt b/tests/baselines/reference/interfaceImplementation7.errors.txt index b297015dfbeea..1025a1f5296e6 100644 --- a/tests/baselines/reference/interfaceImplementation7.errors.txt +++ b/tests/baselines/reference/interfaceImplementation7.errors.txt @@ -4,7 +4,6 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' Types of property 'name' are incompatible. Type '() => string' is not assignable to type '() => { s: string; n: number; }'. Type 'string' is not assignable to type '{ s: string; n: number; }'. - Property 's' is missing in type 'String'. ==== tests/cases/compiler/interfaceImplementation7.ts (2 errors) ==== @@ -23,7 +22,6 @@ tests/cases/compiler/interfaceImplementation7.ts(7,7): error TS2420: Class 'C1' !!! error TS2420: Types of property 'name' are incompatible. !!! error TS2420: Type '() => string' is not assignable to type '() => { s: string; n: number; }'. !!! error TS2420: Type 'string' is not assignable to type '{ s: string; n: number; }'. -!!! error TS2420: Property 's' is missing in type 'String'. public name(): string { return ""; } } \ No newline at end of file diff --git a/tests/baselines/reference/intersectionAndUnionTypes.errors.txt b/tests/baselines/reference/intersectionAndUnionTypes.errors.txt index 4f26cc63ba3f2..d4526c815c4bd 100644 --- a/tests/baselines/reference/intersectionAndUnionTypes.errors.txt +++ b/tests/baselines/reference/intersectionAndUnionTypes.errors.txt @@ -1,5 +1,6 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(19,1): error TS2322: Type 'A' is not assignable to type 'A & B'. Type 'A' is not assignable to type 'B'. + Property 'b' is missing in type 'A'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(20,1): error TS2322: Type 'B' is not assignable to type 'A & B'. Type 'B' is not assignable to type 'A'. Property 'a' is missing in type 'B'. @@ -7,26 +8,32 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(23,1): e Type 'A' is not assignable to type '(A & B) | (C & D)'. Type 'A' is not assignable to type 'C & D'. Type 'A' is not assignable to type 'C'. + Property 'c' is missing in type 'A'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(25,1): error TS2322: Type 'C | D' is not assignable to type '(A & B) | (C & D)'. Type 'C' is not assignable to type '(A & B) | (C & D)'. Type 'C' is not assignable to type 'C & D'. Type 'C' is not assignable to type 'D'. + Property 'd' is missing in type 'C'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(26,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A & B'. Type 'C & D' is not assignable to type 'A & B'. Type 'C & D' is not assignable to type 'A'. Type 'D' is not assignable to type 'A'. + Property 'a' is missing in type 'D'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(27,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A | B'. Type 'C & D' is not assignable to type 'A | B'. Type 'C & D' is not assignable to type 'B'. Type 'D' is not assignable to type 'B'. + Property 'b' is missing in type 'D'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(28,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C & D'. Type 'A & B' is not assignable to type 'C & D'. Type 'A & B' is not assignable to type 'C'. Type 'B' is not assignable to type 'C'. + Property 'c' is missing in type 'B'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(29,1): error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C | D'. Type 'A & B' is not assignable to type 'C | D'. Type 'A & B' is not assignable to type 'D'. Type 'B' is not assignable to type 'D'. + Property 'd' is missing in type 'B'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(31,1): error TS2322: Type 'A & B' is not assignable to type '(A | B) & (C | D)'. Type 'A & B' is not assignable to type 'C | D'. Type 'A & B' is not assignable to type 'D'. @@ -35,6 +42,7 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(32,1): e Type 'A' is not assignable to type '(A | B) & (C | D)'. Type 'A' is not assignable to type 'C | D'. Type 'A' is not assignable to type 'D'. + Property 'd' is missing in type 'A'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(33,1): error TS2322: Type 'C & D' is not assignable to type '(A | B) & (C | D)'. Type 'C & D' is not assignable to type 'A | B'. Type 'C & D' is not assignable to type 'B'. @@ -43,14 +51,17 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(34,1): e Type 'C' is not assignable to type '(A | B) & (C | D)'. Type 'C' is not assignable to type 'A | B'. Type 'C' is not assignable to type 'B'. + Property 'b' is missing in type 'C'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(35,1): error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'A & B'. Type '(A | B) & (C | D)' is not assignable to type 'A'. Type 'C | D' is not assignable to type 'A'. Type 'C' is not assignable to type 'A'. + Property 'a' is missing in type 'C'. tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'C & D'. Type '(A | B) & (C | D)' is not assignable to type 'C'. Type 'C | D' is not assignable to type 'C'. Type 'D' is not assignable to type 'C'. + Property 'c' is missing in type 'D'. ==== tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts (14 errors) ==== @@ -76,6 +87,7 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e ~~~ !!! error TS2322: Type 'A' is not assignable to type 'A & B'. !!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'b' is missing in type 'A'. anb = b; ~~~ !!! error TS2322: Type 'B' is not assignable to type 'A & B'. @@ -89,6 +101,7 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type 'A' is not assignable to type '(A & B) | (C & D)'. !!! error TS2322: Type 'A' is not assignable to type 'C & D'. !!! error TS2322: Type 'A' is not assignable to type 'C'. +!!! error TS2322: Property 'c' is missing in type 'A'. x = cnd; // Ok x = cod; ~ @@ -96,30 +109,35 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type 'C' is not assignable to type '(A & B) | (C & D)'. !!! error TS2322: Type 'C' is not assignable to type 'C & D'. !!! error TS2322: Type 'C' is not assignable to type 'D'. +!!! error TS2322: Property 'd' is missing in type 'C'. anb = x; ~~~ !!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A & B'. !!! error TS2322: Type 'C & D' is not assignable to type 'A & B'. !!! error TS2322: Type 'C & D' is not assignable to type 'A'. !!! error TS2322: Type 'D' is not assignable to type 'A'. +!!! error TS2322: Property 'a' is missing in type 'D'. aob = x; ~~~ !!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'A | B'. !!! error TS2322: Type 'C & D' is not assignable to type 'A | B'. !!! error TS2322: Type 'C & D' is not assignable to type 'B'. !!! error TS2322: Type 'D' is not assignable to type 'B'. +!!! error TS2322: Property 'b' is missing in type 'D'. cnd = x; ~~~ !!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C & D'. !!! error TS2322: Type 'A & B' is not assignable to type 'C & D'. !!! error TS2322: Type 'A & B' is not assignable to type 'C'. !!! error TS2322: Type 'B' is not assignable to type 'C'. +!!! error TS2322: Property 'c' is missing in type 'B'. cod = x; ~~~ !!! error TS2322: Type '(A & B) | (C & D)' is not assignable to type 'C | D'. !!! error TS2322: Type 'A & B' is not assignable to type 'C | D'. !!! error TS2322: Type 'A & B' is not assignable to type 'D'. !!! error TS2322: Type 'B' is not assignable to type 'D'. +!!! error TS2322: Property 'd' is missing in type 'B'. y = anb; ~ @@ -133,6 +151,7 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type 'A' is not assignable to type '(A | B) & (C | D)'. !!! error TS2322: Type 'A' is not assignable to type 'C | D'. !!! error TS2322: Type 'A' is not assignable to type 'D'. +!!! error TS2322: Property 'd' is missing in type 'A'. y = cnd; ~ !!! error TS2322: Type 'C & D' is not assignable to type '(A | B) & (C | D)'. @@ -145,12 +164,14 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type 'C' is not assignable to type '(A | B) & (C | D)'. !!! error TS2322: Type 'C' is not assignable to type 'A | B'. !!! error TS2322: Type 'C' is not assignable to type 'B'. +!!! error TS2322: Property 'b' is missing in type 'C'. anb = y; ~~~ !!! error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'A & B'. !!! error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'A'. !!! error TS2322: Type 'C | D' is not assignable to type 'A'. !!! error TS2322: Type 'C' is not assignable to type 'A'. +!!! error TS2322: Property 'a' is missing in type 'C'. aob = y; // Ok cnd = y; ~~~ @@ -158,5 +179,6 @@ tests/cases/conformance/types/intersection/intersectionAndUnionTypes.ts(37,1): e !!! error TS2322: Type '(A | B) & (C | D)' is not assignable to type 'C'. !!! error TS2322: Type 'C | D' is not assignable to type 'C'. !!! error TS2322: Type 'D' is not assignable to type 'C'. +!!! error TS2322: Property 'c' is missing in type 'D'. cod = y; // Ok \ No newline at end of file diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index 84ced22611355..99d32aff9bc96 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -3,9 +3,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(4, tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(5,5): error TS2322: Type 'boolean' is not assignable to type 'void'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9,5): error TS2322: Type 'boolean' is not assignable to type 'E'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C'. - Property 'foo' is missing in type 'Boolean'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. - Property 'bar' is missing in type 'Boolean'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'. @@ -35,13 +33,11 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 var f: C = x; ~ !!! error TS2322: Type 'boolean' is not assignable to type 'C'. -!!! error TS2322: Property 'foo' is missing in type 'Boolean'. interface I { bar: string } var g: I = x; ~ !!! error TS2322: Type 'boolean' is not assignable to type 'I'. -!!! error TS2322: Property 'bar' is missing in type 'Boolean'. var h: { (): string } = x; ~ diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index 7eb5e6cb89729..fd8acaba03234 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -2,13 +2,9 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(3,5) tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(4,5): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(5,5): error TS2322: Type 'number' is not assignable to type 'void'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5): error TS2322: Type 'number' is not assignable to type 'C'. - Property 'foo' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I'. - Property 'bar' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. - Property 'baz' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. - Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2322: Type 'number' is not assignable to type 'T'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -32,22 +28,18 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 var e: C = x; ~ !!! error TS2322: Type 'number' is not assignable to type 'C'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. interface I { bar: string; } var f: I = x; ~ !!! error TS2322: Type 'number' is not assignable to type 'I'. -!!! error TS2322: Property 'bar' is missing in type 'Number'. var g: { baz: string } = 1; ~ !!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. -!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidStringAssignments.errors.txt b/tests/baselines/reference/invalidStringAssignments.errors.txt index e67106bef9203..d7ac2134dc18c 100644 --- a/tests/baselines/reference/invalidStringAssignments.errors.txt +++ b/tests/baselines/reference/invalidStringAssignments.errors.txt @@ -2,13 +2,9 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(3,5) tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(4,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(5,5): error TS2322: Type 'string' is not assignable to type 'void'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5): error TS2322: Type 'string' is not assignable to type 'C'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I'. - Property 'bar' is missing in type 'String'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. - Property 'baz' is missing in type 'Number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. - Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -33,22 +29,18 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 var e: C = x; ~ !!! error TS2322: Type 'string' is not assignable to type 'C'. -!!! error TS2322: Property 'foo' is missing in type 'String'. interface I { bar: string; } var f: I = x; ~ !!! error TS2322: Type 'string' is not assignable to type 'I'. -!!! error TS2322: Property 'bar' is missing in type 'String'. var g: { baz: string } = 1; ~ !!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. -!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index 9c6be972d3b43..af8cec62672a3 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -4,9 +4,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(5,5): er tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): error TS2322: Type 'void' is not assignable to type 'C'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2322: Type 'void' is not assignable to type 'I'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. - Property 'baz' is missing in type 'Number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. - Property '0' is missing in type 'Number'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2364: Invalid left-hand side of assignment expression. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2322: Type 'void' is not assignable to type 'T'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2364: Invalid left-hand side of assignment expression. @@ -42,11 +40,9 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e var g: { baz: string } = 1; ~ !!! error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. -!!! error TS2322: Property 'baz' is missing in type 'Number'. var g2: { 0: number } = 1; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. -!!! error TS2322: Property '0' is missing in type 'Number'. module M { export var x = 1; } M = x; diff --git a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt index d503f59c602d1..ab784eae39768 100644 --- a/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt +++ b/tests/baselines/reference/lastPropertyInLiteralWins.errors.txt @@ -1,6 +1,8 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(7,6): error TS2345: Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. Types of property 'thunk' are incompatible. Type '(num: number) => void' is not assignable to type '(str: string) => void'. + Types of parameters 'num' and 'str' are incompatible. + Type 'number' is not assignable to type 'string'. tests/cases/compiler/lastPropertyInLiteralWins.ts(8,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(9,5): error TS2300: Duplicate identifier 'thunk'. tests/cases/compiler/lastPropertyInLiteralWins.ts(13,5): error TS2300: Duplicate identifier 'thunk'. @@ -29,6 +31,8 @@ tests/cases/compiler/lastPropertyInLiteralWins.ts(14,5): error TS2300: Duplicate !!! error TS2345: Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. !!! error TS2345: Types of property 'thunk' are incompatible. !!! error TS2345: Type '(num: number) => void' is not assignable to type '(str: string) => void'. +!!! error TS2345: Types of parameters 'num' and 'str' are incompatible. +!!! error TS2345: Type 'number' is not assignable to type 'string'. test({ // Should be OK. Last 'thunk' is of correct type thunk: (num: number) => {}, diff --git a/tests/baselines/reference/maxConstraints.errors.txt b/tests/baselines/reference/maxConstraints.errors.txt index 03e7158f725cb..a7d07a5b5f218 100644 --- a/tests/baselines/reference/maxConstraints.errors.txt +++ b/tests/baselines/reference/maxConstraints.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. - Property 'compareTo' is missing in type 'Number'. ==== tests/cases/compiler/maxConstraints.ts (1 errors) ==== @@ -12,5 +11,4 @@ tests/cases/compiler/maxConstraints.ts(8,22): error TS2345: Argument of type 'nu var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; var maxResult = max2(1, 2); ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. -!!! error TS2345: Property 'compareTo' is missing in type 'Number'. \ No newline at end of file +!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'Comparable'. \ No newline at end of file diff --git a/tests/baselines/reference/numericIndexerConstraint1.errors.txt b/tests/baselines/reference/numericIndexerConstraint1.errors.txt index 42cf293fe60a4..0d4bb17002bbc 100644 --- a/tests/baselines/reference/numericIndexerConstraint1.errors.txt +++ b/tests/baselines/reference/numericIndexerConstraint1.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'number' is not assignable to type 'Foo'. - Property 'foo' is missing in type 'Number'. ==== tests/cases/compiler/numericIndexerConstraint1.ts (1 errors) ==== @@ -8,5 +7,4 @@ tests/cases/compiler/numericIndexerConstraint1.ts(3,5): error TS2322: Type 'numb var result: Foo = x["one"]; // error ~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'Foo'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt index c35e49f02a31f..f825c41631149 100644 --- a/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt +++ b/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt @@ -1,6 +1,7 @@ tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'. Index signatures are incompatible. Type 'A' is not assignable to type 'B'. + Property 'y' is missing in type 'A'. ==== tests/cases/compiler/objectLiteralIndexerErrors.ts (1 errors) ==== @@ -21,4 +22,5 @@ tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ !!! error TS2322: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'A' is not assignable to type 'B'. +!!! error TS2322: Property 'y' is missing in type 'A'. o1 = { x: c, 0: a }; // string indexer is any, number indexer is A \ No newline at end of file diff --git a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt index e1b0bb3452979..6f45030a6504b 100644 --- a/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt +++ b/tests/baselines/reference/parseClassDeclarationInStrictModeByDefaultInES6.errors.txt @@ -2,7 +2,6 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeBy tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(5,17): error TS1210: Invalid use of 'eval'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts(6,9): error TS2322: Type 'string' is not assignable to type 'IArguments'. - Property 'callee' is missing in type 'String'. ==== tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeByDefaultInES6.ts (4 errors) ==== @@ -20,6 +19,5 @@ tests/cases/conformance/es6/classDeclaration/parseClassDeclarationInStrictModeBy !!! error TS1210: Invalid use of 'arguments'. Class definitions are automatically in strict mode. ~~~~~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'IArguments'. -!!! error TS2322: Property 'callee' is missing in type 'String'. } } \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining1.errors.txt b/tests/baselines/reference/promiseChaining1.errors.txt index bd3e52fcc1c54..7396d03059aca 100644 --- a/tests/baselines/reference/promiseChaining1.errors.txt +++ b/tests/baselines/reference/promiseChaining1.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/promiseChaining1.ts(7,50): error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. Type 'string' is not assignable to type 'Function'. - Property 'apply' is missing in type 'String'. ==== tests/cases/compiler/promiseChaining1.ts (1 errors) ==== @@ -14,7 +13,6 @@ tests/cases/compiler/promiseChaining1.ts(7,50): error TS2345: Argument of type ' ~~~~~~~~~~ !!! error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. !!! error TS2345: Type 'string' is not assignable to type 'Function'. -!!! error TS2345: Property 'apply' is missing in type 'String'. return new Chain2(result); } } \ No newline at end of file diff --git a/tests/baselines/reference/promiseChaining2.errors.txt b/tests/baselines/reference/promiseChaining2.errors.txt index f12baebd4dca2..a31c4335da712 100644 --- a/tests/baselines/reference/promiseChaining2.errors.txt +++ b/tests/baselines/reference/promiseChaining2.errors.txt @@ -1,6 +1,5 @@ tests/cases/compiler/promiseChaining2.ts(7,45): error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. Type 'string' is not assignable to type 'Function'. - Property 'apply' is missing in type 'String'. ==== tests/cases/compiler/promiseChaining2.ts (1 errors) ==== @@ -14,7 +13,6 @@ tests/cases/compiler/promiseChaining2.ts(7,45): error TS2345: Argument of type ' ~~~~~~~~~~ !!! error TS2345: Argument of type '(x: S) => string' is not assignable to parameter of type '(x: S) => Function'. !!! error TS2345: Type 'string' is not assignable to type 'Function'. -!!! error TS2345: Property 'apply' is missing in type 'String'. return new Chain2(result); } } \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index a74938f5dd9df..4edfff05a5abc 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/promisePermutations.ts(74,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'IPromise'. - Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations.ts(79,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -157,7 +156,6 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2345: Argument of t !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'IPromise'. -!!! error TS2345: Property 'then' is missing in type 'Number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 8afceeae0fde8..dda9a08b38d6a 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/promisePermutations2.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'IPromise'. - Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations2.ts(78,19): error TS2345: Argument of type '(x: number, y?: string) => IPromise' is not assignable to parameter of type '(value: string) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'string'. @@ -156,7 +155,6 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'IPromise'. -!!! error TS2345: Property 'then' is missing in type 'Number'. var r4: IPromise; var sIPromise: (x: any) => IPromise; diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index b17021a02b919..c6c2bca62a446 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/promisePermutations3.ts(68,69): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'IPromise'. - Property 'then' is missing in type 'Number'. tests/cases/compiler/promisePermutations3.ts(73,70): error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. Types of parameters 'x' and 'value' are incompatible. Type 'number' is not assignable to type 'IPromise'. @@ -159,7 +158,6 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2345: Argument of type '(x: number) => IPromise' is not assignable to parameter of type '(value: IPromise) => IPromise'. !!! error TS2345: Types of parameters 'x' and 'value' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'IPromise'. -!!! error TS2345: Property 'then' is missing in type 'Number'. var s3: Promise; var s3a = s3.then(testFunction3, testFunction3, testFunction3); var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); diff --git a/tests/baselines/reference/qualify.errors.txt b/tests/baselines/reference/qualify.errors.txt index f38fc93ccde89..c3447664c963f 100644 --- a/tests/baselines/reference/qualify.errors.txt +++ b/tests/baselines/reference/qualify.errors.txt @@ -1,7 +1,5 @@ tests/cases/compiler/qualify.ts(21,13): error TS2322: Type 'number' is not assignable to type 'I'. - Property 'p' is missing in type 'Number'. tests/cases/compiler/qualify.ts(30,13): error TS2322: Type 'number' is not assignable to type 'I2'. - Property 'q' is missing in type 'Number'. tests/cases/compiler/qualify.ts(45,13): error TS2322: Type 'I4' is not assignable to type 'I3'. Property 'zeep' is missing in type 'I4'. tests/cases/compiler/qualify.ts(46,13): error TS2322: Type 'I4' is not assignable to type 'I3[]'. @@ -40,7 +38,6 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable var z:I=3; ~ !!! error TS2322: Type 'number' is not assignable to type 'I'. -!!! error TS2322: Property 'p' is missing in type 'Number'. export interface I2 { q; } @@ -52,7 +49,6 @@ tests/cases/compiler/qualify.ts(58,5): error TS2322: Type 'I' is not assignable var z:T.U.I2=3; ~ !!! error TS2322: Type 'number' is not assignable to type 'I2'. -!!! error TS2322: Property 'q' is missing in type 'Number'. } } diff --git a/tests/baselines/reference/restArgAssignmentCompat.errors.txt b/tests/baselines/reference/restArgAssignmentCompat.errors.txt index 2ea0739509939..c17d28cb28b8d 100644 --- a/tests/baselines/reference/restArgAssignmentCompat.errors.txt +++ b/tests/baselines/reference/restArgAssignmentCompat.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'number[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/compiler/restArgAssignmentCompat.ts (1 errors) ==== @@ -16,6 +15,5 @@ tests/cases/compiler/restArgAssignmentCompat.ts(7,1): error TS2322: Type '(...x: !!! error TS2322: Type '(...x: number[]) => void' is not assignable to type '(x: number[], y: string) => void'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'number[]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. n([4], 'foo'); \ No newline at end of file diff --git a/tests/baselines/reference/returnInConstructor1.errors.txt b/tests/baselines/reference/returnInConstructor1.errors.txt index dbe3b9e5ee882..30f629f9f8ad4 100644 --- a/tests/baselines/reference/returnInConstructor1.errors.txt +++ b/tests/baselines/reference/returnInConstructor1.errors.txt @@ -1,8 +1,6 @@ tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2322: Type 'number' is not assignable to type 'B'. - Property 'foo' is missing in type 'Number'. tests/cases/compiler/returnInConstructor1.ts(11,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2322: Type 'string' is not assignable to type 'D'. - Property 'foo' is missing in type 'String'. tests/cases/compiler/returnInConstructor1.ts(25,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/compiler/returnInConstructor1.ts(39,16): error TS2322: Type '{ foo: number; }' is not assignable to type 'F'. Types of property 'foo' are incompatible. @@ -28,7 +26,6 @@ tests/cases/compiler/returnInConstructor1.ts(55,16): error TS2409: Return type o return 1; // error ~ !!! error TS2322: Type 'number' is not assignable to type 'B'. -!!! error TS2322: Property 'foo' is missing in type 'Number'. ~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } @@ -47,7 +44,6 @@ tests/cases/compiler/returnInConstructor1.ts(55,16): error TS2409: Return type o return "test"; // error ~~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'D'. -!!! error TS2322: Property 'foo' is missing in type 'String'. ~~~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt index 5dd39e0ad639f..3f6de942d2597 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.errors.txt @@ -1,11 +1,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. Index signatures are incompatible. Type 'string' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Index signatures are incompatible. Type 'string' is not assignable to type 'Base'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(20,23): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithNumericIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. @@ -29,7 +27,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Index signatures are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Derived'. -!!! error TS2415: Property 'bar' is missing in type 'String'. [x: number]: string; // error } @@ -43,7 +40,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Index signatures are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Base'. -!!! error TS2415: Property 'foo' is missing in type 'String'. ~~~~ !!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. !!! error TS2344: Property 'bar' is missing in type 'Base'. diff --git a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt index e292c0867a763..a5d4152b45113 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers.errors.txt @@ -1,7 +1,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(12,7): error TS2415: Class 'B' incorrectly extends base class 'A'. Types of property 'bar' are incompatible. Type 'string' is not assignable to type 'Base'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers.ts(22,7): error TS2415: Class 'B2' incorrectly extends base class 'A2'. Types of property '2.0' are incompatible. Type 'string' is not assignable to type 'Base'. @@ -36,7 +35,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Types of property 'bar' are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Base'. -!!! error TS2415: Property 'foo' is missing in type 'String'. foo: Derived; // ok bar: string; // error } diff --git a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt index 3d46a6e5dc219..cdcc54c5ee9cb 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt +++ b/tests/baselines/reference/subtypingWithObjectMembers2.errors.txt @@ -1,7 +1,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(17,15): error TS2430: Interface 'B' incorrectly extends interface 'A'. Types of property 'bar' are incompatible. Type 'string' is not assignable to type 'Base'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithObjectMembers2.ts(27,15): error TS2430: Interface 'B2' incorrectly extends interface 'A2'. Types of property '2.0' are incompatible. Type 'string' is not assignable to type 'Base'. @@ -41,7 +40,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2430: Interface 'B' incorrectly extends interface 'A'. !!! error TS2430: Types of property 'bar' are incompatible. !!! error TS2430: Type 'string' is not assignable to type 'Base'. -!!! error TS2430: Property 'foo' is missing in type 'String'. foo: Derived; // ok bar: string; // error } diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt index 4aa889444e5c3..8d4328cdd2dba 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt +++ b/tests/baselines/reference/subtypingWithStringIndexer4.errors.txt @@ -1,11 +1,9 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(11,7): error TS2415: Class 'B' incorrectly extends base class 'A'. Index signatures are incompatible. Type 'string' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,11): error TS2415: Class 'B' incorrectly extends base class 'A'. Index signatures are incompatible. Type 'string' is not assignable to type 'Base'. - Property 'foo' is missing in type 'String'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(20,23): error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. Property 'bar' is missing in type 'Base'. tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingWithStringIndexer4.ts(24,11): error TS2415: Class 'B3' incorrectly extends base class 'A'. @@ -29,7 +27,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Index signatures are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Derived'. -!!! error TS2415: Property 'bar' is missing in type 'String'. [x: string]: string; // error } @@ -43,7 +40,6 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypingW !!! error TS2415: Class 'B' incorrectly extends base class 'A'. !!! error TS2415: Index signatures are incompatible. !!! error TS2415: Type 'string' is not assignable to type 'Base'. -!!! error TS2415: Property 'foo' is missing in type 'String'. ~~~~ !!! error TS2344: Type 'Base' does not satisfy the constraint 'Derived'. !!! error TS2344: Property 'bar' is missing in type 'Base'. diff --git a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt index d7cf5e83b8f5a..1131b6e1a68cd 100644 --- a/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt +++ b/tests/baselines/reference/typeArgumentConstraintResolution1.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(4,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. - Property 'toDateString' is missing in type 'String'. tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. @@ -10,7 +9,6 @@ tests/cases/compiler/typeArgumentConstraintResolution1.ts(11,12): error TS2345: foo1(""); // should error ~~ !!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'Date'. -!!! error TS2345: Property 'toDateString' is missing in type 'String'. diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index e1fdf303870ec..ca02a07396a20 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -27,7 +27,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(96,9): tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(97,16): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(98,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2322: Type 'boolean' is not assignable to type 'D'. - Property 'm1' is missing in type 'Boolean'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(105,16): error TS2409: Return type of constructor signature must be assignable to the instance type of the class tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(107,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(110,20): error TS1228: A type predicate is only allowed in return type position for functions and methods. @@ -198,7 +197,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(137,39 return true; ~~~~ !!! error TS2322: Type 'boolean' is not assignable to type 'D'. -!!! error TS2322: Property 'm1' is missing in type 'Boolean'. ~~~~ !!! error TS2409: Return type of constructor signature must be assignable to the instance type of the class } diff --git a/tests/baselines/reference/typeName1.errors.txt b/tests/baselines/reference/typeName1.errors.txt index 84c8be360bd16..152a5b951e7bc 100644 --- a/tests/baselines/reference/typeName1.errors.txt +++ b/tests/baselines/reference/typeName1.errors.txt @@ -1,31 +1,19 @@ tests/cases/compiler/typeName1.ts(9,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. - Property 'f' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(10,5): error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. - Property 'f' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(11,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. tests/cases/compiler/typeName1.ts(12,5): error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. - Property 'x' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(13,5): error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. - Property 'x' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. - Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(15,5): error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. tests/cases/compiler/typeName1.ts(16,5): error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. - Property 'z' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(16,10): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. tests/cases/compiler/typeName1.ts(17,5): error TS2322: Type 'number' is not assignable to type 'I'. - Property 'k' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(18,5): error TS2322: Type 'number' is not assignable to type 'I[][][][]'. - Property 'length' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(19,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. - Property 'length' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(20,5): error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. - Property 'length' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(20,50): error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. tests/cases/compiler/typeName1.ts(21,5): error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. - Property 'x' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(22,5): error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. - Property 'f' is missing in type 'Number'. tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not assignable to type 'number'. @@ -41,61 +29,49 @@ tests/cases/compiler/typeName1.ts(23,5): error TS2322: Type 'typeof C' is not as var x1:{ f(s:string):number;f(n:number):string; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; f(n: number): string; }'. -!!! error TS2322: Property 'f' is missing in type 'Number'. var x2:{ f(s:string):number; } =3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ f(s: string): number; }'. -!!! error TS2322: Property 'f' is missing in type 'Number'. var x3:{ (s:string):number;(n:number):string; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; }'. var x4:{ x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -!!! error TS2322: Property 'x' is missing in type 'Number'. var x5:{ (s:string):number;(n:number):string;x;y;z:number;f(n:number):string;f(s:string):number; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ (s: string): number; (n: number): string; x: any; y: any; z: number; f(n: number): string; f(s: string): number; }'. -!!! error TS2322: Property 'x' is missing in type 'Number'. var x6:{ z:number;f:{(n:number):string;(s:string):number;}; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ z: number; f: { (n: number): string; (s: string): number; }; }'. -!!! error TS2322: Property 'z' is missing in type 'Number'. var x7:(s:string)=>boolean=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '(s: string) => boolean'. var x8:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; }=3; ~~ !!! error TS2322: Type 'number' is not assignable to type '{ (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }'. -!!! error TS2322: Property 'z' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x9:I=3; ~~ !!! error TS2322: Type 'number' is not assignable to type 'I'. -!!! error TS2322: Property 'k' is missing in type 'Number'. var x10:I[][][][]=3; ~~~ !!! error TS2322: Type 'number' is not assignable to type 'I[][][][]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. var x11:{z:I;x:boolean;}[][]=3; ~~~ !!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; }[][]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. var x12:{z:I;x:boolean;y:(s:string)=>boolean;w:{ z:I;[s:string]:{ x; y; };[n:number]:{x; y;};():boolean; };}[][]=3; ~~~ !!! error TS2322: Type 'number' is not assignable to type '{ z: I; x: boolean; y: (s: string) => boolean; w: { (): boolean; [s: string]: { x: any; y: any; }; [n: number]: { x: any; y: any; }; z: I; }; }[][]'. -!!! error TS2322: Property 'length' is missing in type 'Number'. ~~~~ !!! error TS2411: Property 'z' of type 'I' is not assignable to string index type '{ x: any; y: any; }'. var x13:{ new(): number; new(n:number):number; x: string; w: {y: number;}; (): {}; } = 3; ~~~ !!! error TS2322: Type 'number' is not assignable to type '{ (): {}; new (): number; new (n: number): number; x: string; w: { y: number; }; }'. -!!! error TS2322: Property 'x' is missing in type 'Number'. var x14:{ f(x:number):boolean; p; q; ():string; }=3; ~~~ !!! error TS2322: Type 'number' is not assignable to type '{ (): string; f(x: number): boolean; p: any; q: any; }'. -!!! error TS2322: Property 'f' is missing in type 'Number'. var x15:number=C; ~~~ !!! error TS2322: Type 'typeof C' is not assignable to type 'number'. diff --git a/tests/baselines/reference/typeOfOnTypeArg.errors.txt b/tests/baselines/reference/typeOfOnTypeArg.errors.txt index 8562b7f134ad8..46b48983f218a 100644 --- a/tests/baselines/reference/typeOfOnTypeArg.errors.txt +++ b/tests/baselines/reference/typeOfOnTypeArg.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type 'number' is not assignable to parameter of type '{ '': number; }'. - Property '''' is missing in type 'Number'. ==== tests/cases/compiler/typeOfOnTypeArg.ts (1 errors) ==== @@ -12,5 +11,4 @@ tests/cases/compiler/typeOfOnTypeArg.ts(7,6): error TS2345: Argument of type 'nu fill(32); ~~ !!! error TS2345: Argument of type 'number' is not assignable to parameter of type '{ '': number; }'. -!!! error TS2345: Property '''' is missing in type 'Number'. \ No newline at end of file diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt index 282e942e0f733..0e148cb568942 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.errors.txt @@ -10,7 +10,6 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTy tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts(18,10): error TS2345: Argument of type 'string[]' is not assignable to parameter of type '{ length: any[]; }'. Types of property 'length' are incompatible. Type 'number' is not assignable to type 'any[]'. - Property 'length' is missing in type 'Number'. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTypeParameterConstraint2.ts (6 errors) ==== @@ -49,5 +48,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/typeParameterAsTy ~~~~ !!! error TS2345: Argument of type 'string[]' is not assignable to parameter of type '{ length: any[]; }'. !!! error TS2345: Types of property 'length' are incompatible. -!!! error TS2345: Type 'number' is not assignable to type 'any[]'. -!!! error TS2345: Property 'length' is missing in type 'Number'. \ No newline at end of file +!!! error TS2345: Type 'number' is not assignable to type 'any[]'. \ No newline at end of file diff --git a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt index 5afc7361a2358..da97e05713bbc 100644 --- a/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt +++ b/tests/baselines/reference/wrappedRecursiveGenericType.errors.txt @@ -1,5 +1,4 @@ tests/cases/compiler/wrappedRecursiveGenericType.ts(13,1): error TS2322: Type 'number' is not assignable to type 'X'. - Property 'e' is missing in type 'Number'. tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2322: Type 'number' is not assignable to type 'X'. @@ -19,7 +18,6 @@ tests/cases/compiler/wrappedRecursiveGenericType.ts(14,1): error TS2322: Type 'n x.a.b.val = 5; // val -> X (This should be an error) ~~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'X'. -!!! error TS2322: Property 'e' is missing in type 'Number'. x.a.b.a.val = 5; // val -> X (This should be an error) ~~~~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'X'. \ No newline at end of file From 6e0fde37f8a39aa2a52ca4a1cc9d1bdea214024c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 13 Jan 2016 23:19:49 -0800 Subject: [PATCH 08/11] Added missing semicolon. --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 28748805ffaae..ffcd24068310a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5096,7 +5096,7 @@ namespace ts { return result !== Ternary.False; function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void { - Debug.assert(!!errorNode) + Debug.assert(!!errorNode); errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); } From 17ff54d09b33b0eee3a997857c747fbcb4e1da7f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 14 Jan 2016 10:54:08 -0800 Subject: [PATCH 09/11] Just check if the original type is a primitive instead of checking the apparent type. --- src/compiler/checker.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ffcd24068310a..6414d4d87e10a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -419,14 +419,6 @@ namespace ts { return node.kind === SyntaxKind.SourceFile && !isExternalOrCommonJsModule(node); } - /** Is this type one of the apparent types created from the primitive types. */ - function isPrimitiveApparentType(type: Type): boolean { - return type === globalStringType || - type === globalNumberType || - type === globalBooleanType || - type === globalESSymbolType; - } - function getSymbol(symbols: SymbolTable, name: string, meaning: SymbolFlags): Symbol { if (meaning && hasProperty(symbols, name)) { const symbol = symbols[name]; @@ -5234,16 +5226,16 @@ namespace ts { } // Even if relationship doesn't hold for unions, intersections, or generic type references, // it may hold in a structural comparison. - const apparentType = getApparentType(source); + const apparentSource = getApparentType(source); // In a check of the form X = A & B, we will have previously checked if A relates to X or B relates // to X. Failing both of those we want to check if the aggregation of A and B's members structurally // relates to X. Thus, we include intersection types on the source side here. - if (apparentType.flags & (TypeFlags.ObjectType | TypeFlags.Intersection) && target.flags & TypeFlags.ObjectType) { + if (apparentSource.flags & (TypeFlags.ObjectType | TypeFlags.Intersection) && target.flags & TypeFlags.ObjectType) { // Report structural errors only if we haven't reported any errors yet - const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !isPrimitiveApparentType(apparentType) + const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & TypeFlags.Primitive) ? ReportErrors.Elaborate : ReportErrors.None; - if (result = objectTypeRelatedTo(apparentType, source, target, reportStructuralErrors)) { + if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; } From e8d4cf82314e367a55310f8adcbd10131f62efb9 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 14 Jan 2016 11:01:21 -0800 Subject: [PATCH 10/11] Documented the 'ReportErrors' enum. --- src/compiler/checker.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6414d4d87e10a..4a73e0710614f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3,8 +3,20 @@ /* @internal */ namespace ts { const enum ReportErrors { - None = 0, + /** + * Do not report errors at all. + */ + None, + /** + * Report errors in any fashion if any are encountered. + * This option implies that if an error has already been cached for a relationship + * between two types, it is okay to use the top-level error without elaboration. + */ Basic, + /** + * Always force elaboration when comparing two types, + * even if the relation has been cached + */ Elaborate, } From 273cfc1cd787b0a15d0fa6b608e6d7edd6c4d366 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 14 Jan 2016 11:33:05 -0800 Subject: [PATCH 11/11] Back to booleans. I totally have an infinite amount of time to work on this. --- src/compiler/checker.ts | 98 +++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 63 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4a73e0710614f..2ce41bb48788d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2,24 +2,6 @@ /* @internal */ namespace ts { - const enum ReportErrors { - /** - * Do not report errors at all. - */ - None, - /** - * Report errors in any fashion if any are encountered. - * This option implies that if an error has already been cached for a relationship - * between two types, it is okay to use the top-level error without elaboration. - */ - Basic, - /** - * Always force elaboration when comparing two types, - * even if the relation has been cached - */ - Elaborate, - } - let nextSymbolId = 1; let nextNodeId = 1; let nextMergeId = 1; @@ -4937,7 +4919,7 @@ namespace ts { function isSignatureAssignableTo(source: Signature, target: Signature, ignoreReturnTypes: boolean): boolean { - return compareSignaturesRelated(source, target, ignoreReturnTypes, ReportErrors.None, /*errorReporter*/ undefined, compareTypesAssignable) !== Ternary.False; + return compareSignaturesRelated(source, target, ignoreReturnTypes, /*reportErrors*/ false, /*errorReporter*/ undefined, compareTypesAssignable) !== Ternary.False; } /** @@ -4946,9 +4928,9 @@ namespace ts { function compareSignaturesRelated(source: Signature, target: Signature, ignoreReturnTypes: boolean, - reportErrors: ReportErrors, + reportErrors: boolean, errorReporter: (d: DiagnosticMessage, arg0?: string, arg1?: string) => void, - compareTypes: (s: Type, t: Type, reportErrors?: ReportErrors) => Ternary): Ternary { + compareTypes: (s: Type, t: Type, reportErrors?: boolean) => Ternary): Ternary { // TODO (drosen): De-duplicate code between related functions. if (source === target) { return Ternary.True; @@ -4972,7 +4954,7 @@ namespace ts { for (let i = 0; i < checkCount; i++) { const s = i < sourceMax ? getTypeOfSymbol(sourceParams[i]) : getRestTypeOfSignature(source); const t = i < targetMax ? getTypeOfSymbol(targetParams[i]) : getRestTypeOfSignature(target); - const related = compareTypes(t, s, /*reportErrors*/ ReportErrors.None) || compareTypes(s, t, reportErrors); + const related = compareTypes(t, s, /*reportErrors*/ false) || compareTypes(s, t, reportErrors); if (!related) { if (reportErrors) { errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, @@ -5078,19 +5060,11 @@ namespace ts { Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - const result = isRelatedTo(source, target, !!errorNode ? ReportErrors.Basic : ReportErrors.None, headMessage); + const result = isRelatedTo(source, target, /*reportErrors*/ !!errorNode, headMessage); if (overflow) { error(errorNode, Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); } else if (errorInfo) { - // If we already computed this relation, but in a context where we didn't want to report errors (e.g. overload resolution), - // then we'll only have a top-level error (e.g. 'Class X does not implement interface Y') without any details. If this happened, - // request a recompuation to get a complete error message. This will be skipped if we've already done this computation in a context - // where errors were being reported. - if (errorInfo.next === undefined) { - errorInfo = undefined; - isRelatedTo(source, target, !!errorNode ? ReportErrors.Elaborate : ReportErrors.None, headMessage); - } if (containingMessageChain) { errorInfo = concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); } @@ -5118,7 +5092,7 @@ namespace ts { // Ternary.True if they are related with no assumptions, // Ternary.Maybe if they are related with assumptions of other relationships, or // Ternary.False if they are not related. - function isRelatedTo(source: Type, target: Type, reportErrors?: ReportErrors, headMessage?: DiagnosticMessage): Ternary { + function isRelatedTo(source: Type, target: Type, reportErrors?: boolean, headMessage?: DiagnosticMessage): Ternary { let result: Ternary; // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return Ternary.True; @@ -5206,7 +5180,7 @@ namespace ts { // A & B = (A & B) | (C & D). if (source.flags & TypeFlags.Intersection) { // If target is a union type the following check will report errors so we suppress them here - if (result = someTypeRelatedToType(source, target, !(target.flags & TypeFlags.Union) ? reportErrors : ReportErrors.None)) { + if (result = someTypeRelatedToType(source, target, reportErrors && !(target.flags & TypeFlags.Union))) { return result; } } @@ -5223,7 +5197,7 @@ namespace ts { constraint = emptyObjectType; } // Report constraint errors only if the constraint is not the empty object type - const reportConstraintErrors = constraint !== emptyObjectType ? reportErrors : ReportErrors.None; + const reportConstraintErrors = reportErrors && constraint !== emptyObjectType; if (result = isRelatedTo(constraint, target, reportConstraintErrors)) { errorInfo = saveErrorInfo; return result; @@ -5244,9 +5218,7 @@ namespace ts { // relates to X. Thus, we include intersection types on the source side here. if (apparentSource.flags & (TypeFlags.ObjectType | TypeFlags.Intersection) && target.flags & TypeFlags.ObjectType) { // Report structural errors only if we haven't reported any errors yet - const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & TypeFlags.Primitive) - ? ReportErrors.Elaborate - : ReportErrors.None; + const reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo && !(source.flags & TypeFlags.Primitive); if (result = objectTypeRelatedTo(apparentSource, source, target, reportStructuralErrors)) { errorInfo = saveErrorInfo; return result; @@ -5265,11 +5237,11 @@ namespace ts { if (source.flags & TypeFlags.ObjectType && target.flags & TypeFlags.ObjectType) { if (source.flags & TypeFlags.Reference && target.flags & TypeFlags.Reference && (source).target === (target).target) { // We have type references to same target type, see if all type arguments are identical - if (result = typeArgumentsRelatedTo(source, target, ReportErrors.None)) { + if (result = typeArgumentsRelatedTo(source, target, /*reportErrors*/ false)) { return result; } } - return objectTypeRelatedTo(source, source, target, ReportErrors.None); + return objectTypeRelatedTo(source, source, target, /*reportErrors*/ false); } if (source.flags & TypeFlags.Union && target.flags & TypeFlags.Union || source.flags & TypeFlags.Intersection && target.flags & TypeFlags.Intersection) { @@ -5304,7 +5276,7 @@ namespace ts { return false; } - function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: ReportErrors): boolean { + function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: boolean): boolean { if (!(target.flags & TypeFlags.ObjectLiteralPatternWithComputedProperties) && someConstituentTypeHasKind(target, TypeFlags.ObjectType)) { for (const prop of getPropertiesOfObjectType(source)) { if (!isKnownProperty(target, prop.name)) { @@ -5328,7 +5300,7 @@ namespace ts { let result = Ternary.True; const sourceTypes = source.types; for (const sourceType of sourceTypes) { - const related = typeRelatedToSomeType(sourceType, target, ReportErrors.None); + const related = typeRelatedToSomeType(sourceType, target, /*reportErrors*/ false); if (!related) { return Ternary.False; } @@ -5337,10 +5309,10 @@ namespace ts { return result; } - function typeRelatedToSomeType(source: Type, target: UnionOrIntersectionType, reportErrors: ReportErrors): Ternary { + function typeRelatedToSomeType(source: Type, target: UnionOrIntersectionType, reportErrors: boolean): Ternary { const targetTypes = target.types; for (let i = 0, len = targetTypes.length; i < len; i++) { - const related = isRelatedTo(source, targetTypes[i], i === len - 1 ? reportErrors : ReportErrors.None); + const related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); if (related) { return related; } @@ -5348,7 +5320,7 @@ namespace ts { return Ternary.False; } - function typeRelatedToEachType(source: Type, target: UnionOrIntersectionType, reportErrors: ReportErrors): Ternary { + function typeRelatedToEachType(source: Type, target: UnionOrIntersectionType, reportErrors: boolean): Ternary { let result = Ternary.True; const targetTypes = target.types; for (const targetType of targetTypes) { @@ -5361,10 +5333,10 @@ namespace ts { return result; } - function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: ReportErrors): Ternary { + function someTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean): Ternary { const sourceTypes = source.types; for (let i = 0, len = sourceTypes.length; i < len; i++) { - const related = isRelatedTo(sourceTypes[i], target, i === len - 1 ? reportErrors : ReportErrors.None); + const related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1); if (related) { return related; } @@ -5372,7 +5344,7 @@ namespace ts { return Ternary.False; } - function eachTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: ReportErrors): Ternary { + function eachTypeRelatedToType(source: UnionOrIntersectionType, target: Type, reportErrors: boolean): Ternary { let result = Ternary.True; const sourceTypes = source.types; for (const sourceType of sourceTypes) { @@ -5385,7 +5357,7 @@ namespace ts { return result; } - function typeArgumentsRelatedTo(source: TypeReference, target: TypeReference, reportErrors: ReportErrors): Ternary { + function typeArgumentsRelatedTo(source: TypeReference, target: TypeReference, reportErrors: boolean): Ternary { const sources = source.typeArguments || emptyArray; const targets = target.typeArguments || emptyArray; if (sources.length !== targets.length && relation === identityRelation) { @@ -5408,14 +5380,14 @@ namespace ts { // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: ReportErrors): Ternary { + function objectTypeRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary { if (overflow) { return Ternary.False; } const id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; const related = relation[id]; if (related !== undefined) { - if (reportErrors === ReportErrors.Elaborate && related === RelationComparisonResult.Failed) { + if (reportErrors && related === RelationComparisonResult.Failed) { // We are elaborating errors and the cached result is an unreported failure. Record the result as a reported // failure and continue computing the relation such that errors get reported. relation[id] = RelationComparisonResult.FailedAndReported; @@ -5485,7 +5457,7 @@ namespace ts { return result; } - function propertiesRelatedTo(source: Type, target: Type, reportErrors: ReportErrors): Ternary { + function propertiesRelatedTo(source: Type, target: Type, reportErrors: boolean): Ternary { if (relation === identityRelation) { return propertiesIdenticalTo(source, target); } @@ -5593,7 +5565,7 @@ namespace ts { return result; } - function signaturesRelatedTo(source: Type, target: Type, kind: SignatureKind, reportErrors: ReportErrors): Ternary { + function signaturesRelatedTo(source: Type, target: Type, kind: SignatureKind, reportErrors: boolean): Ternary { if (relation === identityRelation) { return signaturesIdenticalTo(source, target, kind); } @@ -5630,7 +5602,7 @@ namespace ts { errorInfo = saveErrorInfo; continue outer; } - shouldElaborateErrors = ReportErrors.None; + shouldElaborateErrors = false; } } // don't elaborate the primitive apparent types (like Number) @@ -5649,7 +5621,7 @@ namespace ts { /** * See signatureAssignableTo, compareSignaturesIdentical */ - function signatureRelatedTo(source: Signature, target: Signature, reportErrors: ReportErrors): Ternary { + function signatureRelatedTo(source: Signature, target: Signature, reportErrors: boolean): Ternary { return compareSignaturesRelated(source, target, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); } @@ -5670,7 +5642,7 @@ namespace ts { return result; } - function stringIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: ReportErrors): Ternary { + function stringIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary { if (relation === identityRelation) { return indexTypesIdenticalTo(IndexKind.String, source, target); } @@ -5700,7 +5672,7 @@ namespace ts { return Ternary.True; } - function numberIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: ReportErrors): Ternary { + function numberIndexTypesRelatedTo(source: Type, originalSource: Type, target: Type, reportErrors: boolean): Ternary { if (relation === identityRelation) { return indexTypesIdenticalTo(IndexKind.Number, source, target); } @@ -5722,7 +5694,7 @@ namespace ts { let related: Ternary; if (sourceStringType && sourceNumberType) { // If we know for sure we're testing both string and numeric index types then only report errors from the second one - related = isRelatedTo(sourceStringType, targetType, ReportErrors.None) || isRelatedTo(sourceNumberType, targetType, reportErrors); + related = isRelatedTo(sourceStringType, targetType, /*reportErrors*/ false) || isRelatedTo(sourceNumberType, targetType, reportErrors); } else { related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); @@ -9003,7 +8975,7 @@ namespace ts { getInferredTypes(context); } - function checkTypeArguments(signature: Signature, typeArgumentNodes: TypeNode[], typeArgumentTypes: Type[], reportErrors: ReportErrors, headMessage?: DiagnosticMessage): boolean { + function checkTypeArguments(signature: Signature, typeArgumentNodes: TypeNode[], typeArgumentTypes: Type[], reportErrors: boolean, headMessage?: DiagnosticMessage): boolean { const typeParameters = signature.typeParameters; let typeArgumentsAreAssignable = true; let mapper: TypeMapper; @@ -9033,7 +9005,7 @@ namespace ts { return typeArgumentsAreAssignable; } - function checkApplicableSignature(node: CallLikeExpression, args: Expression[], signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: ReportErrors) { + function checkApplicableSignature(node: CallLikeExpression, args: Expression[], signature: Signature, relation: Map, excludeArgument: boolean[], reportErrors: boolean) { const argCount = getEffectiveArgumentCount(node, args, signature); for (let i = 0; i < argCount; i++) { const arg = getEffectiveArgument(node, args, i); @@ -9481,12 +9453,12 @@ namespace ts { // in arguments too early. If possible, we'd like to only type them once we know the correct // overload. However, this matters for the case where the call is correct. When the call is // an error, we don't need to exclude any arguments, although it would cause no harm to do so. - checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, ReportErrors.Basic); + checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true); } else if (candidateForTypeArgumentError) { if (!isTaggedTemplate && !isDecorator && typeArguments) { const typeArguments = (node).typeArguments; - checkTypeArguments(candidateForTypeArgumentError, typeArguments, map(typeArguments, getTypeFromTypeNode), ReportErrors.Basic, headMessage); + checkTypeArguments(candidateForTypeArgumentError, typeArguments, map(typeArguments, getTypeFromTypeNode), /*reportErrors*/ true, headMessage); } else { Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); @@ -9554,7 +9526,7 @@ namespace ts { let typeArgumentTypes: Type[]; if (typeArguments) { typeArgumentTypes = map(typeArguments, getTypeFromTypeNode); - typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, ReportErrors.None); + typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false); } else { inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); @@ -9566,7 +9538,7 @@ namespace ts { } candidate = getSignatureInstantiation(candidate, typeArgumentTypes); } - if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, ReportErrors.None)) { + if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { break; } const index = excludeArgument ? indexOf(excludeArgument, true) : -1;