From 729daea5ca99cd33e58942b90b0188a3e991950b Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 1 Nov 2018 15:19:08 -0700 Subject: [PATCH 1/6] Slightly improve missing property errors --- src/compiler/checker.ts | 36 ++++-- src/compiler/core.ts | 6 +- src/compiler/diagnosticMessages.json | 12 ++ src/compiler/utilities.ts | 6 +- src/services/codefixes/fixAddMissingMember.ts | 3 + ...umentExpressionContextualTyping.errors.txt | 12 +- .../arityAndOrderCompatibility01.errors.txt | 36 +++--- .../reference/arrayAssignmentTest1.errors.txt | 76 ++++++------ .../reference/arrayAssignmentTest2.errors.txt | 40 +++--- .../reference/arrayAssignmentTest3.errors.txt | 6 +- .../reference/arrayAssignmentTest4.errors.txt | 8 +- .../reference/arrayAssignmentTest5.errors.txt | 4 +- .../baselines/reference/arrayFrom.errors.txt | 4 +- .../reference/arrayLiterals3.errors.txt | 12 +- ...typeIsAssignableToReadonlyArray.errors.txt | 4 +- ...ambdaToNominalSubtypeOfFunction.errors.txt | 12 +- ...signingFromObjectToAnythingElse.errors.txt | 8 +- .../reference/assignmentCompat1.errors.txt | 8 +- ...nmentCompatBetweenTupleAndArray.errors.txt | 4 +- .../reference/assignmentCompatBug2.errors.txt | 12 +- ...CompatFunctionsWithOptionalArgs.errors.txt | 6 +- ...gnmentCompatWithCallSignatures2.errors.txt | 32 ++--- ...gnmentCompatWithCallSignatures3.errors.txt | 8 +- ...tCompatWithConstructSignatures2.errors.txt | 32 ++--- ...tCompatWithConstructSignatures3.errors.txt | 8 +- ...ignmentCompatWithNumericIndexer.errors.txt | 8 +- ...gnmentCompatWithNumericIndexer2.errors.txt | 8 +- ...gnmentCompatWithNumericIndexer3.errors.txt | 8 +- ...ignmentCompatWithObjectMembers4.errors.txt | 12 +- ...ignmentCompatWithObjectMembers5.errors.txt | 8 +- ...atWithObjectMembersOptionality2.errors.txt | 36 +++--- ...ObjectMembersStringNumericNames.errors.txt | 116 +++++++++--------- ...signmentCompatWithStringIndexer.errors.txt | 8 +- ...ignmentCompatWithStringIndexer2.errors.txt | 8 +- ...ember-off-of-function-interface.errors.txt | 14 +-- ...ember-off-of-function-interface.errors.txt | 14 +-- .../assignmentToObjectAndFunction.errors.txt | 4 +- tests/baselines/reference/bases.errors.txt | 4 +- .../reference/bluebirdStaticThis.errors.txt | 4 +- .../reference/castingTuple.errors.txt | 18 +-- .../reference/chainedAssignment1.errors.txt | 8 +- .../reference/chainedAssignment3.errors.txt | 4 +- .../chainedAssignmentChecking.errors.txt | 8 +- ...ConstrainedToOtherTypeParameter.errors.txt | 4 +- .../reference/checkJsdocTypeTag6.errors.txt | 4 +- .../checkJsxChildrenProperty14.errors.txt | 4 +- .../checkJsxChildrenProperty2.errors.txt | 20 +-- .../checkJsxChildrenProperty5.errors.txt | 12 +- ...assCanExtendConstructorFunction.errors.txt | 6 +- .../classImplementsClass2.errors.txt | 8 +- .../classImplementsClass4.errors.txt | 8 +- .../classImplementsClass7.errors.txt | 4 +- ...sImplementsMergedClassInterface.errors.txt | 12 +- .../classWithMultipleBaseClasses.errors.txt | 4 +- .../clodulesDerivedClasses.errors.txt | 6 +- ...onalOperatorWithoutIdenticalBCT.errors.txt | 8 +- .../reference/conditionalTypes2.errors.txt | 22 ++-- .../reference/constraints0.errors.txt | 6 +- ...atureInstatiationContravariance.errors.txt | 4 +- .../contextualTypeWithTuple.errors.txt | 12 +- ...lTypeWithUnionTypeObjectLiteral.errors.txt | 4 +- .../reference/contextualTyping.errors.txt | 4 +- .../reference/contextualTyping11.errors.txt | 4 +- .../reference/contextualTyping5.errors.txt | 4 +- .../reference/covariantCallbacks.errors.txt | 4 +- ...ertyIsRelatableToTargetProperty.errors.txt | 4 +- .../declarationsAndAssignments.errors.txt | 4 +- .../decoratorOnClassMethod10.errors.txt | 6 +- .../deeplyNestedAssignabilityIssue.errors.txt | 8 +- ...rayBindingPatternAndAssignment2.errors.txt | 8 +- ...tructuringParameterDeclaration2.errors.txt | 10 +- ...cturingParameterDeclaration3ES5.errors.txt | 6 +- ...arameterDeclaration3ES5iterable.errors.txt | 6 +- ...cturingParameterDeclaration3ES6.errors.txt | 6 +- ...tructuringParameterDeclaration4.errors.txt | 6 +- ...tructuringParameterDeclaration5.errors.txt | 10 +- ...orExpressionsWhichCouldBeCalled.errors.txt | 8 +- .../differentTypesWithSameName.errors.txt | 6 +- .../reference/elaboratedErrors.errors.txt | 8 +- .../errorsWithInvokablesInUnions01.errors.txt | 4 +- ...AnnotationAndInvalidInitializer.errors.txt | 16 +-- .../excessPropertyCheckWithUnions.errors.txt | 4 +- .../exportDefaultStripsFreshness.errors.txt | 12 +- ...fixingTypeParametersRepeatedly2.errors.txt | 4 +- tests/baselines/reference/for-of31.errors.txt | 4 +- .../reference/functionOverloads41.errors.txt | 4 +- tests/baselines/reference/fuzzy.errors.txt | 10 +- .../reference/generatorTypeCheck18.errors.txt | 4 +- .../reference/generatorTypeCheck20.errors.txt | 4 +- .../reference/generatorTypeCheck25.errors.txt | 4 +- .../reference/generatorTypeCheck7.errors.txt | 4 +- .../genericArrayExtenstions.errors.txt | 4 +- ...thObjectTypeArgsAndConstraints3.errors.txt | 4 +- ...thObjectTypeArgsAndConstraints4.errors.txt | 6 +- ...thObjectTypeArgsAndConstraints5.errors.txt | 6 +- .../genericCallWithTupleType.errors.txt | 4 +- .../reference/genericConstraint2.errors.txt | 10 +- .../genericRestParameters2.errors.txt | 6 +- .../genericRestParameters3.errors.txt | 52 +++----- .../genericTypeAssertions2.errors.txt | 10 +- .../genericTypeConstraints.errors.txt | 6 +- .../baselines/reference/generics1.errors.txt | 6 +- .../baselines/reference/generics2.errors.txt | 6 +- .../baselines/reference/generics5.errors.txt | 6 +- ...rfaceExtendingClassWithPrivates.errors.txt | 8 +- ...faceExtendingClassWithPrivates2.errors.txt | 20 +-- ...aceExtendingClassWithProtecteds.errors.txt | 12 +- ...tCallExpressionCheckReturntype1.errors.txt | 10 +- .../reference/incompatibleTypes.errors.txt | 4 +- .../reference/inheritance1.errors.txt | 48 ++++---- ...sxFactoryDeclarationsLocalTypes.errors.txt | 14 +-- ...xFactoryLocalTypeGlobalFallback.errors.txt | 4 +- .../reference/intTypeCheck.errors.txt | 28 ++--- .../interfaceAssignmentCompat.errors.txt | 6 +- .../interfaceDeclaration1.errors.txt | 4 +- .../interfaceDeclaration4.errors.txt | 8 +- ...terfaceExtendsClassWithPrivate1.errors.txt | 12 +- .../interfaceImplementation2.errors.txt | 4 +- .../interfaceImplementation3.errors.txt | 4 +- .../interfaceImplementation4.errors.txt | 4 +- .../interfaceImplementation6.errors.txt | 4 +- .../reference/interfaceInheritance.errors.txt | 8 +- .../intersectionAndUnionTypes.errors.txt | 44 +++---- .../intersectionAsWeakTypeSource.errors.txt | 4 +- .../intersectionTypeAssignment.errors.txt | 16 +-- .../invalidReturnStatements.errors.txt | 8 +- .../iterableArrayPattern10.errors.txt | 6 +- .../iterableArrayPattern13.errors.txt | 6 +- .../iterableArrayPattern16.errors.txt | 6 +- .../iterableArrayPattern17.errors.txt | 6 +- .../iterableArrayPattern18.errors.txt | 6 +- .../iterableArrayPattern19.errors.txt | 6 +- .../iterableArrayPattern26.errors.txt | 6 +- .../iterableArrayPattern7.errors.txt | 4 +- .../iteratorSpreadInArray9.errors.txt | 4 +- .../jsContainerMergeTsDeclaration3.errors.txt | 4 +- .../reference/jsdocFunctionType.errors.txt | 6 +- .../reference/jsdocTemplateTag3.errors.txt | 6 +- .../reference/jsdocTypeTagCast.errors.txt | 24 ++-- .../reference/mappedTypeErrors.errors.txt | 6 +- .../reference/mappedTypes6.errors.txt | 16 +-- ...nterfacesWithInheritedPrivates2.errors.txt | 4 +- ...wingGenericTypeFromInstanceof01.errors.txt | 6 +- .../noImplicitAnyInCastExpression.errors.txt | 6 +- .../nonIterableRestElement3.errors.txt | 4 +- .../nonPrimitiveAssignError.errors.txt | 4 +- ...eralFunctionArgContextualTyping.errors.txt | 12 +- ...ralFunctionArgContextualTyping2.errors.txt | 6 +- .../objectLiteralIndexerErrors.errors.txt | 4 +- .../objectLiteralNormalization.errors.txt | 12 +- ...handPropertiesFunctionArgument2.errors.txt | 6 +- .../reference/objectSpreadNegative.errors.txt | 8 +- ...bjectTypesIdentityWithPrivates3.errors.txt | 6 +- .../optionalPropertiesInClasses.errors.txt | 4 +- .../optionalPropertiesTest.errors.txt | 12 +- .../overloadingOnConstants1.errors.txt | 16 +-- ...nWithConstraintCheckingDeferred.errors.txt | 12 +- .../overloadsWithProvisionalErrors.errors.txt | 8 +- .../reference/promisePermutations.errors.txt | 6 +- .../reference/promisePermutations2.errors.txt | 6 +- .../reference/promisePermutations3.errors.txt | 12 +- .../promisesWithConstraints.errors.txt | 4 +- tests/baselines/reference/qualify.errors.txt | 16 +-- .../recursiveClassReferenceTest.errors.txt | 6 +- .../recursiveInheritance3.errors.txt | 4 +- .../recursiveIntersectionTypes.errors.txt | 4 +- .../requireOfJsonFileInJsFile.errors.txt | 8 +- .../reference/restTupleElements1.errors.txt | 24 ++-- .../restTuplesFromContextualTypes.errors.txt | 6 +- ...cMemberOfAnotherClassAssignment.errors.txt | 16 +-- .../reference/strictBindCallApply1.errors.txt | 6 +- .../strictFunctionTypesErrors.errors.txt | 4 +- .../reference/strictTupleLength.errors.txt | 4 +- ...ConstrainsPropertyDeclarations2.errors.txt | 8 +- .../subtypingWithNumericIndexer2.errors.txt | 6 +- .../subtypingWithNumericIndexer3.errors.txt | 6 +- .../subtypingWithNumericIndexer4.errors.txt | 6 +- .../subtypingWithNumericIndexer5.errors.txt | 4 +- .../subtypingWithObjectMembers3.errors.txt | 6 +- .../subtypingWithObjectMembers5.errors.txt | 12 +- .../subtypingWithStringIndexer2.errors.txt | 6 +- .../subtypingWithStringIndexer3.errors.txt | 6 +- .../subtypingWithStringIndexer4.errors.txt | 6 +- .../reference/symbolProperty10.errors.txt | 4 +- .../reference/symbolProperty25.errors.txt | 4 +- .../reference/symbolProperty52.errors.txt | 4 +- .../reference/symbolProperty9.errors.txt | 4 +- ...eStringsWithOverloadResolution1.errors.txt | 6 +- ...ingsWithOverloadResolution1_ES6.errors.txt | 6 +- ...tringsArrayTypeDefinedInES5Mode.errors.txt | 6 +- ...ringsArrayTypeNotDefinedES5Mode.errors.txt | 6 +- ...ingsArrayTypeRedefinedInES6Mode.errors.txt | 6 +- .../thisTypeInFunctionsNegative.errors.txt | 22 ++-- .../tsxAttributeResolution1.errors.txt | 4 +- .../tsxAttributeResolution12.errors.txt | 8 +- .../tsxAttributeResolution3.errors.txt | 4 +- .../tsxAttributeResolution5.errors.txt | 8 +- .../tsxAttributeResolution6.errors.txt | 4 +- .../tsxInvokeComponentType.errors.txt | 4 +- .../tsxLibraryManagedAttributes.errors.txt | 8 +- ...ponentWithDefaultTypeParameter3.errors.txt | 4 +- ...tsxSpreadAttributesResolution16.errors.txt | 4 +- .../tsxSpreadAttributesResolution2.errors.txt | 8 +- .../tsxSpreadAttributesResolution6.errors.txt | 4 +- ...elessFunctionComponentOverload4.errors.txt | 8 +- ...tsxStatelessFunctionComponents1.errors.txt | 4 +- ...ionComponentsWithTypeArguments4.errors.txt | 8 +- .../reference/tsxUnionElementType6.errors.txt | 8 +- .../baselines/reference/tupleTypes.errors.txt | 8 +- ...ntInferenceWithClassExpression2.errors.txt | 6 +- ...renceWithConstraintAsCommonRoot.errors.txt | 6 +- .../reference/typeAssertions.errors.txt | 24 ++-- ...sertionsWithIntersectionTypes01.errors.txt | 6 +- .../typeGuardFunctionErrors.errors.txt | 10 +- ...peGuardFunctionOfFormThisErrors.errors.txt | 8 +- .../baselines/reference/typeMatch1.errors.txt | 4 +- .../baselines/reference/typeMatch2.errors.txt | 16 +-- .../typeParamExtendsOtherTypeParam.errors.txt | 30 ++--- ...gWithContextSensitiveArguments2.errors.txt | 4 +- ...gWithContextSensitiveArguments3.errors.txt | 4 +- .../reference/typeRelationships.errors.txt | 4 +- .../typedefMultipleTypeParameters.errors.txt | 12 +- .../typeofAmbientExternalModules.errors.txt | 8 +- .../typeofExternalModules.errors.txt | 8 +- .../typeofInternalModules.errors.txt | 8 +- .../types.asyncGenerators.esnext.2.errors.txt | 12 +- ...yExternalModuleStillHasInstance.errors.txt | 4 +- ...unionTypeErrorMessageTypeRefs01.errors.txt | 12 +- ...eWithRecursiveSubtypeReduction2.errors.txt | 8 +- .../unionTypesAssignability.errors.txt | 16 +-- ...unctionCallsWithTypeParameters1.errors.txt | 4 +- 231 files changed, 1024 insertions(+), 1207 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7df0414b90bba..efa911bf71d95 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11315,6 +11315,7 @@ namespace ts { let depth = 0; let expandingFlags = ExpandingFlags.None; let overflow = false; + let suppressNextError = false; Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); @@ -11352,9 +11353,9 @@ namespace ts { } return result !== Ternary.False; - function reportError(message: DiagnosticMessage, arg0?: string, arg1?: string, arg2?: string): void { + function reportError(message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): void { Debug.assert(!!errorNode); - errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); + errorInfo = chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2, arg3); } function reportRelationError(message: DiagnosticMessage | undefined, source: Type, target: Type) { @@ -11562,7 +11563,12 @@ namespace ts { } if (!result && reportErrors) { - if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Primitive) { + if (suppressNextError) { + // Used by, eg, missing property checking to replace the top-level message with a more informative one + suppressNextError = false; + return result; + } + else if (source.flags & TypeFlags.Object && target.flags & TypeFlags.Primitive) { tryElaborateErrorsForPrimitivesAndObjects(source, target); } else if (source.symbol && source.flags & TypeFlags.Object && globalObjectType === source) { @@ -12209,7 +12215,20 @@ namespace ts { const unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties); if (unmatchedProperty) { if (reportErrors) { - reportError(Diagnostics.Property_0_is_missing_in_type_1, symbolToString(unmatchedProperty), typeToString(source)); + const props = arrayFrom(getUnmatchedProperties(source, target, requireOptionalProperties)); + if (headMessage && headMessage.code !== Diagnostics.Class_0_incorrectly_implements_interface_1.code && + headMessage.code !== Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code) { + suppressNextError = true; // Retain top-level error for interface implementing issues, otherwise omit it + } + if (props.length === 1) { + reportError(Diagnostics.Property_0_is_missing_in_type_1_but_present_in_type_2, symbolToString(unmatchedProperty), typeToString(source), typeToString(target)); + } + else if (props.length > 5) { // arbitrary cutoff for too-long list form + reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more, typeToString(source), typeToString(target), map(props.slice(0, 4), p => symbolToString(p)).join(", "), props.length - 4); + } + else { + reportError(Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2, typeToString(source), typeToString(target), map(props, p => symbolToString(p)).join(", ")); + } } return Ternary.False; } @@ -13591,17 +13610,20 @@ namespace ts { return getTypeFromInference(inference); } - function getUnmatchedProperty(source: Type, target: Type, requireOptionalProperties: boolean) { + function* getUnmatchedProperties(source: Type, target: Type, requireOptionalProperties: boolean) { const properties = target.flags & TypeFlags.Intersection ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); for (const targetProp of properties) { if (requireOptionalProperties || !(targetProp.flags & SymbolFlags.Optional)) { const sourceProp = getPropertyOfType(source, targetProp.escapedName); if (!sourceProp) { - return targetProp; + yield targetProp; } } } - return undefined; + } + + function getUnmatchedProperty(source: Type, target: Type, requireOptionalProperties: boolean): Symbol | undefined { + return getUnmatchedProperties(source, target, requireOptionalProperties).next().value; } function tupleTypesDefinitelyUnrelated(source: TupleTypeReference, target: TupleTypeReference) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 8c976cee9ee56..b5c4f74bc3c9a 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1255,9 +1255,9 @@ namespace ts { } /** Shims `Array.from`. */ - export function arrayFrom(iterator: Iterator, map: (t: T) => U): U[]; - export function arrayFrom(iterator: Iterator): T[]; - export function arrayFrom(iterator: Iterator, map?: (t: any) => any): any[] { + export function arrayFrom(iterator: Iterator | IterableIterator, map: (t: T) => U): U[]; + export function arrayFrom(iterator: Iterator | IterableIterator): T[]; + export function arrayFrom(iterator: Iterator | IterableIterator, map?: (t: any) => any): any[] { const result: any[] = []; for (let { value, done } = iterator.next(); !done; { value, done } = iterator.next()) { result.push(map ? map(value) : value); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 01aa861cabb76..2382119c66d4e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2493,6 +2493,18 @@ "category": "Error", "code": 2734 }, + "Type '{0}' is missing the following properties from type '{1}': {2}": { + "category": "Error", + "code": 2735 + }, + "Type '{0}' is missing the following properties from type '{1}': {2}, and {3} more.": { + "category": "Error", + "code": 2736 + }, + "Property '{0}' is missing in type {1}' but present in type '{2}'.": { + "category": "Error", + "code": 2737 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 991e403f52e5a..c33bd1d3f4f51 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -6896,8 +6896,8 @@ namespace ts { getSourceMapSourceConstructor: () => SourceMapSource, }; - export function formatStringFromArgs(text: string, args: ArrayLike, baseIndex = 0): string { - return text.replace(/{(\d+)}/g, (_match, index: string) => Debug.assertDefined(args[+index + baseIndex])); + export function formatStringFromArgs(text: string, args: ArrayLike, baseIndex = 0): string { + return text.replace(/{(\d+)}/g, (_match, index: string) => "" + Debug.assertDefined(args[+index + baseIndex])); } export let localizedDiagnosticMessages: MapLike | undefined; @@ -6976,7 +6976,7 @@ namespace ts { }; } - export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage, ...args: (string | undefined)[]): DiagnosticMessageChain; + export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticMessageChain; export function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage): DiagnosticMessageChain { let text = getLocaleSpecificMessage(message); diff --git a/src/services/codefixes/fixAddMissingMember.ts b/src/services/codefixes/fixAddMissingMember.ts index dda0903562a7a..f763bdc39dc8d 100644 --- a/src/services/codefixes/fixAddMissingMember.ts +++ b/src/services/codefixes/fixAddMissingMember.ts @@ -4,6 +4,9 @@ namespace ts.codefix { const errorCodes = [ Diagnostics.Property_0_does_not_exist_on_type_1.code, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code, + Diagnostics.Property_0_is_missing_in_type_1_but_present_in_type_2.code, + Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code, + Diagnostics.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code ]; const fixId = "addMissingMember"; registerCodeFix({ diff --git a/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt b/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt index 87c3a6d0b37a3..61648f9faf748 100644 --- a/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt +++ b/tests/baselines/reference/argumentExpressionContextualTyping.errors.txt @@ -1,12 +1,10 @@ -tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(16,5): error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'. - Property '0' is missing in type '(string | number | boolean)[]'. +tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(16,5): error TS2735: Type '(string | number | boolean)[]' is missing the following properties from type '[string, number, boolean]': 0, 1, 2 tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(17,5): error TS2345: Argument of type '[string, number, true, ...(string | number | boolean)[]]' is not assignable to parameter of type '[string, number, boolean]'. Types of property 'length' are incompatible. Type 'number' is not assignable to type '3'. tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts(18,5): error TS2345: Argument of type '{ x: (string | number)[]; y: { c: boolean; d: string; e: number; }; }' is not assignable to parameter of type '{ x: [any, any]; y: { c: any; d: any; e: any; }; }'. Types of property 'x' are incompatible. - Type '(string | number)[]' is not assignable to type '[any, any]'. - Property '0' is missing in type '(string | number)[]'. + Type '(string | number)[]' is missing the following properties from type '[any, any]': 0, 1 ==== tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextualTyping.ts (3 errors) ==== @@ -27,8 +25,7 @@ tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextua baz(array); // Error ~~~~~ -!!! error TS2345: Argument of type '(string | number | boolean)[]' is not assignable to parameter of type '[string, number, boolean]'. -!!! error TS2345: Property '0' is missing in type '(string | number | boolean)[]'. +!!! error TS2735: Type '(string | number | boolean)[]' is missing the following properties from type '[string, number, boolean]': 0, 1, 2 baz(["string", 1, true, ...array]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '[string, number, true, ...(string | number | boolean)[]]' is not assignable to parameter of type '[string, number, boolean]'. @@ -38,5 +35,4 @@ tests/cases/conformance/expressions/contextualTyping/argumentExpressionContextua ~ !!! error TS2345: Argument of type '{ x: (string | number)[]; y: { c: boolean; d: string; e: number; }; }' is not assignable to parameter of type '{ x: [any, any]; y: { c: any; d: any; e: any; }; }'. !!! error TS2345: Types of property 'x' are incompatible. -!!! error TS2345: Type '(string | number)[]' is not assignable to type '[any, any]'. -!!! error TS2345: Property '0' is missing in type '(string | number)[]'. \ No newline at end of file +!!! error TS2345: Type '(string | number)[]' is missing the following properties from type '[any, any]': 0, 1 \ No newline at end of file diff --git a/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt b/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt index f30dabd56893e..46540eab0c870 100644 --- a/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt +++ b/tests/baselines/reference/arityAndOrderCompatibility01.errors.txt @@ -3,17 +3,17 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(16,12): erro tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(17,5): error TS2461: Type '{ 0: string; 1: number; length: 2; }' is not an array type. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(17,12): error TS2460: Type '{ 0: string; 1: number; length: 2; }' has no property '2'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(18,5): error TS2322: Type '[string, number]' is not assignable to type '[number, number, number]'. - Property '2' is missing in type '[string, number]'. + Property '2' is missing in type [string, number]' but present in type '[number, number, number]'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(19,5): error TS2322: Type 'StrNum' is not assignable to type '[number, number, number]'. - Property '2' is missing in type 'StrNum'. + Property '2' is missing in type StrNum' but present in type '[number, number, number]'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(20,5): error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[number, number, number]'. - Property '2' is missing in type '{ 0: string; 1: number; length: 2; }'. + Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[number, number, number]': 2, pop, push, concat, and 16 more. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(21,5): error TS2322: Type '[string, number]' is not assignable to type '[string, number, number]'. - Property '2' is missing in type '[string, number]'. + Property '2' is missing in type [string, number]' but present in type '[string, number, number]'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(22,5): error TS2322: Type 'StrNum' is not assignable to type '[string, number, number]'. - Property '2' is missing in type 'StrNum'. + Property '2' is missing in type StrNum' but present in type '[string, number, number]'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(23,5): error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[string, number, number]'. - Property '2' is missing in type '{ 0: string; 1: number; length: 2; }'. + Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[string, number, number]': 2, pop, push, concat, and 16 more. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(24,5): error TS2322: Type '[string, number]' is not assignable to type '[number]'. Types of property '0' are incompatible. Type 'string' is not assignable to type 'number'. @@ -21,7 +21,7 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(25,5): error Types of property '0' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(26,5): error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[number]'. - Property 'pop' is missing in type '{ 0: string; 1: number; length: 2; }'. + Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[number]': pop, push, concat, join, and 15 more. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(27,5): error TS2322: Type '[string, number]' is not assignable to type '[string]'. Types of property 'length' are incompatible. Type '2' is not assignable to type '1'. @@ -29,14 +29,14 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(28,5): error Types of property 'length' are incompatible. Type '2' is not assignable to type '1'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(29,5): error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[string]'. - Property 'pop' is missing in type '{ 0: string; 1: number; length: 2; }'. + Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[string]': pop, push, concat, join, and 15 more. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(30,5): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(31,5): error TS2322: Type 'StrNum' is not assignable to type '[number, string]'. Types of property '0' are incompatible. Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(32,5): error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[number, string]'. - Property 'pop' is missing in type '{ 0: string; 1: number; length: 2; }'. + Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[number, string]': pop, push, concat, join, and 15 more. ==== tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts (19 errors) ==== @@ -68,27 +68,27 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(32,5): error var j1: [number, number, number] = x; ~~ !!! error TS2322: Type '[string, number]' is not assignable to type '[number, number, number]'. -!!! error TS2322: Property '2' is missing in type '[string, number]'. +!!! error TS2322: Property '2' is missing in type [string, number]' but present in type '[number, number, number]'. var j2: [number, number, number] = y; ~~ !!! error TS2322: Type 'StrNum' is not assignable to type '[number, number, number]'. -!!! error TS2322: Property '2' is missing in type 'StrNum'. +!!! error TS2322: Property '2' is missing in type StrNum' but present in type '[number, number, number]'. var j3: [number, number, number] = z; ~~ !!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[number, number, number]'. -!!! error TS2322: Property '2' is missing in type '{ 0: string; 1: number; length: 2; }'. +!!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[number, number, number]': 2, pop, push, concat, and 16 more. var k1: [string, number, number] = x; ~~ !!! error TS2322: Type '[string, number]' is not assignable to type '[string, number, number]'. -!!! error TS2322: Property '2' is missing in type '[string, number]'. +!!! error TS2322: Property '2' is missing in type [string, number]' but present in type '[string, number, number]'. var k2: [string, number, number] = y; ~~ !!! error TS2322: Type 'StrNum' is not assignable to type '[string, number, number]'. -!!! error TS2322: Property '2' is missing in type 'StrNum'. +!!! error TS2322: Property '2' is missing in type StrNum' but present in type '[string, number, number]'. var k3: [string, number, number] = z; ~~ !!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[string, number, number]'. -!!! error TS2322: Property '2' is missing in type '{ 0: string; 1: number; length: 2; }'. +!!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[string, number, number]': 2, pop, push, concat, and 16 more. var l1: [number] = x; ~~ !!! error TS2322: Type '[string, number]' is not assignable to type '[number]'. @@ -102,7 +102,7 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(32,5): error var l3: [number] = z; ~~ !!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[number]'. -!!! error TS2322: Property 'pop' is missing in type '{ 0: string; 1: number; length: 2; }'. +!!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[number]': pop, push, concat, join, and 15 more. var m1: [string] = x; ~~ !!! error TS2322: Type '[string, number]' is not assignable to type '[string]'. @@ -116,7 +116,7 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(32,5): error var m3: [string] = z; ~~ !!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[string]'. -!!! error TS2322: Property 'pop' is missing in type '{ 0: string; 1: number; length: 2; }'. +!!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[string]': pop, push, concat, join, and 15 more. var n1: [number, string] = x; ~~ !!! error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. @@ -129,7 +129,7 @@ tests/cases/conformance/types/tuple/arityAndOrderCompatibility01.ts(32,5): error var n3: [number, string] = z; ~~ !!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is not assignable to type '[number, string]'. -!!! error TS2322: Property 'pop' is missing in type '{ 0: string; 1: number; length: 2; }'. +!!! error TS2322: Type '{ 0: string; 1: number; length: 2; }' is missing the following properties from type '[number, string]': pop, push, concat, join, and 15 more. var o1: [string, number] = x; var o2: [string, number] = y; var o3: [string, number] = y; diff --git a/tests/baselines/reference/arrayAssignmentTest1.errors.txt b/tests/baselines/reference/arrayAssignmentTest1.errors.txt index e07306b19b21c..d53156db918fb 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest1.errors.txt @@ -1,50 +1,50 @@ tests/cases/compiler/arrayAssignmentTest1.ts(46,5): error TS2322: Type 'undefined[]' is not assignable to type 'I1'. - Property 'IM1' is missing in type 'undefined[]'. + Property 'IM1' is missing in type undefined[]' but present in type 'I1'. tests/cases/compiler/arrayAssignmentTest1.ts(47,5): error TS2322: Type 'undefined[]' is not assignable to type 'C1'. - Property 'IM1' is missing in type 'undefined[]'. + Type 'undefined[]' is missing the following properties from type 'C1': IM1, C1M1 tests/cases/compiler/arrayAssignmentTest1.ts(48,5): error TS2322: Type 'undefined[]' is not assignable to type 'C2'. - Property 'C2M1' is missing in type 'undefined[]'. + Type 'undefined[]' is missing the following properties from type 'C2': C2M1, IM1, C1M1 tests/cases/compiler/arrayAssignmentTest1.ts(49,5): error TS2322: Type 'undefined[]' is not assignable to type 'C3'. - Property 'CM3M1' is missing in type 'undefined[]'. + Property 'CM3M1' is missing in type undefined[]' but present in type 'C3'. tests/cases/compiler/arrayAssignmentTest1.ts(60,1): error TS2322: Type 'C3[]' is not assignable to type 'I1[]'. Type 'C3' is not assignable to type 'I1'. - Property 'IM1' is missing in type 'C3'. + Property 'IM1' is missing in type C3' but present in type 'I1'. tests/cases/compiler/arrayAssignmentTest1.ts(64,1): error TS2322: Type 'I1[]' is not assignable to type 'C1[]'. Type 'I1' is not assignable to type 'C1'. - Property 'C1M1' is missing in type 'I1'. + Property 'C1M1' is missing in type I1' but present in type 'C1'. tests/cases/compiler/arrayAssignmentTest1.ts(65,1): error TS2322: Type 'C3[]' is not assignable to type 'C1[]'. Type 'C3' is not assignable to type 'C1'. - Property 'IM1' is missing in type 'C3'. + Type 'C3' is missing the following properties from type 'C1': IM1, C1M1 tests/cases/compiler/arrayAssignmentTest1.ts(68,1): error TS2322: Type 'C1[]' is not assignable to type 'C2[]'. Type 'C1' is not assignable to type 'C2'. - Property 'C2M1' is missing in type 'C1'. + Property 'C2M1' is missing in type C1' but present in type 'C2'. tests/cases/compiler/arrayAssignmentTest1.ts(69,1): error TS2322: Type 'I1[]' is not assignable to type 'C2[]'. Type 'I1' is not assignable to type 'C2'. - Property 'C2M1' is missing in type 'I1'. + Type 'I1' is missing the following properties from type 'C2': C2M1, C1M1 tests/cases/compiler/arrayAssignmentTest1.ts(70,1): error TS2322: Type 'C3[]' is not assignable to type 'C2[]'. Type 'C3' is not assignable to type 'C2'. - Property 'C2M1' is missing in type 'C3'. + Type 'C3' is missing the following properties from type 'C2': C2M1, IM1, C1M1 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'. + Property 'CM3M1' is missing in type C2' but present in type 'C3'. 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'. + Property 'CM3M1' is missing in type C1' but present in type 'C3'. 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'. + Property 'CM3M1' is missing in type I1' but present in type 'C3'. tests/cases/compiler/arrayAssignmentTest1.ts(79,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. - Property 'pop' is missing in type '() => C1'. + Type '() => C1' is missing the following properties from type 'any[]': pop, push, concat, join, and 15 more. tests/cases/compiler/arrayAssignmentTest1.ts(80,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. - Property 'length' is missing in type '{ one: number; }'. + Type '{ one: number; }' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. tests/cases/compiler/arrayAssignmentTest1.ts(82,1): error TS2322: Type 'C1' is not assignable to type 'any[]'. - Property 'length' is missing in type 'C1'. + Type 'C1' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. tests/cases/compiler/arrayAssignmentTest1.ts(83,1): error TS2322: Type 'C2' is not assignable to type 'any[]'. - Property 'length' is missing in type 'C2'. + Type 'C2' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. tests/cases/compiler/arrayAssignmentTest1.ts(84,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. - Property 'length' is missing in type 'C3'. + Type 'C3' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is not assignable to type 'any[]'. - Property 'length' is missing in type 'I1'. + Type 'I1' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. ==== tests/cases/compiler/arrayAssignmentTest1.ts (19 errors) ==== @@ -96,19 +96,19 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n var i1_error: I1 = []; // should be an error - is ~~~~~~~~ !!! error TS2322: Type 'undefined[]' is not assignable to type 'I1'. -!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. +!!! error TS2322: Property 'IM1' is missing in type undefined[]' but present in type 'I1'. var c1_error: C1 = []; // should be an error - is ~~~~~~~~ !!! error TS2322: Type 'undefined[]' is not assignable to type 'C1'. -!!! error TS2322: Property 'IM1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is missing the following properties from type 'C1': IM1, C1M1 var c2_error: C2 = []; // should be an error - is ~~~~~~~~ !!! error TS2322: Type 'undefined[]' is not assignable to type 'C2'. -!!! error TS2322: Property 'C2M1' is missing in type 'undefined[]'. +!!! error TS2322: Type 'undefined[]' is missing the following properties from type 'C2': C2M1, IM1, C1M1 var c3_error: C3 = []; // should be an error - is ~~~~~~~~ !!! error TS2322: Type 'undefined[]' is not assignable to type 'C3'. -!!! error TS2322: Property 'CM3M1' is missing in type 'undefined[]'. +!!! error TS2322: Property 'CM3M1' is missing in type undefined[]' but present in type 'C3'. arr_any = arr_i1; // should be ok - is @@ -123,7 +123,7 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n ~~~~~~ !!! error TS2322: Type 'C3[]' is not assignable to type 'I1[]'. !!! error TS2322: Type 'C3' is not assignable to type 'I1'. -!!! error TS2322: Property 'IM1' is missing in type 'C3'. +!!! error TS2322: Property 'IM1' is missing in type C3' but present in type 'I1'. arr_c1 = arr_c1; // should be ok - subtype relationship - is arr_c1 = arr_c2; // should be ok - subtype relationship - is @@ -131,29 +131,29 @@ tests/cases/compiler/arrayAssignmentTest1.ts(85,1): error TS2322: Type 'I1' is n ~~~~~~ !!! error TS2322: Type 'I1[]' is not assignable to type 'C1[]'. !!! error TS2322: Type 'I1' is not assignable to type 'C1'. -!!! error TS2322: Property 'C1M1' is missing in type 'I1'. +!!! error TS2322: Property 'C1M1' is missing in type I1' but present in type 'C1'. arr_c1 = arr_c3; // should be an error - is ~~~~~~ !!! error TS2322: Type 'C3[]' is not assignable to type 'C1[]'. !!! error TS2322: Type 'C3' is not assignable to type 'C1'. -!!! error TS2322: Property 'IM1' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is missing the following properties from type 'C1': IM1, C1M1 arr_c2 = arr_c2; // should be ok - subtype relationship - is arr_c2 = arr_c1; // should be an error - subtype relationship - is ~~~~~~ !!! error TS2322: Type 'C1[]' is not assignable to type 'C2[]'. !!! error TS2322: Type 'C1' is not assignable to type 'C2'. -!!! error TS2322: Property 'C2M1' is missing in type 'C1'. +!!! error TS2322: Property 'C2M1' is missing in type C1' but present in type 'C2'. arr_c2 = arr_i1; // should be an error - subtype relationship - is ~~~~~~ !!! error TS2322: Type 'I1[]' is not assignable to type 'C2[]'. !!! error TS2322: Type 'I1' is not assignable to type 'C2'. -!!! error TS2322: Property 'C2M1' is missing in type 'I1'. +!!! error TS2322: Type 'I1' is missing the following properties from type 'C2': C2M1, C1M1 arr_c2 = arr_c3; // should be an error - is ~~~~~~ !!! error TS2322: Type 'C3[]' is not assignable to type 'C2[]'. !!! error TS2322: Type 'C3' is not assignable to type 'C2'. -!!! error TS2322: Property 'C2M1' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is missing the following properties from type 'C2': C2M1, IM1, C1M1 // "clean up bug" occurs at this point // if you move these three expressions to another file, they raise an error @@ -162,40 +162,40 @@ 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'. +!!! error TS2322: Property 'CM3M1' is missing in type C2' but present in type 'C3'. 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'. +!!! error TS2322: Property 'CM3M1' is missing in type C1' but present in type 'C3'. 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'. +!!! error TS2322: Property 'CM3M1' is missing in type I1' but present in type 'C3'. arr_any = f1; // should be an error - is ~~~~~~~ !!! error TS2322: Type '() => C1' is not assignable to type 'any[]'. -!!! error TS2322: Property 'pop' is missing in type '() => C1'. +!!! error TS2322: Type '() => C1' is missing the following properties from type 'any[]': pop, push, concat, join, and 15 more. arr_any = o1; // should be an error - is ~~~~~~~ !!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type '{ one: number; }'. +!!! error TS2322: Type '{ one: number; }' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ !!! error TS2322: Type 'C1' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'C1'. +!!! error TS2322: Type 'C1' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. arr_any = c2; // should be an error - is ~~~~~~~ !!! error TS2322: Type 'C2' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'C2'. +!!! error TS2322: Type 'C2' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. arr_any = c3; // should be an error - is ~~~~~~~ !!! error TS2322: Type 'C3' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. arr_any = i1; // should be an error - is ~~~~~~~ !!! error TS2322: Type 'I1' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'I1'. \ No newline at end of file +!!! error TS2322: Type 'I1' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest2.errors.txt b/tests/baselines/reference/arrayAssignmentTest2.errors.txt index eca2f8ad6f5b7..2c90006648fbf 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest2.errors.txt @@ -1,26 +1,26 @@ tests/cases/compiler/arrayAssignmentTest2.ts(47,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'. + Property 'CM3M1' is missing in type C2' but present in type 'C3'. tests/cases/compiler/arrayAssignmentTest2.ts(48,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'. + Property 'CM3M1' is missing in type C1' but present in type 'C3'. tests/cases/compiler/arrayAssignmentTest2.ts(49,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'. + Property 'CM3M1' is missing in type I1' but present in type 'C3'. tests/cases/compiler/arrayAssignmentTest2.ts(51,1): error TS2322: Type '() => C1' is not assignable to type 'any[]'. - Property 'pop' is missing in type '() => C1'. + Type '() => C1' is missing the following properties from type 'any[]': pop, push, concat, join, and 15 more. tests/cases/compiler/arrayAssignmentTest2.ts(52,1): error TS2322: Type '() => any' is not assignable to type 'any[]'. - Property 'pop' is missing in type '() => any'. + Type '() => any' is missing the following properties from type 'any[]': pop, push, concat, join, and 15 more. tests/cases/compiler/arrayAssignmentTest2.ts(53,1): error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. - Property 'length' is missing in type '{ one: number; }'. + Type '{ one: number; }' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. tests/cases/compiler/arrayAssignmentTest2.ts(55,1): error TS2322: Type 'C1' is not assignable to type 'any[]'. - Property 'length' is missing in type 'C1'. + Type 'C1' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. tests/cases/compiler/arrayAssignmentTest2.ts(56,1): error TS2322: Type 'C2' is not assignable to type 'any[]'. - Property 'length' is missing in type 'C2'. + Type 'C2' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. tests/cases/compiler/arrayAssignmentTest2.ts(57,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. - Property 'length' is missing in type 'C3'. + Type 'C3' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. tests/cases/compiler/arrayAssignmentTest2.ts(58,1): error TS2322: Type 'I1' is not assignable to type 'any[]'. - Property 'length' is missing in type 'I1'. + Type 'I1' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. ==== tests/cases/compiler/arrayAssignmentTest2.ts (10 errors) ==== @@ -74,45 +74,45 @@ tests/cases/compiler/arrayAssignmentTest2.ts(58,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'. +!!! error TS2322: Property 'CM3M1' is missing in type C2' but present in type 'C3'. 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'. +!!! error TS2322: Property 'CM3M1' is missing in type C1' but present in type 'C3'. 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'. +!!! error TS2322: Property 'CM3M1' is missing in type I1' but present in type 'C3'. arr_any = f1; // should be an error - is ~~~~~~~ !!! error TS2322: Type '() => C1' is not assignable to type 'any[]'. -!!! error TS2322: Property 'pop' is missing in type '() => C1'. +!!! error TS2322: Type '() => C1' is missing the following properties from type 'any[]': pop, push, concat, join, and 15 more. arr_any = function () { return null;} // should be an error - is ~~~~~~~ !!! error TS2322: Type '() => any' is not assignable to type 'any[]'. -!!! error TS2322: Property 'pop' is missing in type '() => any'. +!!! error TS2322: Type '() => any' is missing the following properties from type 'any[]': pop, push, concat, join, and 15 more. arr_any = o1; // should be an error - is ~~~~~~~ !!! error TS2322: Type '{ one: number; }' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type '{ one: number; }'. +!!! error TS2322: Type '{ one: number; }' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. arr_any = a1; // should be ok - is arr_any = c1; // should be an error - is ~~~~~~~ !!! error TS2322: Type 'C1' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'C1'. +!!! error TS2322: Type 'C1' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. arr_any = c2; // should be an error - is ~~~~~~~ !!! error TS2322: Type 'C2' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'C2'. +!!! error TS2322: Type 'C2' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. arr_any = c3; // should be an error - is ~~~~~~~ !!! error TS2322: Type 'C3' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. arr_any = i1; // should be an error - is ~~~~~~~ !!! error TS2322: Type 'I1' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'I1'. +!!! error TS2322: Type 'I1' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest3.errors.txt b/tests/baselines/reference/arrayAssignmentTest3.errors.txt index 31347782c5d0c..ac02a6cb93e4a 100644 --- a/tests/baselines/reference/arrayAssignmentTest3.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest3.errors.txt @@ -1,5 +1,4 @@ -tests/cases/compiler/arrayAssignmentTest3.ts(12,25): error TS2345: Argument of type 'B' is not assignable to parameter of type 'B[]'. - Property 'length' is missing in type 'B'. +tests/cases/compiler/arrayAssignmentTest3.ts(12,25): error TS2736: Type 'B' is missing the following properties from type 'B[]': length, pop, push, concat, and 16 more. ==== tests/cases/compiler/arrayAssignmentTest3.ts (1 errors) ==== @@ -16,7 +15,6 @@ tests/cases/compiler/arrayAssignmentTest3.ts(12,25): error TS2345: Argument of t var xx = new a(null, 7, new B()); ~~~~~~~ -!!! error TS2345: Argument of type 'B' is not assignable to parameter of type 'B[]'. -!!! error TS2345: Property 'length' is missing in type 'B'. +!!! error TS2736: Type 'B' is missing the following properties from type 'B[]': length, pop, push, concat, and 16 more. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest4.errors.txt b/tests/baselines/reference/arrayAssignmentTest4.errors.txt index 2546c6abf0491..2e9507c30d81b 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest4.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/arrayAssignmentTest4.ts(22,1): error TS2322: Type '() => any' is not assignable to type 'any[]'. - Property 'pop' is missing in type '() => any'. + Type '() => any' is missing the following properties from type 'any[]': pop, push, concat, join, and 15 more. tests/cases/compiler/arrayAssignmentTest4.ts(23,1): error TS2322: Type 'C3' is not assignable to type 'any[]'. - Property 'length' is missing in type 'C3'. + Type 'C3' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. ==== tests/cases/compiler/arrayAssignmentTest4.ts (2 errors) ==== @@ -29,9 +29,9 @@ tests/cases/compiler/arrayAssignmentTest4.ts(23,1): error TS2322: Type 'C3' is n arr_any = function () { return null;} // should be an error - is ~~~~~~~ !!! error TS2322: Type '() => any' is not assignable to type 'any[]'. -!!! error TS2322: Property 'pop' is missing in type '() => any'. +!!! error TS2322: Type '() => any' is missing the following properties from type 'any[]': pop, push, concat, join, and 15 more. arr_any = c3; // should be an error - is ~~~~~~~ !!! error TS2322: Type 'C3' is not assignable to type 'any[]'. -!!! error TS2322: Property 'length' is missing in type 'C3'. +!!! error TS2322: Type 'C3' is missing the following properties from type 'any[]': length, pop, push, concat, and 16 more. \ No newline at end of file diff --git a/tests/baselines/reference/arrayAssignmentTest5.errors.txt b/tests/baselines/reference/arrayAssignmentTest5.errors.txt index 3a45cad9ad7eb..37d9b677af1ec 100644 --- a/tests/baselines/reference/arrayAssignmentTest5.errors.txt +++ b/tests/baselines/reference/arrayAssignmentTest5.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'. Type 'IToken' is not assignable to type 'IStateToken'. - Property 'state' is missing in type 'IToken'. + Property 'state' is missing in type IToken' but present in type 'IStateToken'. ==== tests/cases/compiler/arrayAssignmentTest5.ts (1 errors) ==== @@ -30,7 +30,7 @@ tests/cases/compiler/arrayAssignmentTest5.ts(23,17): error TS2322: Type 'IToken[ ~~~~~~ !!! error TS2322: Type 'IToken[]' is not assignable to type 'IStateToken[]'. !!! error TS2322: Type 'IToken' is not assignable to type 'IStateToken'. -!!! error TS2322: Property 'state' is missing in type 'IToken'. +!!! error TS2322: Property 'state' is missing in type IToken' but present in type 'IStateToken'. if (tokens.length === 0) { return this.onEnter(line, tokens, offset); // <== this should produce an error since onEnter can not be called with (string, IStateToken[], offset) } diff --git a/tests/baselines/reference/arrayFrom.errors.txt b/tests/baselines/reference/arrayFrom.errors.txt index 4685ec20db807..ee4ecc36e8c76 100644 --- a/tests/baselines/reference/arrayFrom.errors.txt +++ b/tests/baselines/reference/arrayFrom.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/arrayFrom.ts(20,7): error TS2322: Type 'A[]' is not assignable to type 'B[]'. Type 'A' is not assignable to type 'B'. - Property 'b' is missing in type 'A'. + Property 'b' is missing in type A' but present in type 'B'. tests/cases/compiler/arrayFrom.ts(23,7): error TS2322: Type 'A[]' is not assignable to type 'B[]'. @@ -28,7 +28,7 @@ tests/cases/compiler/arrayFrom.ts(23,7): error TS2322: Type 'A[]' is not assigna ~~~~~~~ !!! error TS2322: Type 'A[]' is not assignable to type 'B[]'. !!! error TS2322: Type 'A' is not assignable to type 'B'. -!!! error TS2322: Property 'b' is missing in type 'A'. +!!! error TS2322: Property 'b' is missing in type A' but present in type 'B'. const result4: A[] = Array.from(inputB, ({ b }): A => ({ a: b })); const result5: A[] = Array.from(inputALike); const result6: B[] = Array.from(inputALike); // expect error diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt index d1c99742a2729..dd4d79d510186 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type '[]' is not assignable to type '[any, any, any]'. - Property '0' is missing in type '[]'. + Type '[]' is missing the following properties from type '[any, any, any]': 0, 1, 2 tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,38): error TS2322: Type 'string' is not assignable to type 'boolean'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,48): error TS2322: Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,51): error TS2322: Type 'true' is not assignable to type 'number'. @@ -7,9 +7,9 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error Types of property 'length' are incompatible. Type '4' is not assignable to type '2'. tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(32,5): error TS2322: Type '(number[] | string[])[]' is not assignable to type 'tup'. - Property '0' is missing in type '(number[] | string[])[]'. + Type '(number[] | string[])[]' is missing the following properties from type 'tup': 0, 1 tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(33,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'. - Property '0' is missing in type 'number[]'. + Type 'number[]' is missing the following properties from type '[number, number, number]': 0, 1, 2 tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error TS2322: Type '(string | number)[]' is not assignable to type 'myArray'. Types of property 'pop' are incompatible. Type '() => string | number' is not assignable to type '() => Number'. @@ -30,7 +30,7 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error var a0: [any, any, any] = []; // Error ~~ !!! error TS2322: Type '[]' is not assignable to type '[any, any, any]'. -!!! error TS2322: Property '0' is missing in type '[]'. +!!! error TS2322: Type '[]' is missing the following properties from type '[any, any, any]': 0, 1, 2 var a1: [boolean, string, number] = ["string", 1, true]; // Error ~~~~~~~~ !!! error TS2322: Type 'string' is not assignable to type 'boolean'. @@ -65,11 +65,11 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error var c0: tup = [...temp2]; // Error ~~ !!! error TS2322: Type '(number[] | string[])[]' is not assignable to type 'tup'. -!!! error TS2322: Property '0' is missing in type '(number[] | string[])[]'. +!!! error TS2322: Type '(number[] | string[])[]' is missing the following properties from type 'tup': 0, 1 var c1: [number, number, number] = [...temp1]; // Error cannot assign number[] to [number, number, number] ~~ !!! error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'. -!!! error TS2322: Property '0' is missing in type 'number[]'. +!!! error TS2322: Type 'number[]' is missing the following properties from type '[number, number, number]': 0, 1, 2 var c2: myArray = [...temp1, ...temp]; // Error cannot assign (number|string)[] to number[] ~~ !!! error TS2322: Type '(string | number)[]' is not assignable to type 'myArray'. diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt index 66a659b386339..87bafe5889ee0 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(13,1): error TS2322: Type 'A[]' is not assignable to type 'ReadonlyArray'. Type 'A' is not assignable to type 'B'. - Property 'b' is missing in type 'A'. + Property 'b' is missing in type A' but present in type 'B'. tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error TS2322: Type 'C' is not assignable to type 'ReadonlyArray'. Types of property 'concat' are incompatible. Type '{ (...items: ConcatArray[]): A[]; (...items: (A | ConcatArray)[]): A[]; }' is not assignable to type '{ (...items: ConcatArray[]): B[]; (...items: (B | ConcatArray)[]): B[]; }'. @@ -25,7 +25,7 @@ tests/cases/compiler/arrayOfSubtypeIsAssignableToReadonlyArray.ts(18,1): error T ~~~ !!! error TS2322: Type 'A[]' is not assignable to type 'ReadonlyArray'. !!! error TS2322: Type 'A' is not assignable to type 'B'. -!!! error TS2322: Property 'b' is missing in type 'A'. +!!! error TS2322: Property 'b' is missing in type A' but present in type 'B'. rra = cra; rra = crb; // OK, C is assignable to ReadonlyArray diff --git a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt index f462fd347e6b7..f9528bb0f7eb4 100644 --- a/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt +++ b/tests/baselines/reference/assignLambdaToNominalSubtypeOfFunction.errors.txt @@ -1,7 +1,5 @@ -tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts(7,4): error TS2345: Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. - Property 'x' is missing in type '(a: any, b: any) => boolean'. -tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts(8,4): error TS2345: Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. - Property 'x' is missing in type '(a: any, b: any) => boolean'. +tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts(7,4): error TS2737: Property 'x' is missing in type (a: any, b: any) => boolean' but present in type 'IResultCallback'. +tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts(8,4): error TS2737: Property 'x' is missing in type (a: any, b: any) => boolean' but present in type 'IResultCallback'. ==== tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts (2 errors) ==== @@ -13,10 +11,8 @@ tests/cases/compiler/assignLambdaToNominalSubtypeOfFunction.ts(8,4): error TS234 fn((a, b) => true); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. -!!! error TS2345: Property 'x' is missing in type '(a: any, b: any) => boolean'. +!!! error TS2737: Property 'x' is missing in type (a: any, b: any) => boolean' but present in type 'IResultCallback'. fn(function (a, b) { return true; }) ~~~~~~~~ -!!! error TS2345: Argument of type '(a: any, b: any) => boolean' is not assignable to parameter of type 'IResultCallback'. -!!! error TS2345: Property 'x' is missing in type '(a: any, b: any) => boolean'. +!!! error TS2737: Property 'x' is missing in type (a: any, b: any) => boolean' but present in type 'IResultCallback'. \ No newline at end of file diff --git a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt index bc92c376c7c1d..138b0608e5e6d 100644 --- a/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt +++ b/tests/baselines/reference/assigningFromObjectToAnythingElse.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(3,1): error TS2322: Type 'Object' is not assignable to type 'RegExp'. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? - Property 'exec' is missing in type 'Object'. + Type 'Object' is missing the following properties from type 'RegExp': exec, test, source, global, and 4 more. tests/cases/compiler/assigningFromObjectToAnythingElse.ts(5,31): error TS2558: Expected 0 type arguments, but got 1. tests/cases/compiler/assigningFromObjectToAnythingElse.ts(6,31): error TS2558: Expected 0 type arguments, but got 1. tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Type 'Object' is not assignable to type 'Error'. The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? - Property 'name' is missing in type 'Object'. + Type 'Object' is missing the following properties from type 'Error': name, message ==== tests/cases/compiler/assigningFromObjectToAnythingElse.ts (4 errors) ==== @@ -15,7 +15,7 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Ty ~ !!! error TS2322: Type 'Object' is not assignable to type 'RegExp'. !!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? -!!! error TS2322: Property 'exec' is missing in type 'Object'. +!!! error TS2322: Type 'Object' is missing the following properties from type 'RegExp': exec, test, source, global, and 4 more. var a: String = Object.create(""); ~~~~~~ @@ -28,5 +28,5 @@ tests/cases/compiler/assigningFromObjectToAnythingElse.ts(8,5): error TS2322: Ty ~ !!! error TS2322: Type 'Object' is not assignable to type 'Error'. !!! error TS2322: The 'Object' type is assignable to very few other types. Did you mean to use the 'any' type instead? -!!! error TS2322: Property 'name' is missing in type 'Object'. +!!! error TS2322: Type 'Object' is missing the following properties from type 'Error': name, message \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompat1.errors.txt b/tests/baselines/reference/assignmentCompat1.errors.txt index e9fc3bd2f7f52..5398b2509e8d6 100644 --- a/tests/baselines/reference/assignmentCompat1.errors.txt +++ b/tests/baselines/reference/assignmentCompat1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assignmentCompat1.ts(4,1): error TS2322: Type '{ [index: string]: any; }' is not assignable to type '{ one: number; }'. - Property 'one' is missing in type '{ [index: string]: any; }'. + Property 'one' is missing in type { [index: string]: any; }' but present in type '{ one: number; }'. 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; }'. + Property 'one' is missing in type { [index: number]: any; }' but present in type '{ one: number; }'. tests/cases/compiler/assignmentCompat1.ts(8,1): error TS2322: Type '"foo"' is not assignable to type '{ [index: string]: any; }'. tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'false' is not assignable to type '{ [index: number]: any; }'. @@ -13,12 +13,12 @@ tests/cases/compiler/assignmentCompat1.ts(10,1): error TS2322: Type 'false' is n x = y; // Error ~ !!! error TS2322: Type '{ [index: string]: any; }' is not assignable to type '{ one: number; }'. -!!! error TS2322: Property 'one' is missing in type '{ [index: string]: any; }'. +!!! error TS2322: Property 'one' is missing in type { [index: string]: any; }' but present in type '{ one: number; }'. y = x; // Ok because index signature type is any x = z; // Error ~ !!! error TS2322: Type '{ [index: number]: any; }' is not assignable to type '{ one: number; }'. -!!! error TS2322: Property 'one' is missing in type '{ [index: number]: any; }'. +!!! error TS2322: Property 'one' is missing in type { [index: number]: any; }' but present in type '{ one: number; }'. z = x; // Ok because index signature type is any y = "foo"; // Error ~ diff --git a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt index b17973302c612..15cbd2ea15824 100644 --- a/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt +++ b/tests/baselines/reference/assignmentCompatBetweenTupleAndArray.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]'. - Property '0' is missing in type '{}[]'. + Property '0' is missing in type {}[]' but present in type '[{}]'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts (2 errors) ==== @@ -30,5 +30,5 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme emptyObjTuple = emptyObjArray; ~~~~~~~~~~~~~ !!! error TS2322: Type '{}[]' is not assignable to type '[{}]'. -!!! error TS2322: Property '0' is missing in type '{}[]'. +!!! error TS2322: Property '0' is missing in type {}[]' but present in type '[{}]'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt index 29ba96e6586d4..8b0ce8824b092 100644 --- a/tests/baselines/reference/assignmentCompatBug2.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -5,11 +5,11 @@ tests/cases/compiler/assignmentCompatBug2.ts(3,8): error TS2322: Type '{ a: numb tests/cases/compiler/assignmentCompatBug2.ts(5,13): error TS2322: Type '{ b: number; a: number; }' is not assignable to type '{ b: number; }'. Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. - Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. + Property 'm' is missing in type { f: (n: number) => number; g: (s: string) => number; }' but present in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. - Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. + Property 'g' is missing in type { f: (n: number) => number; m: number; }' but present in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. - Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. + Property 'm' is missing in type { f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' but present in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. ==== tests/cases/compiler/assignmentCompatBug2.ts (6 errors) ==== @@ -39,7 +39,7 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ !!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; }'. +!!! error TS2322: Property 'm' is missing in type { f: (n: number) => number; g: (s: string) => number; }' but present in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, }; // error @@ -47,7 +47,7 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ !!! error TS2322: Type '{ f: (n: number) => number; m: number; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -!!! error TS2322: Property 'g' is missing in type '{ f: (n: number) => number; m: number; }'. +!!! error TS2322: Property 'g' is missing in type { f: (n: number) => number; m: number; }' but present in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. f: (n) => { return 0; }, m: 0, }; // error @@ -63,7 +63,7 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b3 = { ~~ !!! error TS2322: Type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' is not assignable to type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. -!!! error TS2322: Property 'm' is missing in type '{ f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }'. +!!! error TS2322: Property 'm' is missing in type { f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; }' but present in type '{ f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt index 6686167cf1eae..f40f7a68702ca 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration. tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(4,17): error TS2322: Type 'false' is not assignable to type 'string'. -tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. - Property 'id' is missing in type '{ name: string; }'. +tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS2737: Property 'id' is missing in type { name: string; }' but present in type '{ id: number; name?: string; }'. ==== tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts (3 errors) ==== @@ -16,5 +15,4 @@ tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS !!! related TS6500 tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts:1:31: The expected type comes from property 'name' which is declared here on type '{ id: number; name?: string; }' foo({ name: "hello" }); // Error, id required but missing ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ name: string; }' is not assignable to parameter of type '{ id: number; name?: string; }'. -!!! error TS2345: Property 'id' is missing in type '{ name: string; }'. \ No newline at end of file +!!! error TS2737: Property 'id' is missing in type { name: string; }' but present in type '{ id: number; name?: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt index ffc0fdcd772fa..0b707e0bbd664 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures2.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(31,1): error TS2322: Type '() => number' is not assignable to type 'T'. - Property 'f' is missing in type '() => number'. + Property 'f' is missing in type () => number' but present in type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(32,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T'. - Property 'f' is missing in type '(x: number) => string'. + Property 'f' is missing in type (x: number) => string' but present in type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(33,1): error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }'. - Property 'f' is missing in type '() => number'. + Property 'f' is missing in type () => number' but present in type '{ f(x: number): void; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(34,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. - Property 'f' is missing in type '(x: number) => string'. + Property 'f' is missing in type (x: number) => string' but present in type '{ f(x: number): void; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(42,1): error TS2322: Type 'S2' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. @@ -17,9 +17,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(44,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. - Property 'f' is missing in type '(x: string) => number'. + Property 'f' is missing in type (x: string) => number' but present in type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(45,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. - Property 'f' is missing in type '(x: string) => string'. + Property 'f' is missing in type (x: string) => string' but present in type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(46,1): error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type '(x: number) => void'. @@ -31,9 +31,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(48,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. - Property 'f' is missing in type '(x: string) => number'. + Property 'f' is missing in type (x: string) => number' but present in type '{ f(x: number): void; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts(49,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. - Property 'f' is missing in type '(x: string) => string'. + Property 'f' is missing in type (x: string) => string' but present in type '{ f(x: number): void; }'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures2.ts (12 errors) ==== @@ -70,19 +70,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme t = () => 1; ~ !!! error TS2322: Type '() => number' is not assignable to type 'T'. -!!! error TS2322: Property 'f' is missing in type '() => number'. +!!! error TS2322: Property 'f' is missing in type () => number' but present in type 'T'. t = function (x: number) { return ''; } ~ !!! error TS2322: Type '(x: number) => string' is not assignable to type 'T'. -!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Property 'f' is missing in type (x: number) => string' but present in type 'T'. a = () => 1; ~ !!! error TS2322: Type '() => number' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2322: Property 'f' is missing in type '() => number'. +!!! error TS2322: Property 'f' is missing in type () => number' but present in type '{ f(x: number): void; }'. a = function (x: number) { return ''; } ~ !!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Property 'f' is missing in type (x: number) => string' but present in type '{ f(x: number): void; }'. interface S2 { f(x: string): void; @@ -107,11 +107,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme t = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. -!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Property 'f' is missing in type (x: string) => number' but present in type 'T'. t = function (x: string) { return ''; } ~ !!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. -!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Property 'f' is missing in type (x: string) => string' but present in type 'T'. a = s2; ~ !!! error TS2322: Type 'S2' is not assignable to type '{ f(x: number): void; }'. @@ -129,9 +129,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Property 'f' is missing in type (x: string) => number' but present in type '{ f(x: number): void; }'. a = function (x: string) { return ''; } ~ !!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f(x: number): void; }'. -!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Property 'f' is missing in type (x: string) => string' but present in type '{ f(x: number): void; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt index 441810033d262..3ca208e2ba193 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.errors.txt @@ -36,13 +36,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Types of parameters 'y' and 'y' are incompatible. Type 'T' is not assignable to type '{ foo: string; bar: string; }'. Type 'Base' is not assignable to type '{ foo: string; bar: string; }'. - Property 'bar' is missing in type 'Base'. + Property 'bar' is missing in type Base' but present in type '{ foo: string; bar: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(80,1): error TS2322: Type '(x: Base[], y: Derived2[]) => Derived[]' is not assignable to type '(x: Base[], y: T) => Derived[]'. Types of parameters 'y' and 'y' are incompatible. Type 'T' is not assignable to type 'Derived2[]'. Type 'Base[]' is not assignable to type 'Derived2[]'. Type 'Base' is not assignable to type 'Derived2'. - Property 'baz' is missing in type 'Base'. + Type 'Base' is missing the following properties from type 'Derived2': baz, bar tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(83,1): error TS2322: Type '(x: Base[], y: Derived[]) => Derived[]' is not assignable to type '(x: Base[], y: T) => T'. Type 'Derived[]' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignatures3.ts(85,1): error TS2322: Type '(x: { a: T; b: T; }) => T' is not assignable to type '(x: { a: string; b: number; }) => Object'. @@ -184,7 +184,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'T' is not assignable to type '{ foo: string; bar: string; }'. !!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; bar: string; }'. -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Property 'bar' is missing in type Base' but present in type '{ foo: string; bar: string; }'. var b12: >(x: Array, y: T) => Array; a12 = b12; // ok b12 = a12; // ok @@ -194,7 +194,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'T' is not assignable to type 'Derived2[]'. !!! error TS2322: Type 'Base[]' is not assignable to type 'Derived2[]'. !!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar var b13: >(x: Array, y: T) => T; a13 = b13; // ok b13 = a13; // ok diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt index 0155b8611c488..d9bfb91081d13 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures2.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(23,1): error TS2322: Type '() => number' is not assignable to type 'T'. - Property 'f' is missing in type '() => number'. + Property 'f' is missing in type () => number' but present in type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(24,1): error TS2322: Type '(x: number) => string' is not assignable to type 'T'. - Property 'f' is missing in type '(x: number) => string'. + Property 'f' is missing in type (x: number) => string' but present in type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(25,1): error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. - Property 'f' is missing in type '() => number'. + Property 'f' is missing in type () => number' but present in type '{ f: new (x: number) => void; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(26,1): error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. - Property 'f' is missing in type '(x: number) => string'. + Property 'f' is missing in type (x: number) => string' but present in type '{ f: new (x: number) => void; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(34,1): error TS2322: Type 'S2' is not assignable to type 'T'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. @@ -15,9 +15,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. Type '(x: string) => void' provides no match for the signature 'new (x: number): void'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(36,1): error TS2322: Type '(x: string) => number' is not assignable to type 'T'. - Property 'f' is missing in type '(x: string) => number'. + Property 'f' is missing in type (x: string) => number' but present in type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(37,1): error TS2322: Type '(x: string) => string' is not assignable to type 'T'. - Property 'f' is missing in type '(x: string) => string'. + Property 'f' is missing in type (x: string) => string' but present in type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(38,1): error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. Types of property 'f' are incompatible. Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. @@ -27,9 +27,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Type '(x: string) => void' is not assignable to type 'new (x: number) => void'. Type '(x: string) => void' provides no match for the signature 'new (x: number): void'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(40,1): error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. - Property 'f' is missing in type '(x: string) => number'. + Property 'f' is missing in type (x: string) => number' but present in type '{ f: new (x: number) => void; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts(41,1): error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. - Property 'f' is missing in type '(x: string) => string'. + Property 'f' is missing in type (x: string) => string' but present in type '{ f: new (x: number) => void; }'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures2.ts (12 errors) ==== @@ -58,19 +58,19 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme t = () => 1; ~ !!! error TS2322: Type '() => number' is not assignable to type 'T'. -!!! error TS2322: Property 'f' is missing in type '() => number'. +!!! error TS2322: Property 'f' is missing in type () => number' but present in type 'T'. t = function (x: number) { return ''; } ~ !!! error TS2322: Type '(x: number) => string' is not assignable to type 'T'. -!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Property 'f' is missing in type (x: number) => string' but present in type 'T'. a = () => 1; ~ !!! error TS2322: Type '() => number' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2322: Property 'f' is missing in type '() => number'. +!!! error TS2322: Property 'f' is missing in type () => number' but present in type '{ f: new (x: number) => void; }'. a = function (x: number) { return ''; } ~ !!! error TS2322: Type '(x: number) => string' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2322: Property 'f' is missing in type '(x: number) => string'. +!!! error TS2322: Property 'f' is missing in type (x: number) => string' but present in type '{ f: new (x: number) => void; }'. interface S2 { f(x: string): void; @@ -93,11 +93,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme t = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type 'T'. -!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Property 'f' is missing in type (x: string) => number' but present in type 'T'. t = function (x: string) { return ''; } ~ !!! error TS2322: Type '(x: string) => string' is not assignable to type 'T'. -!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Property 'f' is missing in type (x: string) => string' but present in type 'T'. a = s2; ~ !!! error TS2322: Type 'S2' is not assignable to type '{ f: new (x: number) => void; }'. @@ -113,9 +113,9 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (x: string) => 1; ~ !!! error TS2322: Type '(x: string) => number' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2322: Property 'f' is missing in type '(x: string) => number'. +!!! error TS2322: Property 'f' is missing in type (x: string) => number' but present in type '{ f: new (x: number) => void; }'. a = function (x: string) { return ''; } ~ !!! error TS2322: Type '(x: string) => string' is not assignable to type '{ f: new (x: number) => void; }'. -!!! error TS2322: Property 'f' is missing in type '(x: string) => string'. +!!! error TS2322: Property 'f' is missing in type (x: string) => string' but present in type '{ f: new (x: number) => void; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt index 3bce93635d07d..a5cda1700a7d1 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.errors.txt @@ -36,13 +36,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme Types of parameters 'y' and 'y' are incompatible. Type 'T' is not assignable to type '{ foo: string; bar: string; }'. Type 'Base' is not assignable to type '{ foo: string; bar: string; }'. - Property 'bar' is missing in type 'Base'. + Property 'bar' is missing in type Base' but present in type '{ foo: string; bar: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts(80,1): error TS2322: Type 'new (x: Base[], y: Derived2[]) => Derived[]' is not assignable to type 'new (x: Base[], y: T) => Derived[]'. Types of parameters 'y' and 'y' are incompatible. Type 'T' is not assignable to type 'Derived2[]'. Type 'Base[]' is not assignable to type 'Derived2[]'. Type 'Base' is not assignable to type 'Derived2'. - Property 'baz' is missing in type 'Base'. + Type 'Base' is missing the following properties from type 'Derived2': baz, bar tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts(83,1): error TS2322: Type 'new (x: Base[], y: Derived[]) => Derived[]' is not assignable to type 'new (x: Base[], y: T) => T'. Type 'Derived[]' is not assignable to type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithConstructSignatures3.ts(85,1): error TS2322: Type 'new (x: { a: T; b: T; }) => T' is not assignable to type 'new (x: { a: string; b: number; }) => Object'. @@ -184,7 +184,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'T' is not assignable to type '{ foo: string; bar: string; }'. !!! error TS2322: Type 'Base' is not assignable to type '{ foo: string; bar: string; }'. -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Property 'bar' is missing in type Base' but present in type '{ foo: string; bar: string; }'. var b12: new >(x: Array, y: T) => Array; a12 = b12; // ok b12 = a12; // ok @@ -194,7 +194,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'T' is not assignable to type 'Derived2[]'. !!! error TS2322: Type 'Base[]' is not assignable to type 'Derived2[]'. !!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar var b13: new >(x: Array, y: T) => T; a13 = b13; // ok b13 = a13; // ok diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt index c5987a93ddf7f..b23274cb2466d 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'Base'. + Property 'bar' is missing in type Base' but present in type 'Derived'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. - Property 'baz' is missing in type 'Base'. + Type 'Base' is missing the following properties from type 'Derived2': baz, bar tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. @@ -41,7 +41,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Property 'bar' is missing in type Base' but present in type 'Derived'. var b2: { [x: number]: Derived2; } a = b2; @@ -50,7 +50,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar module Generics { class A { diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt index f91d0dd0c1505..3d1f92a254f62 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer2.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(14,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'Base'. + Property 'bar' is missing in type Base' but present in type 'Derived'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(18,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. - Property 'baz' is missing in type 'Base'. + Type 'Base' is missing the following properties from type 'Derived2': baz, bar tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer2.ts(32,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. @@ -41,7 +41,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Property 'bar' is missing in type Base' but present in type 'Derived'. var b2: { [x: number]: Derived2; } a = b2; @@ -50,7 +50,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar module Generics { interface A { diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt index 61f9e082a481c..34a2aee6b7054 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(14,1): error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'Base'. + Property 'bar' is missing in type Base' but present in type 'Derived'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(23,1): error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'Derived2'. - Property 'baz' is missing in type 'Derived'. + Property 'baz' is missing in type Derived' but present in type 'Derived2'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithNumericIndexer3.ts(33,9): error TS2322: Type '{ [x: number]: Derived; }' is not assignable to type 'A'. Index signatures are incompatible. Type 'Derived' is not assignable to type 'T'. @@ -30,7 +30,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type '{ [x: number]: Base; }' is not assignable to type 'A'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Property 'bar' is missing in type Base' but present in type 'Derived'. b = a; // ok class B2 extends A { @@ -44,7 +44,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'A' is not assignable to type '{ [x: number]: Derived2; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Property 'baz' is missing in type Derived' but present in type 'Derived2'. module Generics { class A { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt index 0fdae0b7cfa30..772b9348140e3 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(24,5): error TS2322: Type 'T' is not assignable to type 'S'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'Derived2'. + Property 'bar' is missing in type Derived2' but present in type 'Derived'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(25,5): error TS2322: Type 'S' is not assignable to type 'T'. Types of property 'foo' are incompatible. Type 'Derived' is not assignable to type 'Derived2'. - Property 'baz' is missing in type 'Derived'. + Property 'baz' is missing in type Derived' but present in type 'Derived2'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(29,5): error TS2322: Type 'T2' is not assignable to type 'S2'. Types of property 'foo' are incompatible. Type 'Derived2' is not assignable to type 'Derived'. @@ -42,7 +42,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(70,5): error TS2322: Type 'S' is not assignable to type 'T'. Types of property 'foo' are incompatible. Type 'Base' is not assignable to type 'Derived2'. - Property 'baz' is missing in type 'Base'. + Property 'baz' is missing in type Base' but present in type 'Derived2'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers4.ts(75,5): error TS2322: Type 'S2' is not assignable to type 'T2'. Types of property 'foo' are incompatible. Type 'Base' is not assignable to type 'Derived2'. @@ -83,13 +83,13 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'T' is not assignable to type 'S'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type 'Derived2' is not assignable to type 'Derived'. -!!! error TS2322: Property 'bar' is missing in type 'Derived2'. +!!! error TS2322: Property 'bar' is missing in type Derived2' but present in type 'Derived'. t = s; // error ~ !!! error TS2322: Type 'S' is not assignable to type 'T'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type 'Derived' is not assignable to type 'Derived2'. -!!! error TS2322: Property 'baz' is missing in type 'Derived'. +!!! error TS2322: Property 'baz' is missing in type Derived' but present in type 'Derived2'. s = s2; // ok s = a2; // ok @@ -183,7 +183,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'S' is not assignable to type 'T'. !!! error TS2322: Types of property 'foo' are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Property 'baz' is missing in type Base' but present in type 'Derived2'. s = s2; // ok s = a2; // ok diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt index f9f7e48c68549..dcdac53dde3e0 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers5.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(13,1): error TS2322: Type 'I' is not assignable to type 'C'. - Property 'foo' is missing in type 'I'. + Property 'foo' is missing in type I' but present in type 'C'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts(14,1): error TS2322: Type 'C' is not assignable to type 'I'. - Property 'fooo' is missing in type 'C'. + Property 'fooo' is missing in type C' but present in type 'I'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers5.ts (2 errors) ==== @@ -20,8 +20,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = i; // error ~ !!! error TS2322: Type 'I' is not assignable to type 'C'. -!!! error TS2322: Property 'foo' is missing in type 'I'. +!!! error TS2322: Property 'foo' is missing in type I' but present in type 'C'. i = c; // error ~ !!! error TS2322: Type 'C' is not assignable to type 'I'. -!!! error TS2322: Property 'fooo' is missing in type 'C'. \ No newline at end of file +!!! error TS2322: Property 'fooo' is missing in type C' but present in type 'I'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt index 0d7fe1071e919..48055cdbf8df5 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.errors.txt @@ -8,23 +8,23 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(40,5): error TS2559: Type 'E' has no properties in common with type '{ opt?: Base; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(41,5): error TS2559: Type 'F' has no properties in common with type '{ opt?: Base; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(74,5): error TS2322: Type 'D' is not assignable to type 'C'. - Property 'opt' is missing in type 'D'. + Property 'opt' is missing in type D' but present in type 'C'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(75,5): error TS2322: Type 'E' is not assignable to type 'C'. - Property 'opt' is missing in type 'E'. + Property 'opt' is missing in type E' but present in type 'C'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(76,5): error TS2322: Type 'F' is not assignable to type 'C'. - Property 'opt' is missing in type 'F'. + Property 'opt' is missing in type F' but present in type 'C'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(79,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. - Property 'opt' is missing in type 'D'. + Property 'opt' is missing in type D' but present in type '{ opt: Base; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(80,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. - Property 'opt' is missing in type 'E'. + Property 'opt' is missing in type E' but present in type '{ opt: Base; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(81,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. - Property 'opt' is missing in type 'F'. + Property 'opt' is missing in type F' but present in type '{ opt: Base; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(84,5): error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. - Property 'opt' is missing in type 'D'. + Property 'opt' is missing in type D' but present in type '{ opt: Base; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(85,5): error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. - Property 'opt' is missing in type 'E'. + Property 'opt' is missing in type E' but present in type '{ opt: Base; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts(86,5): error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. - Property 'opt' is missing in type 'F'. + Property 'opt' is missing in type F' but present in type '{ opt: Base; }'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersOptionality2.ts (18 errors) ==== @@ -122,43 +122,43 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme c = d; // error ~ !!! error TS2322: Type 'D' is not assignable to type 'C'. -!!! error TS2322: Property 'opt' is missing in type 'D'. +!!! error TS2322: Property 'opt' is missing in type D' but present in type 'C'. c = e; // error ~ !!! error TS2322: Type 'E' is not assignable to type 'C'. -!!! error TS2322: Property 'opt' is missing in type 'E'. +!!! error TS2322: Property 'opt' is missing in type E' but present in type 'C'. c = f; // error ~ !!! error TS2322: Type 'F' is not assignable to type 'C'. -!!! error TS2322: Property 'opt' is missing in type 'F'. +!!! error TS2322: Property 'opt' is missing in type F' but present in type 'C'. c = a; // ok a = d; // error ~ !!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. -!!! error TS2322: Property 'opt' is missing in type 'D'. +!!! error TS2322: Property 'opt' is missing in type D' but present in type '{ opt: Base; }'. a = e; // error ~ !!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. -!!! error TS2322: Property 'opt' is missing in type 'E'. +!!! error TS2322: Property 'opt' is missing in type E' but present in type '{ opt: Base; }'. a = f; // error ~ !!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. -!!! error TS2322: Property 'opt' is missing in type 'F'. +!!! error TS2322: Property 'opt' is missing in type F' but present in type '{ opt: Base; }'. a = c; // ok b = d; // error ~ !!! error TS2322: Type 'D' is not assignable to type '{ opt: Base; }'. -!!! error TS2322: Property 'opt' is missing in type 'D'. +!!! error TS2322: Property 'opt' is missing in type D' but present in type '{ opt: Base; }'. b = e; // error ~ !!! error TS2322: Type 'E' is not assignable to type '{ opt: Base; }'. -!!! error TS2322: Property 'opt' is missing in type 'E'. +!!! error TS2322: Property 'opt' is missing in type E' but present in type '{ opt: Base; }'. b = f; // error ~ !!! error TS2322: Type 'F' is not assignable to type '{ opt: Base; }'. -!!! error TS2322: Property 'opt' is missing in type 'F'. +!!! error TS2322: Property 'opt' is missing in type F' but present in type '{ opt: Base; }'. b = a; // ok b = c; // ok } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt index d86c73f5cf836..65fcacc51964e 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersStringNumericNames.errors.txt @@ -1,61 +1,61 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(21,5): error TS2322: Type 'T' is not assignable to type 'S'. - Property ''1'' is missing in type 'T'. + Property ''1'' is missing in type T' but present in type 'S'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(22,5): error TS2322: Type 'S' is not assignable to type 'T'. - Property ''1.'' is missing in type 'S'. + Property ''1.'' is missing in type S' but present in type 'T'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(24,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. - Property ''1'' is missing in type '{ '1.0': string; }'. + Property ''1'' is missing in type { '1.0': string; }' but present in type 'S'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(26,5): error TS2322: Type 'T2' is not assignable to type 'S2'. - Property ''1'' is missing in type 'T2'. + Property ''1'' is missing in type T2' but present in type 'S2'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(27,5): error TS2322: Type 'S2' is not assignable to type 'T2'. - Property ''1.0'' is missing in type 'S2'. + Property ''1.0'' is missing in type S2' but present in type 'T2'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(28,5): error TS2322: Type 'T' is not assignable to type 'S2'. - Property ''1'' is missing in type 'T'. + Property ''1'' is missing in type T' but present in type 'S2'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(29,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. - Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. + Property ''1'' is missing in type { '1.0': string; baz?: string; }' but present in type 'S2'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(30,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. - Property ''1'' is missing in type '{ '1.0': string; }'. + Property ''1'' is missing in type { '1.0': string; }' but present in type 'S2'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(32,5): error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. - Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. + Property ''1.'' is missing in type { '1.0': string; baz?: string; }' but present in type '{ '1.': string; bar?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(33,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. - Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. + Property ''1.0'' is missing in type { '1.': string; bar?: string; }' but present in type '{ '1.0': string; baz?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(34,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. - Property ''1.'' is missing in type 'S'. + Property ''1.'' is missing in type S' but present in type '{ '1.': string; bar?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(35,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. - Property ''1.'' is missing in type 'S2'. + Property ''1.'' is missing in type S2' but present in type '{ '1.': string; bar?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(36,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. - Property ''1.'' is missing in type '{ '1.0': string; }'. + Property ''1.'' is missing in type { '1.0': string; }' but present in type '{ '1.': string; bar?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(38,5): error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. - Property ''1.0'' is missing in type '{ '1': string; }'. + Property ''1.0'' is missing in type { '1': string; }' but present in type '{ '1.0': string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(39,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. - Property ''1'' is missing in type '{ '1.0': string; }'. + Property ''1'' is missing in type { '1.0': string; }' but present in type '{ '1': string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(42,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. - Property ''1.0'' is missing in type 'T'. + Property ''1.0'' is missing in type T' but present in type '{ '1.0': string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(65,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. - Property ''1'' is missing in type '{ '1.0': string; }'. + Property ''1'' is missing in type { '1.0': string; }' but present in type 'S'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(71,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. - Property ''1'' is missing in type '{ '1.0': string; }'. + Property ''1'' is missing in type { '1.0': string; }' but present in type 'S2'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(73,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. - Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. + Property ''1.'' is missing in type { 1.0: string; baz?: string; }' but present in type '{ '1.': string; bar?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(74,5): error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. - Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. + Property '1.0' is missing in type { '1.': string; bar?: string; }' but present in type '{ 1.0: string; baz?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(75,5): error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. - Property ''1.'' is missing in type 'S'. + Property ''1.'' is missing in type S' but present in type '{ '1.': string; bar?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(76,5): error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. - Property ''1.'' is missing in type 'S2'. + Property ''1.'' is missing in type S2' but present in type '{ '1.': string; bar?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(77,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. - Property ''1.'' is missing in type '{ '1.0': string; }'. + Property ''1.'' is missing in type { '1.0': string; }' but present in type '{ '1.': string; bar?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(78,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. - Property ''1.'' is missing in type '{ 1.: string; }'. + Property ''1.'' is missing in type { 1.: string; }' but present in type '{ '1.': string; bar?: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(80,5): error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. - Property ''1.0'' is missing in type '{ 1.: string; }'. + Property ''1.0'' is missing in type { 1.: string; }' but present in type '{ '1.0': string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(81,5): error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. - Property '1.' is missing in type '{ '1.0': string; }'. + Property '1.' is missing in type { '1.0': string; }' but present in type '{ 1.: string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(82,5): error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. - Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. + Property ''1.0'' is missing in type { 1.0: string; baz?: string; }' but present in type '{ '1.0': string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(83,5): error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }'. - Property ''1.0'' is missing in type 'T2'. + Property ''1.0'' is missing in type T2' but present in type '{ '1.0': string; }'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts(84,5): error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. - Property ''1.0'' is missing in type 'T'. + Property ''1.0'' is missing in type T' but present in type '{ '1.0': string; }'. ==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembersStringNumericNames.ts (29 errors) ==== @@ -82,73 +82,73 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = t; ~ !!! error TS2322: Type 'T' is not assignable to type 'S'. -!!! error TS2322: Property ''1'' is missing in type 'T'. +!!! error TS2322: Property ''1'' is missing in type T' but present in type 'S'. t = s; ~ !!! error TS2322: Type 'S' is not assignable to type 'T'. -!!! error TS2322: Property ''1.'' is missing in type 'S'. +!!! error TS2322: Property ''1.'' is missing in type S' but present in type 'T'. s = s2; // ok s = a2; ~ !!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Property ''1'' is missing in type { '1.0': string; }' but present in type 'S'. s2 = t2; ~~ !!! error TS2322: Type 'T2' is not assignable to type 'S2'. -!!! error TS2322: Property ''1'' is missing in type 'T2'. +!!! error TS2322: Property ''1'' is missing in type T2' but present in type 'S2'. t2 = s2; ~~ !!! error TS2322: Type 'S2' is not assignable to type 'T2'. -!!! error TS2322: Property ''1.0'' is missing in type 'S2'. +!!! error TS2322: Property ''1.0'' is missing in type S2' but present in type 'T2'. s2 = t; ~~ !!! error TS2322: Type 'T' is not assignable to type 'S2'. -!!! error TS2322: Property ''1'' is missing in type 'T'. +!!! error TS2322: Property ''1'' is missing in type T' but present in type 'S2'. s2 = b; ~~ !!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type 'S2'. -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; baz?: string; }'. +!!! error TS2322: Property ''1'' is missing in type { '1.0': string; baz?: string; }' but present in type 'S2'. s2 = a2; ~~ !!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Property ''1'' is missing in type { '1.0': string; }' but present in type 'S2'. a = b; ~ !!! error TS2322: Type '{ '1.0': string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; baz?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type { '1.0': string; baz?: string; }' but present in type '{ '1.': string; bar?: string; }'. b = a; ~ !!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ '1.0': string; baz?: string; }'. -!!! error TS2322: Property ''1.0'' is missing in type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property ''1.0'' is missing in type { '1.': string; bar?: string; }' but present in type '{ '1.0': string; baz?: string; }'. a = s; ~ !!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2322: Property ''1.'' is missing in type 'S'. +!!! error TS2322: Property ''1.'' is missing in type S' but present in type '{ '1.': string; bar?: string; }'. a = s2; ~ !!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2322: Property ''1.'' is missing in type 'S2'. +!!! error TS2322: Property ''1.'' is missing in type S2' but present in type '{ '1.': string; bar?: string; }'. a = a2; ~ !!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.'' is missing in type { '1.0': string; }' but present in type '{ '1.': string; bar?: string; }'. a2 = b2; ~~ !!! error TS2322: Type '{ '1': string; }' is not assignable to type '{ '1.0': string; }'. -!!! error TS2322: Property ''1.0'' is missing in type '{ '1': string; }'. +!!! error TS2322: Property ''1.0'' is missing in type { '1': string; }' but present in type '{ '1.0': string; }'. b2 = a2; ~~ !!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1': string; }'. -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Property ''1'' is missing in type { '1.0': string; }' but present in type '{ '1': string; }'. a2 = b; // ok a2 = t2; // ok a2 = t; ~~ !!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. -!!! error TS2322: Property ''1.0'' is missing in type 'T'. +!!! error TS2322: Property ''1.0'' is missing in type T' but present in type '{ '1.0': string; }'. } module NumbersAndStrings { @@ -174,7 +174,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s = a2; // error ~ !!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S'. -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Property ''1'' is missing in type { '1.0': string; }' but present in type 'S'. s2 = t2; // ok t2 = s2; // ok @@ -183,51 +183,51 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme s2 = a2; // error ~~ !!! error TS2322: Type '{ '1.0': string; }' is not assignable to type 'S2'. -!!! error TS2322: Property ''1'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Property ''1'' is missing in type { '1.0': string; }' but present in type 'S2'. a = b; // error ~ !!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2322: Property ''1.'' is missing in type '{ 1.0: string; baz?: string; }'. +!!! error TS2322: Property ''1.'' is missing in type { 1.0: string; baz?: string; }' but present in type '{ '1.': string; bar?: string; }'. b = a; // error ~ !!! error TS2322: Type '{ '1.': string; bar?: string; }' is not assignable to type '{ 1.0: string; baz?: string; }'. -!!! error TS2322: Property '1.0' is missing in type '{ '1.': string; bar?: string; }'. +!!! error TS2322: Property '1.0' is missing in type { '1.': string; bar?: string; }' but present in type '{ 1.0: string; baz?: string; }'. a = s; // error ~ !!! error TS2322: Type 'S' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2322: Property ''1.'' is missing in type 'S'. +!!! error TS2322: Property ''1.'' is missing in type S' but present in type '{ '1.': string; bar?: string; }'. a = s2; // error ~ !!! error TS2322: Type 'S2' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2322: Property ''1.'' is missing in type 'S2'. +!!! error TS2322: Property ''1.'' is missing in type S2' but present in type '{ '1.': string; bar?: string; }'. a = a2; // error ~ !!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2322: Property ''1.'' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Property ''1.'' is missing in type { '1.0': string; }' but present in type '{ '1.': string; bar?: string; }'. a = b2; // error ~ !!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.': string; bar?: string; }'. -!!! error TS2322: Property ''1.'' is missing in type '{ 1.: string; }'. +!!! error TS2322: Property ''1.'' is missing in type { 1.: string; }' but present in type '{ '1.': string; bar?: string; }'. a2 = b2; // error ~~ !!! error TS2322: Type '{ 1.: string; }' is not assignable to type '{ '1.0': string; }'. -!!! error TS2322: Property ''1.0'' is missing in type '{ 1.: string; }'. +!!! error TS2322: Property ''1.0'' is missing in type { 1.: string; }' but present in type '{ '1.0': string; }'. b2 = a2; // error ~~ !!! error TS2322: Type '{ '1.0': string; }' is not assignable to type '{ 1.: string; }'. -!!! error TS2322: Property '1.' is missing in type '{ '1.0': string; }'. +!!! error TS2322: Property '1.' is missing in type { '1.0': string; }' but present in type '{ 1.: string; }'. a2 = b; // error ~~ !!! error TS2322: Type '{ 1.0: string; baz?: string; }' is not assignable to type '{ '1.0': string; }'. -!!! error TS2322: Property ''1.0'' is missing in type '{ 1.0: string; baz?: string; }'. +!!! error TS2322: Property ''1.0'' is missing in type { 1.0: string; baz?: string; }' but present in type '{ '1.0': string; }'. a2 = t2; // error ~~ !!! error TS2322: Type 'T2' is not assignable to type '{ '1.0': string; }'. -!!! error TS2322: Property ''1.0'' is missing in type 'T2'. +!!! error TS2322: Property ''1.0'' is missing in type T2' but present in type '{ '1.0': string; }'. a2 = t; // error ~~ !!! error TS2322: Type 'T' is not assignable to type '{ '1.0': string; }'. -!!! error TS2322: Property ''1.0'' is missing in type 'T'. +!!! error TS2322: Property ''1.0'' is missing in type T' but present in type '{ '1.0': string; }'. } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt index 51762bb941834..8304e9597516e 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'Base'. + Property 'bar' is missing in type Base' but present in type 'Derived'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. - Property 'baz' is missing in type 'Base'. + Type 'Base' is missing the following properties from type 'Derived2': baz, bar tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. @@ -48,7 +48,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Property 'bar' is missing in type Base' but present in type 'Derived'. var b2: { [x: string]: Derived2; } a = b2; // ok @@ -57,7 +57,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar module Generics { class A { diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt index 0b0d70d01bb51..d820a71af3be0 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer2.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(15,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. - Property 'bar' is missing in type 'Base'. + Property 'bar' is missing in type Base' but present in type 'Derived'. tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(19,1): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived2'. - Property 'baz' is missing in type 'Base'. + Type 'Base' is missing the following properties from type 'Derived2': baz, bar tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithStringIndexer2.ts(33,5): error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. Index signatures are incompatible. Type 'Base' is not assignable to type 'Derived'. @@ -48,7 +48,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived'. -!!! error TS2322: Property 'bar' is missing in type 'Base'. +!!! error TS2322: Property 'bar' is missing in type Base' but present in type 'Derived'. var b2: { [x: string]: Derived2; } a = b2; // ok @@ -57,7 +57,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme !!! error TS2322: Type 'A' is not assignable to type '{ [x: string]: Derived2; }'. !!! error TS2322: Index signatures are incompatible. !!! error TS2322: Type 'Base' is not assignable to type 'Derived2'. -!!! error TS2322: Property 'baz' is missing in type 'Base'. +!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar module Generics { interface A { 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 e9adcba03b73b..59055a08741ee 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,14 +1,13 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(10,1): error TS2322: Type '""' is not assignable to type 'Applicable'. 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[]'. + Property 'apply' is missing in type string[]' but present in type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(12,1): error TS2322: Type '4' is not assignable to type 'Applicable'. 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 '{}'. + Property 'apply' is missing in type {}' but present in type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type '""' is not assignable to parameter of type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Applicable'. tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type '4' is not assignable to parameter of type 'Applicable'. -tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Applicable'. - Property 'apply' is missing in type '{}'. +tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts(25,4): error TS2737: Property 'apply' is missing in type {}' but present in type 'Applicable'. ==== tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-function-interface.ts (8 errors) ==== @@ -27,14 +26,14 @@ 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[]'. +!!! error TS2322: Property 'apply' is missing in type string[]' but present in type 'Applicable'. x = 4; ~ !!! error TS2322: Type '4' is not assignable to type 'Applicable'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Applicable'. -!!! error TS2322: Property 'apply' is missing in type '{}'. +!!! error TS2322: Property 'apply' is missing in type {}' but present in type 'Applicable'. // Should work function f() { }; @@ -54,8 +53,7 @@ tests/cases/compiler/assignmentCompatability_checking-apply-member-off-of-functi !!! error TS2345: Argument of type '4' is not assignable to parameter of type 'Applicable'. fn({}); ~~ -!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'Applicable'. -!!! error TS2345: Property 'apply' is missing in type '{}'. +!!! error TS2737: Property 'apply' is missing in type {}' but present in type 'Applicable'. // Should work 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 1755630217870..c6099d3d2ddcb 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,14 +1,13 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(10,1): error TS2322: Type '""' is not assignable to type 'Callable'. 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[]'. + Property 'call' is missing in type string[]' but present in type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(12,1): error TS2322: Type '4' is not assignable to type 'Callable'. 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 '{}'. + Property 'call' is missing in type {}' but present in type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(22,4): error TS2345: Argument of type '""' is not assignable to parameter of type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(23,4): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'Callable'. tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(24,4): error TS2345: Argument of type '4' is not assignable to parameter of type 'Callable'. -tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(25,4): error TS2345: Argument of type '{}' is not assignable to parameter of type 'Callable'. - Property 'call' is missing in type '{}'. +tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts(25,4): error TS2737: Property 'call' is missing in type {}' but present in type 'Callable'. ==== tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-function-interface.ts (8 errors) ==== @@ -27,14 +26,14 @@ 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[]'. +!!! error TS2322: Property 'call' is missing in type string[]' but present in type 'Callable'. x = 4; ~ !!! error TS2322: Type '4' is not assignable to type 'Callable'. x = {}; ~ !!! error TS2322: Type '{}' is not assignable to type 'Callable'. -!!! error TS2322: Property 'call' is missing in type '{}'. +!!! error TS2322: Property 'call' is missing in type {}' but present in type 'Callable'. // Should work function f() { }; @@ -54,8 +53,7 @@ tests/cases/compiler/assignmentCompatability_checking-call-member-off-of-functio !!! error TS2345: Argument of type '4' is not assignable to parameter of type 'Callable'. fn({}); ~~ -!!! error TS2345: Argument of type '{}' is not assignable to parameter of type 'Callable'. -!!! error TS2345: Property 'call' is missing in type '{}'. +!!! error TS2737: Property 'call' is missing in type {}' but present in type 'Callable'. // Should work diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt index 9e28f5e917782..31ea9c7116069 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt +++ b/tests/baselines/reference/assignmentToObjectAndFunction.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(1,24): error TS2322: Type 'number' is not assignable to type '() => string'. tests/cases/compiler/assignmentToObjectAndFunction.ts(8,5): error TS2322: Type '{}' is not assignable to type 'Function'. - Property 'apply' is missing in type '{}'. + Type '{}' is missing the following properties from type 'Function': apply, call, bind, prototype, and 3 more. tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type 'typeof bad' is not assignable to type 'Function'. Types of property 'apply' are incompatible. Type 'number' is not assignable to type '(this: Function, thisArg: any, argArray?: any) => any'. @@ -19,7 +19,7 @@ tests/cases/compiler/assignmentToObjectAndFunction.ts(29,5): error TS2322: Type var errFun: Function = {}; // Error for no call signature ~~~~~~ !!! error TS2322: Type '{}' is not assignable to type 'Function'. -!!! error TS2322: Property 'apply' is missing in type '{}'. +!!! error TS2322: Type '{}' is missing the following properties from type 'Function': apply, call, bind, prototype, and 3 more. function foo() { } module foo { diff --git a/tests/baselines/reference/bases.errors.txt b/tests/baselines/reference/bases.errors.txt index 3069f977fe12c..92fa723ad5300 100644 --- a/tests/baselines/reference/bases.errors.txt +++ b/tests/baselines/reference/bases.errors.txt @@ -2,7 +2,7 @@ tests/cases/compiler/bases.ts(7,14): error TS2339: Property 'y' does not exist o tests/cases/compiler/bases.ts(7,15): error TS1005: ';' expected. tests/cases/compiler/bases.ts(7,17): error TS2693: 'any' only refers to a type, but is being used as a value here. tests/cases/compiler/bases.ts(11,7): error TS2420: Class 'C' incorrectly implements interface 'I'. - Property 'x' is missing in type 'C'. + Property 'x' is missing in type C' but present in type 'I'. tests/cases/compiler/bases.ts(12,5): error TS2377: Constructors for derived classes must contain a 'super' call. tests/cases/compiler/bases.ts(13,9): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. tests/cases/compiler/bases.ts(13,14): error TS2339: Property 'x' does not exist on type 'C'. @@ -32,7 +32,7 @@ tests/cases/compiler/bases.ts(18,9): error TS2339: Property 'y' does not exist o class C extends B implements I { ~ !!! error TS2420: Class 'C' incorrectly implements interface 'I'. -!!! error TS2420: Property 'x' is missing in type 'C'. +!!! error TS2420: Property 'x' is missing in type C' but present in type 'I'. constructor() { ~~~~~~~~~~~~~~~ this.x: any; diff --git a/tests/baselines/reference/bluebirdStaticThis.errors.txt b/tests/baselines/reference/bluebirdStaticThis.errors.txt index b9e28711715a0..bb7c85ea9a4c4 100644 --- a/tests/baselines/reference/bluebirdStaticThis.errors.txt +++ b/tests/baselines/reference/bluebirdStaticThis.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/bluebirdStaticThis.ts(5,22): error TS2420: Class 'Promise' incorrectly implements interface 'Thenable'. - Property 'then' is missing in type 'Promise'. + Property 'then' is missing in type Promise' but present in type 'Thenable'. tests/cases/compiler/bluebirdStaticThis.ts(22,51): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Resolver'. tests/cases/compiler/bluebirdStaticThis.ts(57,109): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. tests/cases/compiler/bluebirdStaticThis.ts(58,91): error TS2694: Namespace '"tests/cases/compiler/bluebirdStaticThis".Promise' has no exported member 'Inspection'. @@ -15,7 +15,7 @@ tests/cases/compiler/bluebirdStaticThis.ts(60,73): error TS2694: Namespace '"tes export declare class Promise implements Promise.Thenable { ~~~~~~~ !!! error TS2420: Class 'Promise' incorrectly implements interface 'Thenable'. -!!! error TS2420: Property 'then' is missing in type 'Promise'. +!!! error TS2420: Property 'then' is missing in type Promise' but present in type 'Thenable'. constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable) => void, reject: (error: any) => void) => void); static try(dit: typeof Promise, fn: () => Promise.Thenable, args?: any[], ctx?: any): Promise; static try(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise; diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt index 08e2b32a8583a..40c6758207340 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -1,17 +1,14 @@ -tests/cases/conformance/types/tuple/castingTuple.ts(13,23): error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Property '2' is missing in type '[number, string]'. +tests/cases/conformance/types/tuple/castingTuple.ts(13,23): error TS2737: Property '2' is missing in type [number, string]' but present in type '[number, string, boolean]'. tests/cases/conformance/types/tuple/castingTuple.ts(14,15): error TS2352: Conversion of type '[number, string, boolean]' to type '[number, string]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Types of property 'length' are incompatible. Type '3' is not comparable to type '2'. tests/cases/conformance/types/tuple/castingTuple.ts(15,14): error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. -tests/cases/conformance/types/tuple/castingTuple.ts(18,21): error TS2352: Conversion of type '[C, D]' to type '[C, D, A]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Property '2' is missing in type '[C, D]'. +tests/cases/conformance/types/tuple/castingTuple.ts(18,21): error TS2737: Property '2' is missing in type [C, D]' but present in type '[C, D, A]'. tests/cases/conformance/types/tuple/castingTuple.ts(20,33): error TS2339: Property '5' does not exist on type '[C, D, A]'. tests/cases/conformance/types/tuple/castingTuple.ts(30,10): error TS2352: Conversion of type '[number, string]' to type '[number, number]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Type 'string' is not comparable to type 'number'. tests/cases/conformance/types/tuple/castingTuple.ts(31,10): error TS2352: Conversion of type '[C, D]' to type '[A, I]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'C' is not comparable to type 'A'. - Property 'a' is missing in type 'C'. + Property 'a' is missing in type C' but present in type 'A'. tests/cases/conformance/types/tuple/castingTuple.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot find name 't4'. @@ -31,8 +28,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot var emptyObjTuple = <[{}, {}]>numStrTuple; var numStrBoolTuple = <[number, string, boolean]>numStrTuple; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. -!!! error TS2352: Property '2' is missing in type '[number, string]'. +!!! error TS2737: Property '2' is missing in type [number, string]' but present in type '[number, string, boolean]'. var shorter = numStrBoolTuple as [number, string] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2352: Conversion of type '[number, string, boolean]' to type '[number, string]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. @@ -45,8 +41,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot var interfaceIITuple = <[I, I]>classCDTuple; var classCDATuple = <[C, D, A]>classCDTuple; ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2352: Conversion of type '[C, D]' to type '[C, D, A]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. -!!! error TS2352: Property '2' is missing in type '[C, D]'. +!!! error TS2737: Property '2' is missing in type [C, D]' but present in type '[C, D, A]'. var eleFromCDA1 = classCDATuple[2]; // A var eleFromCDA2 = classCDATuple[5]; // C | D | A ~ @@ -67,8 +62,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot var t9 = <[A, I]>classCDTuple; ~~~~~~~~~~~~~~~~~~~~ !!! error TS2352: Conversion of type '[C, D]' to type '[A, I]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. -!!! error TS2352: Type 'C' is not comparable to type 'A'. -!!! error TS2352: Property 'a' is missing in type 'C'. +!!! error TS2352: Property 'a' is missing in type C' but present in type 'A'. var array1 = numStrTuple; ~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. diff --git a/tests/baselines/reference/chainedAssignment1.errors.txt b/tests/baselines/reference/chainedAssignment1.errors.txt index 3fa654c62cc3e..e6fdbd58026e0 100644 --- a/tests/baselines/reference/chainedAssignment1.errors.txt +++ b/tests/baselines/reference/chainedAssignment1.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/chainedAssignment1.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X'. - Property 'a' is missing in type 'Z'. + Property 'a' is missing in type Z' but present in type 'X'. tests/cases/compiler/chainedAssignment1.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y'. - Property 'a' is missing in type 'Z'. + Type 'Z' is missing the following properties from type 'Y': a, b tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2322: Type 'Z' is not assignable to type 'Y'. @@ -29,10 +29,10 @@ tests/cases/compiler/chainedAssignment1.ts(22,1): error TS2322: Type 'Z' is not c1 = c2 = c3; // a bug made this not report the same error as below ~~ !!! error TS2322: Type 'Z' is not assignable to type 'X'. -!!! error TS2322: Property 'a' is missing in type 'Z'. +!!! error TS2322: Property 'a' is missing in type Z' but present in type 'X'. ~~ !!! error TS2322: Type 'Z' is not assignable to type 'Y'. -!!! error TS2322: Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is missing the following properties from type 'Y': a, b c2 = c3; // Error TS111: Cannot convert Z to Y ~~ !!! error TS2322: Type 'Z' is not assignable to type 'Y'. \ No newline at end of file diff --git a/tests/baselines/reference/chainedAssignment3.errors.txt b/tests/baselines/reference/chainedAssignment3.errors.txt index 8a64a35cbc08a..e556cfb65e843 100644 --- a/tests/baselines/reference/chainedAssignment3.errors.txt +++ b/tests/baselines/reference/chainedAssignment3.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/chainedAssignment3.ts(18,1): error TS2322: Type 'A' is not assignable to type 'B'. - Property 'value' is missing in type 'A'. + Property 'value' is missing in type A' but present in type 'B'. tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2322: Type 'A' is not assignable to type 'B'. @@ -24,7 +24,7 @@ tests/cases/compiler/chainedAssignment3.ts(19,5): error TS2322: Type 'A' is not b = a = new A(); ~ !!! error TS2322: Type 'A' is not assignable to type 'B'. -!!! error TS2322: Property 'value' is missing in type 'A'. +!!! error TS2322: Property 'value' is missing in type A' but present in type 'B'. a = b = new A(); ~ !!! error TS2322: Type 'A' is not assignable to type 'B'. diff --git a/tests/baselines/reference/chainedAssignmentChecking.errors.txt b/tests/baselines/reference/chainedAssignmentChecking.errors.txt index ac3bade0aaeb9..0bb93671f7912 100644 --- a/tests/baselines/reference/chainedAssignmentChecking.errors.txt +++ b/tests/baselines/reference/chainedAssignmentChecking.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/chainedAssignmentChecking.ts(21,1): error TS2322: Type 'Z' is not assignable to type 'X'. - Property 'a' is missing in type 'Z'. + Property 'a' is missing in type Z' but present in type 'X'. tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' is not assignable to type 'Y'. - Property 'a' is missing in type 'Z'. + Type 'Z' is missing the following properties from type 'Y': a, b ==== tests/cases/compiler/chainedAssignmentChecking.ts (2 errors) ==== @@ -28,8 +28,8 @@ tests/cases/compiler/chainedAssignmentChecking.ts(21,6): error TS2322: Type 'Z' c1 = c2 = c3; // Should be error ~~ !!! error TS2322: Type 'Z' is not assignable to type 'X'. -!!! error TS2322: Property 'a' is missing in type 'Z'. +!!! error TS2322: Property 'a' is missing in type Z' but present in type 'X'. ~~ !!! error TS2322: Type 'Z' is not assignable to type 'Y'. -!!! error TS2322: Property 'a' is missing in type 'Z'. +!!! error TS2322: Type 'Z' is missing the following properties from type 'Y': a, b \ No newline at end of file diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt index cee9236d630ca..262bdb438d72a 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts(19,64): error TS2322: Type 'B' is not assignable to type 'C'. - Property 'z' is missing in type 'B'. + Property 'z' is missing in type B' but present in type 'C'. ==== tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts (1 errors) ==== @@ -24,5 +24,5 @@ tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParamete (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); ~~~~~ !!! error TS2322: Type 'B' is not assignable to type 'C'. -!!! error TS2322: Property 'z' is missing in type 'B'. +!!! error TS2322: Property 'z' is missing in type B' but present in type 'C'. !!! related TS6502 tests/cases/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.ts:3:27: The expected type comes from the return type of this signature. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocTypeTag6.errors.txt b/tests/baselines/reference/checkJsdocTypeTag6.errors.txt index cc86b6115aff0..4b4f3f037b10c 100644 --- a/tests/baselines/reference/checkJsdocTypeTag6.errors.txt +++ b/tests/baselines/reference/checkJsdocTypeTag6.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/jsdoc/test.js(1,5): error TS8030: The type of a function declaration must match the function's signature. tests/cases/conformance/jsdoc/test.js(7,5): error TS2322: Type '(prop: any) => void' is not assignable to type '{ prop: string; }'. - Property 'prop' is missing in type '(prop: any) => void'. + Property 'prop' is missing in type (prop: any) => void' but present in type '{ prop: string; }'. tests/cases/conformance/jsdoc/test.js(10,5): error TS8030: The type of a function declaration must match the function's signature. @@ -16,7 +16,7 @@ tests/cases/conformance/jsdoc/test.js(10,5): error TS8030: The type of a functio var g = function (prop) { ~ !!! error TS2322: Type '(prop: any) => void' is not assignable to type '{ prop: string; }'. -!!! error TS2322: Property 'prop' is missing in type '(prop: any) => void'. +!!! error TS2322: Property 'prop' is missing in type (prop: any) => void' but present in type '{ prop: string; }'. } /** @type {(a: number) => number} */ diff --git a/tests/baselines/reference/checkJsxChildrenProperty14.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty14.errors.txt index 6878372be8b4c..b730f2d6d0b2e 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty14.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty14.errors.txt @@ -2,7 +2,7 @@ tests/cases/conformance/jsx/file.tsx(42,11): error TS2322: Type '{ children: Ele Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'SingleChildProp'. Types of property 'children' are incompatible. Type 'Element[]' is not assignable to type 'Element'. - Property 'type' is missing in type 'Element[]'. + Type 'Element[]' is missing the following properties from type 'Element': type, props ==== tests/cases/conformance/jsx/file.tsx (1 errors) ==== @@ -53,4 +53,4 @@ tests/cases/conformance/jsx/file.tsx(42,11): error TS2322: Type '{ children: Ele !!! error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'SingleChildProp'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type 'Element[]' is not assignable to type 'Element'. -!!! error TS2322: Property 'type' is missing in type 'Element[]'. \ No newline at end of file +!!! error TS2322: Type 'Element[]' is missing the following properties from type 'Element': type, props \ No newline at end of file diff --git a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt index 5ecc37c6045de..81606fe1b4d6b 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty2.errors.txt @@ -1,31 +1,31 @@ tests/cases/conformance/jsx/file.tsx(14,10): error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. Type '{ a: number; b: string; }' is not assignable to type 'Prop'. - Property 'children' is missing in type '{ a: number; b: string; }'. + Property 'children' is missing in type { a: number; b: string; }' but present in type 'Prop'. tests/cases/conformance/jsx/file.tsx(17,11): error TS2710: 'children' are specified twice. The attribute named 'children' will be overwritten. tests/cases/conformance/jsx/file.tsx(31,6): error TS2322: Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. Type '{ children: (Element | ((name: string) => Element))[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. Type '(Element | ((name: string) => Element))[]' is not assignable to type 'Element'. - Property 'type' is missing in type '(Element | ((name: string) => Element))[]'. + Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props tests/cases/conformance/jsx/file.tsx(37,6): error TS2322: Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. Type '{ children: (number | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(number | Element)[]' is not assignable to type 'string | Element'. Type '(number | Element)[]' is not assignable to type 'Element'. - Property 'type' is missing in type '(number | Element)[]'. + Type '(number | Element)[]' is missing the following properties from type 'Element': type, props tests/cases/conformance/jsx/file.tsx(43,6): error TS2322: Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. Type '{ children: (string | Element)[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type '(string | Element)[]' is not assignable to type 'string | Element'. Type '(string | Element)[]' is not assignable to type 'Element'. - Property 'type' is missing in type '(string | Element)[]'. + Type '(string | Element)[]' is missing the following properties from type 'Element': type, props tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. Type '{ children: Element[]; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type 'Element[]' is not assignable to type 'string | Element'. Type 'Element[]' is not assignable to type 'Element'. - Property 'type' is missing in type 'Element[]'. + Type 'Element[]' is missing the following properties from type 'Element': type, props ==== tests/cases/conformance/jsx/file.tsx (6 errors) ==== @@ -46,7 +46,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem ~~~~ !!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. !!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'Prop'. -!!! error TS2322: Property 'children' is missing in type '{ a: number; b: string; }'. +!!! error TS2322: Property 'children' is missing in type { a: number; b: string; }' but present in type 'Prop'. let k0 = @@ -72,7 +72,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'string | Element'. !!! error TS2322: Type '(Element | ((name: string) => Element))[]' is not assignable to type 'Element'. -!!! error TS2322: Property 'type' is missing in type '(Element | ((name: string) => Element))[]'. +!!! error TS2322: Type '(Element | ((name: string) => Element))[]' is missing the following properties from type 'Element': type, props
My Div
{(name: string) =>
My name {name}
}
; @@ -85,7 +85,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(number | Element)[]' is not assignable to type 'string | Element'. !!! error TS2322: Type '(number | Element)[]' is not assignable to type 'Element'. -!!! error TS2322: Property 'type' is missing in type '(number | Element)[]'. +!!! error TS2322: Type '(number | Element)[]' is missing the following properties from type 'Element': type, props
My Div
{1000000} ; @@ -98,7 +98,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type '(string | Element)[]' is not assignable to type 'string | Element'. !!! error TS2322: Type '(string | Element)[]' is not assignable to type 'Element'. -!!! error TS2322: Property 'type' is missing in type '(string | Element)[]'. +!!! error TS2322: Type '(string | Element)[]' is missing the following properties from type 'Element': type, props
My Div
hi hi hi! ; @@ -111,7 +111,7 @@ tests/cases/conformance/jsx/file.tsx(49,6): error TS2322: Type '{ children: Elem !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type 'Element[]' is not assignable to type 'string | Element'. !!! error TS2322: Type 'Element[]' is not assignable to type 'Element'. -!!! error TS2322: Property 'type' is missing in type 'Element[]'. +!!! error TS2322: Type 'Element[]' is missing the following properties from type 'Element': type, props
My Div
My Div
; \ No newline at end of file diff --git a/tests/baselines/reference/checkJsxChildrenProperty5.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty5.errors.txt index 14307fbb42c73..42c7eda8a4c29 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty5.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty5.errors.txt @@ -1,16 +1,16 @@ tests/cases/conformance/jsx/file.tsx(20,10): error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. Type '{ a: number; b: string; }' is not assignable to type 'Prop'. - Property 'children' is missing in type '{ a: number; b: string; }'. + Property 'children' is missing in type { a: number; b: string; }' but present in type 'Prop'. tests/cases/conformance/jsx/file.tsx(24,6): error TS2322: Type '{ children: Element; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. Type '{ children: Element; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type 'Element' is not assignable to type 'Button'. - Property 'render' is missing in type 'Element'. + Type 'Element' is missing the following properties from type 'Button': render, setState, forceUpdate, state, and 2 more. tests/cases/conformance/jsx/file.tsx(28,6): error TS2322: Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. Type '{ children: typeof Button; a: number; b: string; }' is not assignable to type 'Prop'. Types of property 'children' are incompatible. Type 'typeof Button' is not assignable to type 'Button'. - Property 'render' is missing in type 'typeof Button'. + Type 'typeof Button' is missing the following properties from type 'Button': render, setState, forceUpdate, props, and 3 more. ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -37,7 +37,7 @@ tests/cases/conformance/jsx/file.tsx(28,6): error TS2322: Type '{ children: type ~~~~ !!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'IntrinsicAttributes & Prop'. !!! error TS2322: Type '{ a: number; b: string; }' is not assignable to type 'Prop'. -!!! error TS2322: Property 'children' is missing in type '{ a: number; b: string; }'. +!!! error TS2322: Property 'children' is missing in type { a: number; b: string; }' but present in type 'Prop'. // Error: JSX.element is not the same as JSX.ElementClass let k1 = @@ -47,7 +47,7 @@ tests/cases/conformance/jsx/file.tsx(28,6): error TS2322: Type '{ children: type !!! error TS2322: Type '{ children: Element; a: number; b: string; }' is not assignable to type 'Prop'. !!! error TS2322: Types of property 'children' are incompatible. !!! error TS2322: Type 'Element' is not assignable to type 'Button'. -!!! error TS2322: Property 'render' is missing in type 'Element'. +!!! error TS2322: Type 'Element' is missing the following properties from type 'Button': render, setState, forceUpdate, state, and 2 more.