From 9b2a760339b41971b34822a5230259706496fedb Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Fri, 10 Nov 2017 15:49:51 -0800 Subject: [PATCH] Cherrypick non-comparability related changes from prolific literals PR --- src/compiler/checker.ts | 35 ++- ...ionAndExportedFunctionThatShareAName.types | 4 +- ...AndNonExportedFunctionThatShareAName.types | 4 +- ...VariableAndExportedVarThatShareAName.types | 4 +- ...iableAndNonExportedVarThatShareAName.types | 4 +- tests/baselines/reference/ES5For-of30.types | 2 +- .../reference/ES5For-ofTypeCheck3.types | 2 +- tests/baselines/reference/ES5for-of32.types | 4 +- ...assHeritageListMemberTypeAnnotations.types | 4 +- ...essibleTypeInTypeParameterConstraint.types | 4 +- ...esInParameterAndReturnTypeAnnotation.types | 2 +- ...ssibleTypesInParameterTypeAnnotation.types | 2 +- ...ccessibleTypesInReturnTypeAnnotation.types | 2 +- ...assHeritageListMemberTypeAnnotations.types | 4 +- ...essibleTypeInTypeParameterConstraint.types | 4 +- ...hAccessibleTypesOnItsExportedMembers.types | 2 +- ...cessibleTypesInMemberTypeAnnotations.types | 2 +- ...leWithAccessibleTypeInTypeAnnotation.types | 2 +- ...WithInaccessibleTypeInTypeAnnotation.types | 4 +- ...ithExportedAndNonExportedImportAlias.types | 4 +- ...AndNonExportedLocalVarsOfTheSameName.types | 4 +- ...chWithExportedLocalVarsOfTheSameName.types | 2 +- ...ithTheSameNameAndDifferentCommonRoot.types | 2 +- ...ulesWithTheSameNameAndSameCommonRoot.types | 4 +- .../accessorsAreNotContextuallyTyped.types | 2 +- .../allowImportClausesToMergeWithTypes.types | 4 +- .../argumentExpressionContextualTyping.types | 14 +- .../reference/arrayBestCommonTypes.types | 20 +- tests/baselines/reference/arrayLiteral.types | 4 +- ...teralExpressionContextualTyping.errors.txt | 12 +- ...rayLiteralExpressionContextualTyping.types | 6 +- .../arrayLiteralTypeInference.errors.txt | 24 +- .../reference/arrayLiteralTypeInference.types | 12 +- .../reference/arrayLiterals.errors.txt | 12 +- tests/baselines/reference/arrayLiterals.types | 6 +- .../reference/arrayLiterals2ES5.types | 12 +- .../reference/arrayLiterals2ES6.types | 12 +- .../reference/arrayLiterals3.errors.txt | 12 +- .../baselines/reference/arrayLiterals3.types | 10 +- .../reference/arrowFunctionExpressions.types | 6 +- .../arrowFunctionWithObjectLiteralBody5.types | 8 +- .../arrowFunctionWithObjectLiteralBody6.types | 8 +- tests/baselines/reference/assign1.types | 2 +- .../reference/assignmentCompatBug2.errors.txt | 28 +- .../reference/assignmentCompatBug2.types | 60 ++--- ...CompatFunctionsWithOptionalArgs.errors.txt | 12 +- ...nmentCompatFunctionsWithOptionalArgs.types | 4 +- ...CallSignaturesWithOptionalParameters.types | 64 ++--- ...allSignaturesWithRestParameters.errors.txt | 36 +-- ...WithCallSignaturesWithRestParameters.types | 112 ++++---- .../assignmentCompatWithObjectMembers3.types | 4 +- .../reference/assignmentCompatability1.types | 2 +- .../reference/assignmentCompatability10.types | 2 +- .../reference/assignmentCompatability11.types | 2 +- .../reference/assignmentCompatability12.types | 2 +- .../reference/assignmentCompatability13.types | 2 +- .../reference/assignmentCompatability14.types | 2 +- .../reference/assignmentCompatability15.types | 2 +- .../reference/assignmentCompatability16.types | 2 +- .../reference/assignmentCompatability17.types | 2 +- .../reference/assignmentCompatability18.types | 2 +- .../reference/assignmentCompatability19.types | 2 +- .../reference/assignmentCompatability2.types | 2 +- .../reference/assignmentCompatability20.types | 2 +- .../reference/assignmentCompatability21.types | 2 +- .../reference/assignmentCompatability22.types | 2 +- .../reference/assignmentCompatability23.types | 2 +- .../reference/assignmentCompatability24.types | 2 +- .../reference/assignmentCompatability25.types | 2 +- .../reference/assignmentCompatability26.types | 2 +- .../reference/assignmentCompatability27.types | 2 +- .../reference/assignmentCompatability28.types | 2 +- .../reference/assignmentCompatability29.types | 2 +- .../reference/assignmentCompatability3.types | 2 +- .../reference/assignmentCompatability30.types | 2 +- .../reference/assignmentCompatability31.types | 2 +- .../reference/assignmentCompatability32.types | 2 +- .../reference/assignmentCompatability33.types | 2 +- .../reference/assignmentCompatability34.types | 2 +- .../reference/assignmentCompatability35.types | 2 +- .../reference/assignmentCompatability36.types | 2 +- .../reference/assignmentCompatability37.types | 2 +- .../reference/assignmentCompatability38.types | 2 +- .../reference/assignmentCompatability39.types | 2 +- .../reference/assignmentCompatability4.types | 2 +- .../reference/assignmentCompatability40.types | 2 +- .../reference/assignmentCompatability41.types | 2 +- .../reference/assignmentCompatability42.types | 2 +- .../reference/assignmentCompatability43.types | 4 +- .../reference/assignmentCompatability5.types | 4 +- .../reference/assignmentCompatability6.types | 2 +- .../reference/assignmentCompatability7.types | 4 +- .../reference/assignmentCompatability8.types | 2 +- .../reference/assignmentCompatability9.types | 2 +- .../assignmentToObjectAndFunction.types | 4 +- ...assignmentToParenthesizedIdentifiers.types | 12 +- .../reference/asyncFunctionReturnType.types | 2 +- .../reference/bestCommonTypeOfTuple.types | 8 +- .../bitwiseNotOperatorWithNumberType.types | 2 +- .../bitwiseNotOperatorWithStringType.types | 2 +- tests/baselines/reference/castTest.types | 4 +- tests/baselines/reference/castingTuple.types | 8 +- .../checkJsdocTypedefInParamTag1.types | 6 +- .../computedPropertiesInDestructuring1.types | 6 +- ...mputedPropertiesInDestructuring1_ES6.types | 6 +- .../computedPropertyNames48_ES5.types | 6 +- .../computedPropertyNames48_ES6.types | 6 +- ...opertyNamesContextualType10_ES5.errors.txt | 12 +- ...tedPropertyNamesContextualType10_ES5.types | 2 +- ...opertyNamesContextualType10_ES6.errors.txt | 12 +- ...tedPropertyNamesContextualType10_ES6.types | 2 +- ...utedPropertyNamesContextualType6_ES5.types | 4 +- ...utedPropertyNamesContextualType6_ES6.types | 4 +- ...utedPropertyNamesContextualType7_ES5.types | 6 +- ...utedPropertyNamesContextualType7_ES6.types | 6 +- ...ropertyNamesContextualType8_ES5.errors.txt | 12 +- ...utedPropertyNamesContextualType8_ES5.types | 2 +- ...ropertyNamesContextualType8_ES6.errors.txt | 12 +- ...utedPropertyNamesContextualType8_ES6.types | 2 +- ...ropertyNamesContextualType9_ES5.errors.txt | 12 +- ...utedPropertyNamesContextualType9_ES5.types | 2 +- ...ropertyNamesContextualType9_ES6.errors.txt | 12 +- ...utedPropertyNamesContextualType9_ES6.types | 2 +- tests/baselines/reference/concatError.types | 2 +- tests/baselines/reference/concatTuples.types | 10 +- ...ructorWithAssignableReturnExpression.types | 2 +- ...structorWithIncompleteTypeAnnotation.types | 2 +- .../reference/contextualTypeFromJSDoc.types | 30 +-- .../reference/contextualTypeLogicalOr.types | 48 ++-- .../contextualTypeShouldBeLiteral.js | 136 ++++++++++ .../contextualTypeShouldBeLiteral.symbols | 229 ++++++++++++++++ .../contextualTypeShouldBeLiteral.types | 248 ++++++++++++++++++ .../contextualTypeWithTuple.errors.txt | 16 +- .../reference/contextualTypeWithTuple.types | 28 +- ...tualTypeWithUnionTypeIndexSignatures.types | 4 +- .../contextualTypeWithUnionTypeMembers.types | 22 +- .../reference/contextualTyping.types | 20 +- .../reference/contextualTyping1.types | 2 +- .../reference/contextualTyping10.types | 6 +- .../reference/contextualTyping12.errors.txt | 12 +- .../reference/contextualTyping12.types | 6 +- .../reference/contextualTyping16.types | 6 +- .../reference/contextualTyping17.errors.txt | 4 +- .../reference/contextualTyping17.types | 6 +- .../reference/contextualTyping18.types | 4 +- .../reference/contextualTyping19.types | 12 +- .../reference/contextualTyping2.errors.txt | 4 +- .../reference/contextualTyping2.types | 2 +- .../reference/contextualTyping20.errors.txt | 12 +- .../reference/contextualTyping20.types | 12 +- .../reference/contextualTyping21.errors.txt | 8 +- .../reference/contextualTyping21.types | 10 +- .../reference/contextualTyping23.types | 4 +- .../reference/contextualTyping24.errors.txt | 4 +- .../reference/contextualTyping24.types | 4 +- .../reference/contextualTyping28.types | 2 +- .../reference/contextualTyping29.types | 2 +- .../reference/contextualTyping3.types | 2 +- .../reference/contextualTyping30.errors.txt | 8 +- .../reference/contextualTyping31.types | 2 +- .../reference/contextualTyping34.types | 4 +- .../reference/contextualTyping35.types | 2 +- .../reference/contextualTyping36.types | 2 +- .../reference/contextualTyping4.errors.txt | 4 +- .../reference/contextualTyping4.types | 2 +- .../reference/contextualTyping6.types | 6 +- .../reference/contextualTyping9.errors.txt | 12 +- .../reference/contextualTyping9.types | 6 +- .../contextualTypingOfOptionalMembers.types | 6 +- .../contextuallyTypedBindingInitializer.types | 2 +- ...uallyTypedBindingInitializerNegative.types | 6 +- .../reference/contextuallyTypedIife.types | 14 +- .../contextuallyTypedIifeStrict.types | 14 +- .../contextuallyTypingOrOperator.types | 6 +- .../contextuallyTypingOrOperator2.types | 6 +- .../reference/controlFlowDeleteOperator.types | 2 +- .../controlFlowDestructuringDeclaration.types | 18 +- .../declarationEmitDestructuring2.js | 4 +- .../declarationEmitDestructuring2.types | 8 +- ...rationEmitDestructuringArrayPattern2.types | 8 +- .../declarationsAndAssignments.errors.txt | 12 +- .../declarationsAndAssignments.types | 50 ++-- .../decrementOperatorWithNumberType.types | 2 +- ...ratorWithNumberTypeInvalidOperations.types | 2 +- ...entOperatorWithUnsupportedStringType.types | 2 +- .../deleteOperatorWithNumberType.types | 2 +- .../deleteOperatorWithStringType.types | 2 +- .../baselines/reference/deleteReadonly.types | 2 +- ...lassConstructorWithExplicitReturns01.types | 8 +- ...nBaseCallViaSuperPropertyAccess.errors.txt | 4 +- ...HiddenBaseCallViaSuperPropertyAccess.types | 4 +- .../destructureOptionalParameter.types | 2 +- ...ArrayBindingPatternAndAssignment1ES5.types | 6 +- ...dingPatternAndAssignment1ES5iterable.types | 6 +- ...ArrayBindingPatternAndAssignment1ES6.types | 6 +- ...rayBindingPatternAndAssignment2.errors.txt | 8 +- ...ingArrayBindingPatternAndAssignment2.types | 6 +- ...ingArrayBindingPatternAndAssignment3.types | 6 +- ...bjectBindingPatternAndAssignment1ES5.types | 8 +- ...bjectBindingPatternAndAssignment1ES6.types | 8 +- ...cturingParameterDeclaration1ES5.errors.txt | 4 +- ...estructuringParameterDeclaration1ES5.types | 18 +- ...arameterDeclaration1ES5iterable.errors.txt | 4 +- ...ringParameterDeclaration1ES5iterable.types | 18 +- ...cturingParameterDeclaration1ES6.errors.txt | 4 +- ...estructuringParameterDeclaration1ES6.types | 18 +- ...tructuringParameterDeclaration2.errors.txt | 8 +- .../destructuringParameterDeclaration2.types | 2 +- ...estructuringParameterDeclaration3ES5.types | 2 +- ...ringParameterDeclaration3ES5iterable.types | 2 +- ...estructuringParameterDeclaration3ES6.types | 2 +- ...tructuringParameterDeclaration4.errors.txt | 8 +- .../destructuringParameterProperties1.types | 8 +- ...structuringParameterProperties2.errors.txt | 8 +- .../destructuringParameterProperties2.types | 4 +- .../destructuringParameterProperties3.types | 6 +- .../destructuringTypeGuardFlow.types | 6 +- ...destructuringVariableDeclaration1ES5.types | 40 +-- ...uringVariableDeclaration1ES5iterable.types | 40 +-- ...destructuringVariableDeclaration1ES6.types | 40 +-- ...structuringVariableDeclaration2.errors.txt | 4 +- .../destructuringVariableDeclaration2.types | 14 +- ...destructuringWithLiteralInitializers.types | 46 ++-- ...denAtObjectLiteralPropertyAssignment.types | 8 +- .../doubleUnderscoreMappedTypes.types | 4 +- ...tLiteralExpressionInArrowFunctionES5.types | 4 +- ...tLiteralExpressionInArrowFunctionES6.types | 4 +- .../reference/emitArrowFunctionES6.types | 6 +- ...itCapturingThisInTupleDestructuring2.types | 2 +- .../errorMessagesIntersectionTypes01.types | 2 +- .../errorMessagesIntersectionTypes02.types | 2 +- .../reference/escapedIdentifiers.types | 8 +- ...veryTypeWithAnnotationAndInitializer.types | 6 +- .../excessPropertyCheckWithUnions.errors.txt | 16 +- .../excessPropertyCheckWithUnions.types | 28 +- ...ssPropertyErrorForFunctionTypes.errors.txt | 4 +- .../excessPropertyErrorForFunctionTypes.types | 2 +- .../excessPropertyErrorsSuppressed.types | 2 +- ...portAssignmentConstrainedGenericType.types | 16 +- .../exportImportNonInstantiatedModule.types | 2 +- .../exportImportNonInstantiatedModule2.types | 2 +- .../reference/exportNonVisibleType.types | 2 +- ...backToBindingPatternForTypeInference.types | 6 +- tests/baselines/reference/for-of36.types | 2 +- tests/baselines/reference/for-of37.types | 4 +- tests/baselines/reference/for-of38.types | 4 +- tests/baselines/reference/for-of39.errors.txt | 32 +-- tests/baselines/reference/for-of40.types | 4 +- tests/baselines/reference/for-of43.types | 2 +- tests/baselines/reference/for-of44.types | 8 +- tests/baselines/reference/for-of45.types | 4 +- tests/baselines/reference/for-of46.types | 4 +- tests/baselines/reference/for-of49.types | 4 +- tests/baselines/reference/for-of50.types | 4 +- tests/baselines/reference/forStatements.types | 6 +- .../forStatementsMultipleValidDecl.types | 6 +- .../reference/functionAssignment.types | 2 +- .../reference/functionAssignmentError.types | 4 +- .../functionExpressionContextualTyping1.types | 12 +- .../reference/functionOverloads17.types | 2 +- .../reference/functionOverloads35.types | 2 +- .../reference/functionOverloads36.types | 2 +- .../reference/functionOverloads38.types | 4 +- .../reference/functionOverloads40.errors.txt | 12 +- .../reference/functionOverloads43.types | 8 +- .../reference/functionOverloads44.types | 16 +- .../reference/functionOverloads45.types | 16 +- tests/baselines/reference/fuzzy.errors.txt | 4 +- tests/baselines/reference/fuzzy.types | 6 +- .../genericCallWithArrayLiteralArgs.types | 6 +- ...enericCallWithFunctionTypedArguments.types | 6 +- ...enericCallWithObjectLiteralArgs.errors.txt | 4 +- .../genericCallWithObjectLiteralArgs.types | 2 +- ...CallWithObjectLiteralArguments1.errors.txt | 20 +- ...allWithObjectTypeArgsAndConstraints4.types | 2 +- .../genericCallWithTupleType.errors.txt | 4 +- .../reference/genericCallWithTupleType.types | 8 +- ...lassWithFunctionTypedMemberArguments.types | 12 +- ...enericFunctionTypedArgumentsAreFixed.types | 2 +- .../reference/genericTypeAliases.types | 38 +-- .../heterogeneousArrayAndOverloads.errors.txt | 8 +- .../heterogeneousArrayAndOverloads.types | 4 +- ...yFunctionInvocationWithAnyArguements.types | 2 +- .../reference/implicitIndexSignatures.types | 4 +- .../reference/importAliasIdentifiers.types | 4 +- .../incrementOperatorWithNumberType.types | 2 +- ...ratorWithNumberTypeInvalidOperations.types | 2 +- ...entOperatorWithUnsupportedStringType.types | 2 +- .../indexSignaturesInferentialTyping.types | 6 +- tests/baselines/reference/indexer.types | 6 +- tests/baselines/reference/indexerA.types | 6 +- .../reference/indexerWithTuple.types | 10 +- .../indirectTypeParameterReferences.types | 2 +- ...inferentialTypingWithFunctionTypeZip.types | 2 +- ...ialTypingWithObjectLiteralProperties.types | 12 +- tests/baselines/reference/inheritance.types | 2 +- ...nstanceMemberAssignsToClassPrototype.types | 4 +- .../reference/instantiatedModule.types | 2 +- tests/baselines/reference/interface0.types | 2 +- .../reference/interfaceAssignmentCompat.types | 12 +- .../interfaceDoesNotDependOnBaseTypes.types | 2 +- .../reference/interfaceImplementation6.types | 2 +- .../interfaceWithPropertyOfEveryType.types | 10 +- .../reference/intersectionThisTypes.types | 4 +- .../reference/intersectionTypeInference.types | 6 +- .../intersectionTypeInference1.types | 2 +- .../reference/intersectionTypeMembers.types | 18 +- .../invalidReturnStatements.errors.txt | 8 +- .../reference/invalidReturnStatements.types | 2 +- .../isomorphicMappedTypeInference.types | 4 +- .../reference/iterableArrayPattern23.types | 4 +- .../reference/iterableArrayPattern25.types | 6 +- .../reference/iterableArrayPattern26.types | 6 +- .../reference/iterableArrayPattern27.types | 6 +- .../iterableArrayPattern28.errors.txt | 28 +- .../reference/iterableArrayPattern29.types | 6 +- .../reference/iterableArrayPattern30.types | 6 +- .../iteratorSpreadInArray5.errors.txt | 8 +- .../reference/iteratorSpreadInArray5.types | 2 +- .../reference/iteratorSpreadInArray6.types | 2 +- .../jsdocDisallowedInTypescript.types | 2 +- .../reference/jsdocParamTagTypeLiteral.types | 26 +- .../baselines/reference/json.stringify.types | 2 +- .../reference/keyofAndIndexedAccess.types | 60 ++--- .../keyofIsLiteralContexualType.types | 2 +- .../reference/lambdaParamTypes.types | 6 +- tests/baselines/reference/literalTypes2.types | 4 +- .../literalTypesAndTypeAssertions.types | 4 +- .../logicalNotOperatorWithNumberType.types | 2 +- .../logicalNotOperatorWithStringType.types | 2 +- ...OrExpressionIsContextuallyTyped.errors.txt | 8 +- ...gicalOrExpressionIsContextuallyTyped.types | 6 +- .../logicalOrOperatorWithTypeParameters.types | 6 +- .../reference/looseThisTypeInFunctions.types | 2 +- .../reference/mapOnTupleTypes01.types | 16 +- .../reference/mappedTypeErrors.errors.txt | 16 +- .../reference/mappedTypeErrors.types | 30 +-- .../mappedTypeInferenceErrors.errors.txt | 8 +- ...mappedTypeNestedGenericInstantiation.types | 2 +- tests/baselines/reference/mappedTypes2.types | 4 +- .../matchingOfObjectLiteralConstraints.types | 2 +- ...citTypeParameterAndArgumentType.errors.txt | 8 +- ...ExplicitTypeParameterAndArgumentType.types | 2 +- .../missingAndExcessProperties.types | 18 +- .../reference/multipleInheritance.types | 2 +- .../reference/multipleNumericIndexers.types | 2 +- .../reference/multipleStringIndexers.types | 2 +- .../negateOperatorWithNumberType.types | 2 +- .../negateOperatorWithStringType.types | 2 +- tests/baselines/reference/nestedLoops.types | 4 +- tests/baselines/reference/nestedModules.types | 2 +- .../nestedTypeVariableInfersLiteral.js | 31 +++ .../nestedTypeVariableInfersLiteral.symbols | 78 ++++++ .../nestedTypeVariableInfersLiteral.types | 100 +++++++ .../baselines/reference/neverInference.types | 4 +- tests/baselines/reference/neverType.types | 2 +- .../reference/noCrashOnImportShadowing.types | 4 +- ...licitAnyDestructuringVarDeclaration2.types | 4 +- .../noImplicitAnyInCastExpression.types | 2 +- .../reference/noImplicitAnyIndexing.types | 2 +- .../noImplicitAnyIndexingSuppressed.types | 2 +- .../reference/nonInstantiatedModule.types | 2 +- tests/baselines/reference/null.types | 2 +- ...rConstrainsPropertyDeclarations.errors.txt | 4 +- ...ndexerConstrainsPropertyDeclarations.types | 2 +- .../reference/numericIndexingResults.types | 4 +- tests/baselines/reference/objectFreeze.types | 4 +- .../objectLitTargetTypeCallSite.errors.txt | 4 +- .../objectLiteralArraySpecialization.types | 6 +- .../objectLiteralContextualTyping.types | 4 +- .../objectLiteralEnumPropertyNames.types | 10 +- .../objectLiteralExcessProperties.errors.txt | 28 +- .../objectLiteralExcessProperties.types | 12 +- ...eralFunctionArgContextualTyping.errors.txt | 4 +- ...ctLiteralFunctionArgContextualTyping.types | 4 +- ...ralFunctionArgContextualTyping2.errors.txt | 16 +- .../objectLiteralNormalization.errors.txt | 48 ++-- .../objectLiteralNormalization.types | 40 +-- .../objectLiteralParameterResolution.types | 6 +- tests/baselines/reference/objectRest.types | 6 +- .../baselines/reference/objectRestForOf.types | 4 +- .../reference/objectRestParameter.types | 2 +- .../reference/objectRestParameterES5.types | 2 +- tests/baselines/reference/objectSpread.types | 40 +-- .../reference/objectSpreadNegative.errors.txt | 12 +- .../reference/objectSpreadNegative.types | 24 +- ...ectTypesIdentityWithNumericIndexers1.types | 2 +- ...ectTypesIdentityWithNumericIndexers3.types | 2 +- ...bjectTypesIdentityWithStringIndexers.types | 2 +- .../optionalBindingParameters1.errors.txt | 4 +- .../optionalBindingParameters1.types | 2 +- .../optionalBindingParameters2.errors.txt | 4 +- .../optionalBindingParameters2.types | 2 +- ...alBindingParametersInOverloads1.errors.txt | 4 +- ...ptionalBindingParametersInOverloads1.types | 2 +- ...alBindingParametersInOverloads2.errors.txt | 4 +- ...ptionalBindingParametersInOverloads2.types | 2 +- .../reference/optionalParamArgsTest.types | 8 +- .../reference/optionalProperties01.types | 4 +- .../optionalPropertiesTest.errors.txt | 8 +- .../reference/optionalPropertiesTest.types | 20 +- ...attersForSignatureGroupIdentity.errors.txt | 8 +- .../overloadOnConstAsTypeAnnotation.types | 2 +- .../overloadOnConstNoAnyImplementation.types | 6 +- ...loadOnConstNoAnyImplementation2.errors.txt | 8 +- .../overloadOnConstNoAnyImplementation2.types | 8 +- ...verloadOnConstNoStringImplementation.types | 6 +- ...dOnConstNoStringImplementation2.errors.txt | 8 +- ...erloadOnConstNoStringImplementation2.types | 8 +- ...overloadResolutionOverNonCTObjectLit.types | 6 +- .../overloadResolutionTest1.errors.txt | 20 +- .../reference/overloadResolutionTest1.types | 6 +- ...lbacksWithDifferingOptionalityOnArgs.types | 4 +- .../overloadsWithProvisionalErrors.types | 6 +- .../overrideBaseIntersectionMethod.types | 2 +- .../plusOperatorWithNumberType.types | 2 +- .../plusOperatorWithStringType.types | 2 +- .../reference/promiseVoidErrorCallback.types | 2 +- .../reference/propertyAccess.errors.txt | 4 +- .../baselines/reference/propertyAccess.types | 2 +- .../baselines/reference/readonlyMembers.types | 4 +- .../reference/restArgAssignmentCompat.types | 2 +- .../reference/restElementMustBeLast.types | 4 +- ...stElementWithAssignmentPattern1.errors.txt | 16 +- .../restElementWithAssignmentPattern1.types | 4 +- .../restElementWithAssignmentPattern3.types | 2 +- .../restElementWithAssignmentPattern4.types | 2 +- .../restElementWithAssignmentPattern5.types | 4 +- .../reference/returnInConstructor1.types | 2 +- .../reference/returnStatements.types | 2 +- ...adowingViaLocalValueOrBindingElement.types | 4 +- ...ndPropertyAssignmentsInDestructuring.types | 42 +-- ...opertyAssignmentsInDestructuring_ES6.types | 42 +-- ...nDestructuringForArrayBindingPattern.types | 10 +- ...DestructuringForArrayBindingPattern2.types | 46 ++-- ...gForArrayBindingPatternDefaultValues.types | 40 +-- ...ForArrayBindingPatternDefaultValues2.types | 74 +++--- ...DestructuringForObjectBindingPattern.types | 24 +- ...estructuringForObjectBindingPattern2.types | 40 +-- ...ForObjectBindingPatternDefaultValues.types | 36 +-- ...orObjectBindingPatternDefaultValues2.types | 136 +++++----- ...estructuringForOfArrayBindingPattern.types | 12 +- ...structuringForOfArrayBindingPattern2.types | 12 +- ...orOfArrayBindingPatternDefaultValues.types | 24 +- ...rOfArrayBindingPatternDefaultValues2.types | 48 ++-- ...structuringForOfObjectBindingPattern.types | 20 +- ...tructuringForOfObjectBindingPattern2.types | 20 +- ...rOfObjectBindingPatternDefaultValues.types | 60 ++--- ...OfObjectBindingPatternDefaultValues2.types | 120 ++++----- ...gParameterNestedObjectBindingPattern.types | 24 +- ...tedObjectBindingPatternDefaultValues.types | 30 +-- ...cturingParameterObjectBindingPattern.types | 8 +- ...terObjectBindingPatternDefaultValues.types | 8 +- ...cturingParametertArrayBindingPattern.types | 10 +- ...turingParametertArrayBindingPattern2.types | 20 +- ...tertArrayBindingPatternDefaultValues.types | 18 +- ...ertArrayBindingPatternDefaultValues2.types | 26 +- ...dationDestructuringVariableStatement.types | 4 +- ...ationDestructuringVariableStatement1.types | 4 +- ...VariableStatementArrayBindingPattern.types | 4 +- ...ariableStatementArrayBindingPattern2.types | 8 +- ...ariableStatementArrayBindingPattern3.types | 50 ++-- ...ariableStatementArrayBindingPattern6.types | 2 +- ...ariableStatementArrayBindingPattern7.types | 2 +- ...mentArrayBindingPatternDefaultValues.types | 8 +- ...entArrayBindingPatternDefaultValues2.types | 20 +- ...entArrayBindingPatternDefaultValues3.types | 38 +-- ...turingVariableStatementDefaultValues.types | 6 +- ...eStatementNestedObjectBindingPattern.types | 12 +- ...bjectBindingPatternWithDefaultValues.types | 24 +- ...riableStatementObjectBindingPattern3.types | 2 +- ...riableStatementObjectBindingPattern4.types | 2 +- ...ializedSignatureAsCallbackParameter1.types | 4 +- tests/baselines/reference/spreadMethods.types | 2 +- .../reference/spreadTypeRemovesReadonly.types | 2 +- ...ymousTypeNotReferencingTypeParameter.types | 2 +- ...rAssignsToConstructorFunctionMembers.types | 4 +- ...rConstrainsPropertyDeclarations.errors.txt | 4 +- ...ndexerConstrainsPropertyDeclarations.types | 2 +- .../reference/stringIndexingResults.types | 2 +- .../stringLiteralTypesAsTags01.types | 2 +- .../stringLiteralTypesAsTags02.types | 2 +- .../stringLiteralTypesAsTags03.types | 2 +- tests/baselines/reference/structural1.types | 2 +- .../reference/subtypeRelationForNever.types | 2 +- .../reference/superPropertyAccess.types | 4 +- .../reference/symbolProperty21.errors.txt | 4 +- tests/baselines/reference/syntaxErrors.types | 2 +- ...TemplateStringsTypeArgumentInference.types | 10 +- ...plateStringsTypeArgumentInferenceES6.types | 10 +- .../reference/targetTypeCastTest.types | 2 +- .../reference/targetTypeObjectLiteral.types | 6 +- .../baselines/reference/targetTypeTest1.types | 8 +- .../reference/targetTypeTest3.errors.txt | 8 +- .../baselines/reference/targetTypeTest3.types | 2 +- .../thisTypeInAccessorsNegative.types | 2 +- .../reference/thisTypeInFunctions.types | 26 +- .../reference/thisTypeInFunctions2.types | 4 +- .../thisTypeInFunctionsNegative.errors.txt | 12 +- .../thisTypeInFunctionsNegative.types | 18 +- .../reference/thisTypeInObjectLiterals2.types | 36 +-- .../reference/thisTypeInTuples.types | 2 +- ...ommaInHeterogenousArrayLiteral1.errors.txt | 12 +- ...sxInferenceShouldNotYieldAnyOnUnions.types | 14 +- .../tsxSpreadAttributesResolution11.types | 6 +- .../tsxSpreadAttributesResolution12.types | 2 +- .../tsxSpreadAttributesResolution4.types | 2 +- ...xStatelessFunctionComponentOverload2.types | 4 +- ...FunctionComponentsWithTypeArguments1.types | 4 +- ...ionComponentsWithTypeArguments2.errors.txt | 8 +- ...FunctionComponentsWithTypeArguments2.types | 4 +- .../baselines/reference/tsxUnionSpread.types | 4 +- .../baselines/reference/tupleTypes.errors.txt | 12 +- tests/baselines/reference/tupleTypes.types | 20 +- tests/baselines/reference/typeAliases.types | 2 +- ...notationBestCommonTypeInArrayLiteral.types | 6 +- .../reference/typeArgInference2.types | 20 +- .../reference/typeArgInferenceWithNull.types | 6 +- .../typeArgumentInference.errors.txt | 4 +- .../reference/typeArgumentInference.types | 16 +- ...entInferenceConstructSignatures.errors.txt | 4 +- ...ArgumentInferenceConstructSignatures.types | 16 +- ...rgumentInferenceWithConstraints.errors.txt | 4 +- ...typeArgumentInferenceWithConstraints.types | 16 +- .../reference/typeGuardsAsAssertions.types | 2 +- .../reference/typeGuardsOnClassProperty.types | 2 +- .../typeInferenceFBoundedTypeParams.types | 4 +- .../typeInferenceWithExcessProperties.types | 16 +- .../typeInferenceWithTupleType.types | 4 +- .../baselines/reference/typeMatch2.errors.txt | 28 +- tests/baselines/reference/typeMatch2.types | 32 +-- ...peParameterAsTypeParameterConstraint.types | 10 +- ...sTypeParameterConstraintTransitively.types | 10 +- ...TypeParameterConstraintTransitively2.types | 8 +- tests/baselines/reference/typeVal.types | 2 +- .../baselines/reference/typeofInterface.types | 2 +- .../typeofOperatorWithNumberType.types | 2 +- .../typeofOperatorWithStringType.types | 2 +- .../types.asyncGenerators.esnext.1.types | 6 +- .../types.asyncGenerators.esnext.2.types | 2 +- .../baselines/reference/underscoreTest1.types | 84 +++--- .../unionTypeFromArrayLiteral.errors.txt | 4 +- .../reference/unionTypeFromArrayLiteral.types | 6 +- .../reference/unionTypeInference.types | 2 +- .../reference/unusedImportDeclaration.types | 2 +- .../reference/useBeforeDeclaration.types | 2 +- .../validMultipleVariableDeclarations.types | 6 +- tests/baselines/reference/vardecl.types | 4 +- ...aratorResolvedDuringContextualTyping.types | 2 +- .../voidOperatorWithNumberType.types | 2 +- .../voidOperatorWithStringType.types | 2 +- tests/baselines/reference/widenToAny1.types | 2 +- tests/baselines/reference/widenToAny2.types | 2 +- .../baselines/reference/withExportDecl.types | 4 +- .../baselines/reference/withImportDecl.types | 2 +- ...wrappedAndRecursiveConstraints3.errors.txt | 23 ++ .../wrappedAndRecursiveConstraints3.types | 22 +- ...wrappedAndRecursiveConstraints4.errors.txt | 8 +- .../wrappedAndRecursiveConstraints4.types | 18 +- .../compiler/contextualTypeShouldBeLiteral.ts | 96 +++++++ .../nestedTypeVariableInfersLiteral.ts | 18 ++ 561 files changed, 3474 insertions(+), 2504 deletions(-) create mode 100644 tests/baselines/reference/contextualTypeShouldBeLiteral.js create mode 100644 tests/baselines/reference/contextualTypeShouldBeLiteral.symbols create mode 100644 tests/baselines/reference/contextualTypeShouldBeLiteral.types create mode 100644 tests/baselines/reference/nestedTypeVariableInfersLiteral.js create mode 100644 tests/baselines/reference/nestedTypeVariableInfersLiteral.symbols create mode 100644 tests/baselines/reference/nestedTypeVariableInfersLiteral.types create mode 100644 tests/baselines/reference/wrappedAndRecursiveConstraints3.errors.txt create mode 100644 tests/cases/compiler/contextualTypeShouldBeLiteral.ts create mode 100644 tests/cases/compiler/nestedTypeVariableInfersLiteral.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6846807c3af4f..e0c4ee8ffae7c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4306,9 +4306,10 @@ namespace ts { if (strictNullChecks && declaration.initializer && !(getFalsyFlags(checkExpressionCached(declaration.initializer)) & TypeFlags.Undefined)) { type = getTypeWithFacts(type, TypeFacts.NEUndefined); } - return declaration.initializer ? + type = declaration.initializer ? getUnionType([type, checkExpressionCached(declaration.initializer)], /*subtypeReduction*/ true) : type; + return shouldUseLiteralType(declaration) ? type : getWidenedLiteralType(type); } function getTypeForDeclarationFromJSDocComment(declaration: Node) { @@ -10672,7 +10673,7 @@ namespace ts { } function getWidenedLiteralLikeTypeForContextualType(type: Type, contextualType: Type) { - if (!isLiteralLikeContextualType(contextualType)) { + if (!isLiteralLikeContextualType(type, contextualType)) { type = getWidenedUniqueESSymbolType(getWidenedLiteralType(type)); } return type; @@ -18856,24 +18857,30 @@ namespace ts { function checkDeclarationInitializer(declaration: VariableLikeDeclaration) { const type = getTypeOfExpression(declaration.initializer, /*cache*/ true); + return shouldUseLiteralType(declaration) ? type : getWidenedLiteralType(type); + } + + function shouldUseLiteralType(declaration: VariableLikeDeclaration) { return getCombinedNodeFlags(declaration) & NodeFlags.Const || - (getCombinedModifierFlags(declaration) & ModifierFlags.Readonly && !isParameterPropertyDeclaration(declaration)) || - isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type); + getCombinedModifierFlags(declaration) & ModifierFlags.Readonly && !isParameterPropertyDeclaration(declaration) || + (declaration.initializer && isTypeAssertion(declaration.initializer)); } - function isLiteralLikeContextualType(contextualType: Type) { + function isLiteralLikeContextualType(candidateLiteral: Type, contextualType: Type): boolean { if (contextualType) { + if (contextualType.flags & TypeFlags.UnionOrIntersection) { + return some((contextualType as UnionOrIntersectionType).types, t => isLiteralLikeContextualType(candidateLiteral, t)); + } if (contextualType.flags & TypeFlags.TypeVariable) { const constraint = getBaseConstraintOfType(contextualType) || emptyObjectType; - // If the type parameter is constrained to the base primitive type we're checking for, - // consider this a literal context. For example, given a type parameter 'T extends string', - // this causes us to infer string literal types for T. - if (constraint.flags & (TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Enum | TypeFlags.ESSymbol)) { - return true; - } - contextualType = constraint; - } - return maybeTypeOfKind(contextualType, (TypeFlags.Literal | TypeFlags.Index | TypeFlags.UniqueESSymbol)); + return isLiteralLikeContextualType(candidateLiteral, constraint); + } + // No need to `maybeTypeOfKind` on the contextual type, as it can't be a union, _however_, `candidateLiteral` might still be one! + return !!(((contextualType.flags & TypeFlags.StringLike) && maybeTypeOfKind(candidateLiteral, TypeFlags.StringLike)) || + ((contextualType.flags & TypeFlags.NumberLike) && maybeTypeOfKind(candidateLiteral, TypeFlags.NumberLike)) || + ((contextualType.flags & TypeFlags.BooleanLike) && maybeTypeOfKind(candidateLiteral, TypeFlags.BooleanLike)) || + ((contextualType.flags & TypeFlags.ESSymbolLike) && maybeTypeOfKind(candidateLiteral, TypeFlags.ESSymbolLike)) + ); } return false; } diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types index f3bdde0e6a4d0..9cb56ae556d7a 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.types @@ -9,7 +9,7 @@ class Point { static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 >Origin : () => Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -38,7 +38,7 @@ module A { static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246 >Origin : () => Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types index b0685c4f858cf..df13a45e8376b 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types @@ -9,7 +9,7 @@ class Point { static Origin(): Point { return { x: 0, y: 0 }; } >Origin : () => Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -38,7 +38,7 @@ module A { static Origin(): Point { return { x: 0, y: 0 }; } >Origin : () => Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.types index 1c2423316dce8..72470c0731f12 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.types @@ -9,7 +9,7 @@ class Point { static Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -38,7 +38,7 @@ module A { static Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types index 7aa32879b7c79..cdbb8afbc1fa4 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.types @@ -9,7 +9,7 @@ class Point { static Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -38,7 +38,7 @@ module A { static Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ES5For-of30.types b/tests/baselines/reference/ES5For-of30.types index e55ead743ada8..02d59e5dab3b9 100644 --- a/tests/baselines/reference/ES5For-of30.types +++ b/tests/baselines/reference/ES5For-of30.types @@ -5,7 +5,7 @@ var a: string, b: number; var tuple: [number, string] = [2, "3"]; >tuple : [number, string] ->[2, "3"] : [number, string] +>[2, "3"] : [2, "3"] >2 : 2 >"3" : "3" diff --git a/tests/baselines/reference/ES5For-ofTypeCheck3.types b/tests/baselines/reference/ES5For-ofTypeCheck3.types index d46cdd0172d56..9509055e5d68c 100644 --- a/tests/baselines/reference/ES5For-ofTypeCheck3.types +++ b/tests/baselines/reference/ES5For-ofTypeCheck3.types @@ -1,7 +1,7 @@ === tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck3.ts === var tuple: [string, number] = ["", 0]; >tuple : [string, number] ->["", 0] : [string, number] +>["", 0] : ["", 0] >"" : "" >0 : 0 diff --git a/tests/baselines/reference/ES5for-of32.types b/tests/baselines/reference/ES5for-of32.types index 22e387d8484e4..d922b945c7391 100644 --- a/tests/baselines/reference/ES5for-of32.types +++ b/tests/baselines/reference/ES5for-of32.types @@ -20,9 +20,9 @@ for (let num of array) { >0 : 0 array = [4,5,6] ->array = [4,5,6] : number[] +>array = [4,5,6] : (4 | 5 | 6)[] >array : number[] ->[4,5,6] : number[] +>[4,5,6] : (4 | 5 | 6)[] >4 : 4 >5 : 5 >6 : 6 diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index e832f36e86234..cb32bdbb3a213 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -15,7 +15,7 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -32,7 +32,7 @@ module A { export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d >Point3d : Point3d ->{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } +>{ x: 0, y: 0, z: 0 } : { x: 0; y: 0; z: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types index 1a97175a833c4..dc291b6be53f5 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types @@ -15,7 +15,7 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -32,7 +32,7 @@ module A { export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d >Point3d : Point3d ->{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } +>{ x: 0, y: 0, z: 0 } : { x: 0; y: 0; z: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types index 957c9ce0207a2..cd824039feb22 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types @@ -31,7 +31,7 @@ module A { return new Line({ x: 0, y: 0 }, p); >new Line({ x: 0, y: 0 }, p) : Line >Line : typeof Line ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types index 079b39650d010..f31cccdf3e7ed 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types @@ -31,7 +31,7 @@ module A { return new Line({ x: 0, y: 0 }, p); >new Line({ x: 0, y: 0 }, p) : Line >Line : typeof Line ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types index 6fcbb786a68a6..a78a3e54cefdb 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types @@ -31,7 +31,7 @@ module A { return new Line({ x: 0, y: 0 }, p); >new Line({ x: 0, y: 0 }, p) : Line >Line : typeof Line ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types index c7c78424064d5..ddbe70119c062 100644 --- a/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportInterfaceWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.types @@ -15,7 +15,7 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -32,7 +32,7 @@ module A { export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d >Point3d : Point3d ->{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } +>{ x: 0, y: 0, z: 0 } : { x: 0; y: 0; z: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types index 8d07e4a44dd7f..c3b1d5b0c1e47 100644 --- a/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportInterfaceWithInaccessibleTypeInTypeParameterConstraint.types @@ -15,7 +15,7 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -32,7 +32,7 @@ module A { export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d >Point3d : Point3d ->{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } +>{ x: 0, y: 0, z: 0 } : { x: 0; y: 0; z: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types index a3ee7c55a4c16..e2caff571ca49 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types @@ -40,7 +40,7 @@ module A { return new Line({ x: 0, y: 0 }, p); >new Line({ x: 0, y: 0 }, p) : Line >Line : typeof Line ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types index 0ce1b82d67e12..ad292b3accf73 100644 --- a/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types +++ b/tests/baselines/reference/ExportObjectLiteralAndObjectTypeLiteralWithAccessibleTypesInMemberTypeAnnotations.types @@ -13,7 +13,7 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types index 91504be2c7024..32d2213d9bdec 100644 --- a/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithAccessibleTypeInTypeAnnotation.types @@ -16,7 +16,7 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types index 39bc5fa8af0ec..9cd0b08c8abb4 100644 --- a/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types +++ b/tests/baselines/reference/ExportVariableWithInaccessibleTypeInTypeAnnotation.types @@ -16,7 +16,7 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -34,7 +34,7 @@ module A { export var Origin3d: Point3d = { x: 0, y: 0, z: 0 }; >Origin3d : Point3d >Point3d : Point3d ->{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; } +>{ x: 0, y: 0, z: 0 } : { x: 0; y: 0; z: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types index 74e8d7f271f79..87e44d833a047 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedImportAlias.types @@ -52,7 +52,7 @@ module Geometry { >Origin : Points.Point >Points : any >Point : Points.Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -68,7 +68,7 @@ module Geometry { >Lines : typeof Lines >Line : typeof Lines.Line >Origin : Points.Point ->{ x: 1, y: 0 } : { x: number; y: number; } +>{ x: 1, y: 0 } : { x: 1; y: 0; } >x : number >1 : 1 >y : number diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types index 25a627030c43e..5d5771d06f815 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types @@ -37,7 +37,7 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -121,7 +121,7 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >Utils : typeof A.Utils >Plane : typeof A.Utils.Plane >o : { x: number; y: number; } ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ x: 1, y: 1 } : { x: 1; y: 1; } >x : number >1 : 1 >y : number diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.types index b9132a1d2cb26..0b3a0c067bc90 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.types @@ -38,7 +38,7 @@ export module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types index 2d654a580ea38..89f3441242679 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types @@ -53,7 +53,7 @@ module otherRoot { >Root : any >A : any >Point : Root.A.Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types index 11cb6e95d2814..0ae71b43fee00 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types @@ -43,7 +43,7 @@ module A { export var Origin: Point = { x: 0, y: 0 }; >Origin : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -117,7 +117,7 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 }); >Utils : typeof A.Utils >Plane : typeof A.Utils.Plane >o : { x: number; y: number; } ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ x: 1, y: 1 } : { x: 1; y: 1; } >x : number >1 : 1 >y : number diff --git a/tests/baselines/reference/accessorsAreNotContextuallyTyped.types b/tests/baselines/reference/accessorsAreNotContextuallyTyped.types index c48ad59372465..780f2ca4235da 100644 --- a/tests/baselines/reference/accessorsAreNotContextuallyTyped.types +++ b/tests/baselines/reference/accessorsAreNotContextuallyTyped.types @@ -14,7 +14,7 @@ class C { >x : (a: string) => string return (x: string) => ""; ->(x: string) => "" : (x: string) => string +>(x: string) => "" : (x: string) => "" >x : string >"" : "" } diff --git a/tests/baselines/reference/allowImportClausesToMergeWithTypes.types b/tests/baselines/reference/allowImportClausesToMergeWithTypes.types index 89d6a416ff302..87eff08e05d8f 100644 --- a/tests/baselines/reference/allowImportClausesToMergeWithTypes.types +++ b/tests/baselines/reference/allowImportClausesToMergeWithTypes.types @@ -20,7 +20,7 @@ import zzz from "./b"; const x: zzz = { x: "" }; >x : zzz >zzz : zzz ->{ x: "" } : { x: string; } +>{ x: "" } : { x: ""; } >x : string >"" : "" @@ -38,7 +38,7 @@ import zzz from "./a"; const x: zzz = { x: "" }; >x : zzz >zzz : zzz ->{ x: "" } : { x: string; } +>{ x: "" } : { x: ""; } >x : string >"" : "" diff --git a/tests/baselines/reference/argumentExpressionContextualTyping.types b/tests/baselines/reference/argumentExpressionContextualTyping.types index 3b0fec11aa2cf..7a8ea06f3ecce 100644 --- a/tests/baselines/reference/argumentExpressionContextualTyping.types +++ b/tests/baselines/reference/argumentExpressionContextualTyping.types @@ -51,13 +51,13 @@ var o1: { x: [string, number], y: { c: boolean, d: string, e: number } } = { x: >c : boolean >d : string >e : number ->{ x: ["string", 1], y: { c: true, d: "world", e: 3 } } : { x: [string, number]; y: { c: true; d: string; e: number; }; } ->x : [string, number] ->["string", 1] : [string, number] +>{ x: ["string", 1], y: { c: true, d: "world", e: 3 } } : { x: ["string", 1]; y: { c: true; d: "world"; e: 3; }; } +>x : ["string", 1] +>["string", 1] : ["string", 1] >"string" : "string" >1 : 1 ->y : { c: true; d: string; e: number; } ->{ c: true, d: "world", e: 3 } : { c: true; d: string; e: number; } +>y : { c: true; d: "world"; e: 3; } +>{ c: true, d: "world", e: 3 } : { c: true; d: "world"; e: 3; } >c : boolean >true : true >d : string @@ -96,7 +96,7 @@ var array = ["string", 1, true]; var tuple: [string, number, boolean] = ["string", 1, true]; >tuple : [string, number, boolean] ->["string", 1, true] : [string, number, true] +>["string", 1, true] : ["string", 1, true] >"string" : "string" >1 : 1 >true : true @@ -109,7 +109,7 @@ baz(tuple); baz(["string", 1, true]); >baz(["string", 1, true]) : void >baz : (x: [string, number, boolean]) => void ->["string", 1, true] : [string, number, true] +>["string", 1, true] : ["string", 1, true] >"string" : "string" >1 : 1 >true : true diff --git a/tests/baselines/reference/arrayBestCommonTypes.types b/tests/baselines/reference/arrayBestCommonTypes.types index 864b1adfacba6..3da98ef2846d4 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.types +++ b/tests/baselines/reference/arrayBestCommonTypes.types @@ -236,14 +236,14 @@ module EmptyTypes { >x : number >y : base >base : base ->[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: derived; }[] ->{ x: 7, y: new derived() } : { x: number; y: derived; } +>[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : ({ x: 7; y: derived; } | { x: 5; y: base; })[] +>{ x: 7, y: new derived() } : { x: 7; y: derived; } >x : number >7 : 7 >y : derived >new derived() : derived >derived : typeof derived ->{ x: 5, y: new base() } : { x: number; y: base; } +>{ x: 5, y: new base() } : { x: 5; y: base; } >x : number >5 : 5 >y : base @@ -274,14 +274,14 @@ module EmptyTypes { >x : string >y : base >base : base ->[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : { x: string; y: derived; }[] +>[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : { x: ""; y: derived; }[] >{ x: undefined, y: new base() } : { x: undefined; y: base; } >x : undefined >undefined : undefined >y : base >new base() : base >base : typeof base ->{ x: '', y: new derived() } : { x: string; y: derived; } +>{ x: '', y: new derived() } : { x: ""; y: derived; } >x : string >'' : "" >y : derived @@ -639,14 +639,14 @@ module NonEmptyTypes { >x : number >y : base >base : base ->[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : { x: number; y: base; }[] ->{ x: 7, y: new derived() } : { x: number; y: derived; } +>[{ x: 7, y: new derived() }, { x: 5, y: new base() }] : ({ x: 7; y: derived; } | { x: 5; y: base; })[] +>{ x: 7, y: new derived() } : { x: 7; y: derived; } >x : number >7 : 7 >y : derived >new derived() : derived >derived : typeof derived ->{ x: 5, y: new base() } : { x: number; y: base; } +>{ x: 5, y: new base() } : { x: 5; y: base; } >x : number >5 : 5 >y : base @@ -677,14 +677,14 @@ module NonEmptyTypes { >x : string >y : base >base : base ->[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : ({ x: undefined; y: base; } | { x: string; y: derived; })[] +>[{ x: undefined, y: new base() }, { x: '', y: new derived() }] : ({ x: undefined; y: base; } | { x: ""; y: derived; })[] >{ x: undefined, y: new base() } : { x: undefined; y: base; } >x : undefined >undefined : undefined >y : base >new base() : base >base : typeof base ->{ x: '', y: new derived() } : { x: string; y: derived; } +>{ x: '', y: new derived() } : { x: ""; y: derived; } >x : string >'' : "" >y : derived diff --git a/tests/baselines/reference/arrayLiteral.types b/tests/baselines/reference/arrayLiteral.types index c36cc93c68e38..9744fd320c459 100644 --- a/tests/baselines/reference/arrayLiteral.types +++ b/tests/baselines/reference/arrayLiteral.types @@ -39,12 +39,12 @@ var x2: number[] = new Array(1); var y2: number[] = [1]; >y2 : number[] ->[1] : number[] +>[1] : 1[] >1 : 1 var y2: number[] = [1, 2]; >y2 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt index 8cb36b113a754..a324163a5fa3a 100644 --- a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt +++ b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(6,5): error TS2322: Type '[number, number, number, number]' is not assignable to type '[number, number, number]'. +tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(6,5): error TS2322: Type '[1, 2, 3, 4]' is not assignable to type '[number, number, number]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '3'. -tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(7,5): error TS2322: Type '[number, number, number, string]' is not assignable to type '[string | number, string | number, string | number]'. +tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(7,5): error TS2322: Type '[1, 2, 3, "string"]' is not assignable to type '[string | number, string | number, string | number]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '3'. -tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(8,5): error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'. +tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(8,5): error TS2322: Type '[1, 2, 3, string]' is not assignable to type '[number, number, number]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '3'. tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(14,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'. @@ -19,17 +19,17 @@ tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionConte var array1 = [true, 2, 3]; // Contextual type by the numeric index type of the contextual type var tup: [number, number, number] = [1, 2, 3, 4]; ~~~ -!!! error TS2322: Type '[number, number, number, number]' is not assignable to type '[number, number, number]'. +!!! error TS2322: Type '[1, 2, 3, 4]' is not assignable to type '[number, number, number]'. !!! error TS2322: Types of property 'length' are incompatible. !!! error TS2322: Type '4' is not assignable to type '3'. var tup1: [number|string, number|string, number|string] = [1, 2, 3, "string"]; ~~~~ -!!! error TS2322: Type '[number, number, number, string]' is not assignable to type '[string | number, string | number, string | number]'. +!!! error TS2322: Type '[1, 2, 3, "string"]' is not assignable to type '[string | number, string | number, string | number]'. !!! error TS2322: Types of property 'length' are incompatible. !!! error TS2322: Type '4' is not assignable to type '3'. var tup2: [number, number, number] = [1, 2, 3, "string"]; // Error ~~~~ -!!! error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'. +!!! error TS2322: Type '[1, 2, 3, string]' is not assignable to type '[number, number, number]'. !!! error TS2322: Types of property 'length' are incompatible. !!! error TS2322: Type '4' is not assignable to type '3'. diff --git a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.types b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.types index 5954448c984fb..7b487c11e1509 100644 --- a/tests/baselines/reference/arrayLiteralExpressionContextualTyping.types +++ b/tests/baselines/reference/arrayLiteralExpressionContextualTyping.types @@ -18,7 +18,7 @@ var array1 = [true, 2, 3]; // Contextual type by the numeric index type of the var tup: [number, number, number] = [1, 2, 3, 4]; >tup : [number, number, number] ->[1, 2, 3, 4] : [number, number, number, number] +>[1, 2, 3, 4] : [1, 2, 3, 4] >1 : 1 >2 : 2 >3 : 3 @@ -26,7 +26,7 @@ var tup: [number, number, number] = [1, 2, 3, 4]; var tup1: [number|string, number|string, number|string] = [1, 2, 3, "string"]; >tup1 : [string | number, string | number, string | number] ->[1, 2, 3, "string"] : [number, number, number, string] +>[1, 2, 3, "string"] : [1, 2, 3, "string"] >1 : 1 >2 : 2 >3 : 3 @@ -34,7 +34,7 @@ var tup1: [number|string, number|string, number|string] = [1, 2, 3, "string"]; var tup2: [number, number, number] = [1, 2, 3, "string"]; // Error >tup2 : [number, number, number] ->[1, 2, 3, "string"] : [number, number, number, string] +>[1, 2, 3, "string"] : [1, 2, 3, string] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/arrayLiteralTypeInference.errors.txt b/tests/baselines/reference/arrayLiteralTypeInference.errors.txt index a2c4597127fbc..9c05da442386d 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.errors.txt +++ b/tests/baselines/reference/arrayLiteralTypeInference.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/arrayLiteralTypeInference.ts(14,14): error TS2322: Type '({ id: number; trueness: boolean; } | { id: number; name: string; })[]' is not assignable to type 'Action[]'. - Type '{ id: number; trueness: boolean; } | { id: number; name: string; }' is not assignable to type 'Action'. - Type '{ id: number; trueness: boolean; }' is not assignable to type 'Action'. +tests/cases/compiler/arrayLiteralTypeInference.ts(14,14): error TS2322: Type '({ id: 2; trueness: boolean; } | { id: 3; name: string; })[]' is not assignable to type 'Action[]'. + Type '{ id: 2; trueness: boolean; } | { id: 3; name: string; }' is not assignable to type 'Action'. + Type '{ id: 2; trueness: boolean; }' is not assignable to type 'Action'. Object literal may only specify known properties, and 'trueness' does not exist in type 'Action'. -tests/cases/compiler/arrayLiteralTypeInference.ts(31,18): error TS2322: Type '({ id: number; trueness: boolean; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'. - Type '{ id: number; trueness: boolean; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'. - Type '{ id: number; trueness: boolean; }' is not assignable to type '{ id: number; }'. +tests/cases/compiler/arrayLiteralTypeInference.ts(31,18): error TS2322: Type '({ id: 2; trueness: boolean; } | { id: 3; name: string; })[]' is not assignable to type '{ id: number; }[]'. + Type '{ id: 2; trueness: boolean; } | { id: 3; name: string; }' is not assignable to type '{ id: number; }'. + Type '{ id: 2; trueness: boolean; }' is not assignable to type '{ id: number; }'. Object literal may only specify known properties, and 'trueness' does not exist in type '{ id: number; }'. @@ -24,9 +24,9 @@ tests/cases/compiler/arrayLiteralTypeInference.ts(31,18): error TS2322: Type '({ var x1: Action[] = [ { id: 2, trueness: false }, ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '({ id: number; trueness: boolean; } | { id: number; name: string; })[]' is not assignable to type 'Action[]'. -!!! error TS2322: Type '{ id: number; trueness: boolean; } | { id: number; name: string; }' is not assignable to type 'Action'. -!!! error TS2322: Type '{ id: number; trueness: boolean; }' is not assignable to type 'Action'. +!!! error TS2322: Type '({ id: 2; trueness: boolean; } | { id: 3; name: string; })[]' is not assignable to type 'Action[]'. +!!! error TS2322: Type '{ id: 2; trueness: boolean; } | { id: 3; name: string; }' is not assignable to type 'Action'. +!!! error TS2322: Type '{ id: 2; trueness: boolean; }' is not assignable to type 'Action'. !!! error TS2322: Object literal may only specify known properties, and 'trueness' does not exist in type 'Action'. { id: 3, name: "three" } ] @@ -46,9 +46,9 @@ tests/cases/compiler/arrayLiteralTypeInference.ts(31,18): error TS2322: Type '({ [ { id: 2, trueness: false }, ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '({ id: number; trueness: boolean; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'. -!!! error TS2322: Type '{ id: number; trueness: boolean; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Type '{ id: number; trueness: boolean; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '({ id: 2; trueness: boolean; } | { id: 3; name: string; })[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type '{ id: 2; trueness: boolean; } | { id: 3; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '{ id: 2; trueness: boolean; }' is not assignable to type '{ id: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'trueness' does not exist in type '{ id: number; }'. { id: 3, name: "three" } ] diff --git a/tests/baselines/reference/arrayLiteralTypeInference.types b/tests/baselines/reference/arrayLiteralTypeInference.types index bb3c8b0b7debf..68b6e5118ab4e 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.types +++ b/tests/baselines/reference/arrayLiteralTypeInference.types @@ -25,17 +25,17 @@ class ActionB extends Action { var x1: Action[] = [ >x1 : Action[] >Action : Action ->[ { id: 2, trueness: false }, { id: 3, name: "three" }] : ({ id: number; trueness: boolean; } | { id: number; name: string; })[] +>[ { id: 2, trueness: false }, { id: 3, name: "three" }] : ({ id: 2; trueness: boolean; } | { id: 3; name: string; })[] { id: 2, trueness: false }, ->{ id: 2, trueness: false } : { id: number; trueness: boolean; } +>{ id: 2, trueness: false } : { id: 2; trueness: boolean; } >id : number >2 : 2 >trueness : boolean >false : false { id: 3, name: "three" } ->{ id: 3, name: "three" } : { id: number; name: string; } +>{ id: 3, name: "three" } : { id: 3; name: string; } >id : number >3 : 3 >name : string @@ -82,17 +82,17 @@ var z1: { id: number }[] = >id : number [ ->[ { id: 2, trueness: false }, { id: 3, name: "three" } ] : ({ id: number; trueness: boolean; } | { id: number; name: string; })[] +>[ { id: 2, trueness: false }, { id: 3, name: "three" } ] : ({ id: 2; trueness: boolean; } | { id: 3; name: string; })[] { id: 2, trueness: false }, ->{ id: 2, trueness: false } : { id: number; trueness: boolean; } +>{ id: 2, trueness: false } : { id: 2; trueness: boolean; } >id : number >2 : 2 >trueness : boolean >false : false { id: 3, name: "three" } ->{ id: 3, name: "three" } : { id: number; name: string; } +>{ id: 3, name: "three" } : { id: 3; name: string; } >id : number >3 : 3 >name : string diff --git a/tests/baselines/reference/arrayLiterals.errors.txt b/tests/baselines/reference/arrayLiterals.errors.txt index f5fe71b79a6e7..565098389ea37 100644 --- a/tests/baselines/reference/arrayLiterals.errors.txt +++ b/tests/baselines/reference/arrayLiterals.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/expressions/arrayLiterals/arrayLiterals.ts(24,77): error TS2322: Type '({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[]' is not assignable to type '{ [n: number]: { a: string; b: number; }; }'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals.ts(24,77): error TS2322: Type '({ a: ""; b: 0; c: string; } | { a: ""; b: 3; c: number; })[]' is not assignable to type '{ [n: number]: { a: string; b: number; }; }'. Index signatures are incompatible. - Type '{ a: string; b: number; c: string; } | { a: string; b: number; c: number; }' is not assignable to type '{ a: string; b: number; }'. - Type '{ a: string; b: number; c: string; }' is not assignable to type '{ a: string; b: number; }'. + Type '{ a: ""; b: 0; c: string; } | { a: ""; b: 3; c: number; }' is not assignable to type '{ a: string; b: number; }'. + Type '{ a: ""; b: 0; c: string; }' is not assignable to type '{ a: string; b: number; }'. Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. @@ -31,10 +31,10 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals.ts(24,77): error // Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; ~~~~~ -!!! error TS2322: Type '({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[]' is not assignable to type '{ [n: number]: { a: string; b: number; }; }'. +!!! error TS2322: Type '({ a: ""; b: 0; c: string; } | { a: ""; b: 3; c: number; })[]' is not assignable to type '{ [n: number]: { a: string; b: number; }; }'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type '{ a: string; b: number; c: string; } | { a: string; b: number; c: number; }' is not assignable to type '{ a: string; b: number; }'. -!!! error TS2322: Type '{ a: string; b: number; c: string; }' is not assignable to type '{ a: string; b: number; }'. +!!! error TS2322: Type '{ a: ""; b: 0; c: string; } | { a: ""; b: 3; c: number; }' is not assignable to type '{ a: string; b: number; }'. +!!! error TS2322: Type '{ a: ""; b: 0; c: string; }' is not assignable to type '{ a: string; b: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'c' does not exist in type '{ a: string; b: number; }'. var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; diff --git a/tests/baselines/reference/arrayLiterals.types b/tests/baselines/reference/arrayLiterals.types index 02dec0c8ecda8..9afd92aff2751 100644 --- a/tests/baselines/reference/arrayLiterals.types +++ b/tests/baselines/reference/arrayLiterals.types @@ -82,15 +82,15 @@ var context1: { [n: number]: { a: string; b: number; }; } = [{ a: '', b: 0, c: ' >n : number >a : string >b : number ->[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: string; b: number; c: string; } | { a: string; b: number; c: number; })[] ->{ a: '', b: 0, c: '' } : { a: string; b: number; c: string; } +>[{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }] : ({ a: ""; b: 0; c: string; } | { a: ""; b: 3; c: number; })[] +>{ a: '', b: 0, c: '' } : { a: ""; b: 0; c: string; } >a : string >'' : "" >b : number >0 : 0 >c : string >'' : "" ->{ a: "", b: 3, c: 0 } : { a: string; b: number; c: number; } +>{ a: "", b: 3, c: 0 } : { a: ""; b: 3; c: number; } >a : string >"" : "" >b : number diff --git a/tests/baselines/reference/arrayLiterals2ES5.types b/tests/baselines/reference/arrayLiterals2ES5.types index c3256db925e02..cc934367597eb 100644 --- a/tests/baselines/reference/arrayLiterals2ES5.types +++ b/tests/baselines/reference/arrayLiterals2ES5.types @@ -72,12 +72,12 @@ var b0: [any, any, any] = [undefined, null, undefined]; var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >b1 : [number[], string[]] ->[[1, 2, 3], ["hello", "string"]] : [number[], string[]] ->[1, 2, 3] : number[] +>[[1, 2, 3], ["hello", "string"]] : [(2 | 3 | 1)[], ("hello" | "string")[]] +>[1, 2, 3] : (2 | 3 | 1)[] >1 : 1 >2 : 2 >3 : 3 ->["hello", "string"] : string[] +>["hello", "string"] : ("hello" | "string")[] >"hello" : "hello" >"string" : "string" @@ -119,12 +119,12 @@ var temp1 = [1, 2, 3]; var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >temp2 : [number[], string[]] ->[[1, 2, 3], ["hello", "string"]] : [number[], string[]] ->[1, 2, 3] : number[] +>[[1, 2, 3], ["hello", "string"]] : [(2 | 3 | 1)[], ("hello" | "string")[]] +>[1, 2, 3] : (2 | 3 | 1)[] >1 : 1 >2 : 2 >3 : 3 ->["hello", "string"] : string[] +>["hello", "string"] : ("hello" | "string")[] >"hello" : "hello" >"string" : "string" diff --git a/tests/baselines/reference/arrayLiterals2ES6.types b/tests/baselines/reference/arrayLiterals2ES6.types index 57f3f44f62d84..4e3b08a3e9d15 100644 --- a/tests/baselines/reference/arrayLiterals2ES6.types +++ b/tests/baselines/reference/arrayLiterals2ES6.types @@ -72,12 +72,12 @@ var b0: [any, any, any] = [undefined, null, undefined]; var b1: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >b1 : [number[], string[]] ->[[1, 2, 3], ["hello", "string"]] : [number[], string[]] ->[1, 2, 3] : number[] +>[[1, 2, 3], ["hello", "string"]] : [(2 | 3 | 1)[], ("string" | "hello")[]] +>[1, 2, 3] : (2 | 3 | 1)[] >1 : 1 >2 : 2 >3 : 3 ->["hello", "string"] : string[] +>["hello", "string"] : ("string" | "hello")[] >"hello" : "hello" >"string" : "string" @@ -119,12 +119,12 @@ var temp1 = [1, 2, 3]; var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >temp2 : [number[], string[]] ->[[1, 2, 3], ["hello", "string"]] : [number[], string[]] ->[1, 2, 3] : number[] +>[[1, 2, 3], ["hello", "string"]] : [(2 | 3 | 1)[], ("string" | "hello")[]] +>[1, 2, 3] : (2 | 3 | 1)[] >1 : 1 >2 : 2 >3 : 3 ->["hello", "string"] : string[] +>["hello", "string"] : ("string" | "hello")[] >"hello" : "hello" >"string" : "string" diff --git a/tests/baselines/reference/arrayLiterals3.errors.txt b/tests/baselines/reference/arrayLiterals3.errors.txt index 8c36d7d59c148..743eecdb4e2fe 100644 --- a/tests/baselines/reference/arrayLiterals3.errors.txt +++ b/tests/baselines/reference/arrayLiterals3.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type 'undefined[]' is not assignable to type '[any, any, any]'. Property '0' is missing in type 'undefined[]'. -tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '["string", number, boolean]' is not assignable to type '[boolean, string, number]'. - Type '"string"' is not assignable to type 'boolean'. -tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. + Type 'string' is not assignable to type 'boolean'. +tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[1, 2, string, boolean]' is not assignable to type '[number, number]'. 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'. @@ -34,8 +34,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error !!! error TS2322: Property '0' is missing in type 'undefined[]'. var a1: [boolean, string, number] = ["string", 1, true]; // Error ~~ -!!! error TS2322: Type '["string", number, boolean]' is not assignable to type '[boolean, string, number]'. -!!! error TS2322: Type '"string"' is not assignable to type 'boolean'. +!!! error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. // The resulting type an array literal expression is determined as follows: // - If the array literal contains no spread elements and is an array assignment pattern in a destructuring assignment (section 4.17.1), @@ -43,7 +43,7 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error var [b1, b2]: [number, number] = [1, 2, "string", true]; ~~~~~~~~ -!!! error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'. +!!! error TS2322: Type '[1, 2, string, boolean]' is not assignable to type '[number, number]'. !!! error TS2322: Types of property 'length' are incompatible. !!! error TS2322: Type '4' is not assignable to type '2'. diff --git a/tests/baselines/reference/arrayLiterals3.types b/tests/baselines/reference/arrayLiterals3.types index 827f35ead8cbd..f1c7161f9d106 100644 --- a/tests/baselines/reference/arrayLiterals3.types +++ b/tests/baselines/reference/arrayLiterals3.types @@ -14,7 +14,7 @@ var a0: [any, any, any] = []; // Error var a1: [boolean, string, number] = ["string", 1, true]; // Error >a1 : [boolean, string, number] ->["string", 1, true] : ["string", number, boolean] +>["string", 1, true] : [string, number, boolean] >"string" : "string" >1 : 1 >true : true @@ -26,7 +26,7 @@ var a1: [boolean, string, number] = ["string", 1, true]; // Error var [b1, b2]: [number, number] = [1, 2, "string", true]; >b1 : number >b2 : number ->[1, 2, "string", true] : [number, number, string, boolean] +>[1, 2, "string", true] : [1, 2, string, boolean] >1 : 1 >2 : 2 >"string" : "string" @@ -51,12 +51,12 @@ var temp1 = [1, 2, 3]; var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; >temp2 : [number[], string[]] ->[[1, 2, 3], ["hello", "string"]] : [number[], string[]] ->[1, 2, 3] : number[] +>[[1, 2, 3], ["hello", "string"]] : [(1 | 2 | 3)[], ("string" | "hello")[]] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 ->["hello", "string"] : string[] +>["hello", "string"] : ("string" | "hello")[] >"hello" : "hello" >"string" : "string" diff --git a/tests/baselines/reference/arrowFunctionExpressions.types b/tests/baselines/reference/arrowFunctionExpressions.types index 0de6c674d18dc..8f56f6f0d3c27 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.types +++ b/tests/baselines/reference/arrowFunctionExpressions.types @@ -100,12 +100,12 @@ var p8 = ({ a = 1 }) => { }; >1 : 1 var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; ->p9 : ({ a: { b } }: { a?: { b?: number; }; }) => void ->({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b } }: { a?: { b?: number; }; }) => void +>p9 : ({ a: { b } }: { a?: { b?: 1; }; }) => void +>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b } }: { a?: { b?: 1; }; }) => void >a : any >b : number >1 : 1 ->{ b: 1 } : { b?: number; } +>{ b: 1 } : { b?: 1; } >b : number >1 : 1 diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types index 8a006d7f1d4d4..0dee51b3e0e06 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody5.types @@ -4,7 +4,7 @@ var a = () => { name: "foo", message: "bar" }; >() => { name: "foo", message: "bar" } : () => Error >{ name: "foo", message: "bar" } : Error >Error : Error ->{ name: "foo", message: "bar" } : { name: string; message: string; } +>{ name: "foo", message: "bar" } : { name: "foo"; message: "bar"; } >name : string >"foo" : "foo" >message : string @@ -16,7 +16,7 @@ var b = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : Error >{ name: "foo", message: "bar" } : Error >Error : Error ->{ name: "foo", message: "bar" } : { name: string; message: string; } +>{ name: "foo", message: "bar" } : { name: "foo"; message: "bar"; } >name : string >"foo" : "foo" >message : string @@ -39,8 +39,8 @@ var d = () => ((({ name: "foo", message: "bar" }))); >(({ name: "foo", message: "bar" })) : Error >({ name: "foo", message: "bar" }) : Error >Error : Error ->({ name: "foo", message: "bar" }) : { name: string; message: string; } ->{ name: "foo", message: "bar" } : { name: string; message: string; } +>({ name: "foo", message: "bar" }) : { name: "foo"; message: "bar"; } +>{ name: "foo", message: "bar" } : { name: "foo"; message: "bar"; } >name : string >"foo" : "foo" >message : string diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types index 615f19aaf6b6e..ba9ea46898396 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.types @@ -4,7 +4,7 @@ var a = () => { name: "foo", message: "bar" }; >() => { name: "foo", message: "bar" } : () => Error >{ name: "foo", message: "bar" } : Error >Error : Error ->{ name: "foo", message: "bar" } : { name: string; message: string; } +>{ name: "foo", message: "bar" } : { name: "foo"; message: "bar"; } >name : string >"foo" : "foo" >message : string @@ -16,7 +16,7 @@ var b = () => ({ name: "foo", message: "bar" }); >({ name: "foo", message: "bar" }) : Error >{ name: "foo", message: "bar" } : Error >Error : Error ->{ name: "foo", message: "bar" } : { name: string; message: string; } +>{ name: "foo", message: "bar" } : { name: "foo"; message: "bar"; } >name : string >"foo" : "foo" >message : string @@ -39,8 +39,8 @@ var d = () => ((({ name: "foo", message: "bar" }))); >(({ name: "foo", message: "bar" })) : Error >({ name: "foo", message: "bar" }) : Error >Error : Error ->({ name: "foo", message: "bar" }) : { name: string; message: string; } ->{ name: "foo", message: "bar" } : { name: string; message: string; } +>({ name: "foo", message: "bar" }) : { name: "foo"; message: "bar"; } +>{ name: "foo", message: "bar" } : { name: "foo"; message: "bar"; } >name : string >"foo" : "foo" >message : string diff --git a/tests/baselines/reference/assign1.types b/tests/baselines/reference/assign1.types index 51d9c72c54e9c..33796e87de038 100644 --- a/tests/baselines/reference/assign1.types +++ b/tests/baselines/reference/assign1.types @@ -15,7 +15,7 @@ module M { var x:I={salt:2,pepper:0}; >x : I >I : I ->{salt:2,pepper:0} : { salt: number; pepper: number; } +>{salt:2,pepper:0} : { salt: 2; pepper: 0; } >salt : number >2 : 2 >pepper : number diff --git a/tests/baselines/reference/assignmentCompatBug2.errors.txt b/tests/baselines/reference/assignmentCompatBug2.errors.txt index 29ba96e6586d4..8f4545b776e3b 100644 --- a/tests/baselines/reference/assignmentCompatBug2.errors.txt +++ b/tests/baselines/reference/assignmentCompatBug2.errors.txt @@ -2,14 +2,14 @@ tests/cases/compiler/assignmentCompatBug2.ts(1,27): error TS2322: Type '{ a: num Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. tests/cases/compiler/assignmentCompatBug2.ts(3,8): error TS2322: Type '{ 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(5,13): error TS2322: Type '{ b: number; a: number; }' is not assignable to type '{ b: number; }'. +tests/cases/compiler/assignmentCompatBug2.ts(5,13): error TS2322: Type '{ b: 0; 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; }'. -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; }'. -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; }'. +tests/cases/compiler/assignmentCompatBug2.ts(15,1): error TS2322: Type '{ f: (n: number) => 0; g: (s: string) => 0; }' 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) => 0; g: (s: string) => 0; }'. +tests/cases/compiler/assignmentCompatBug2.ts(20,1): error TS2322: Type '{ f: (n: number) => 0; m: 0; }' 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) => 0; m: 0; }'. +tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: number) => 0; g: (s: string) => 0; n: 0; 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) => 0; g: (s: string) => 0; n: 0; k: (a: any) => any; }'. ==== tests/cases/compiler/assignmentCompatBug2.ts (6 errors) ==== @@ -25,7 +25,7 @@ tests/cases/compiler/assignmentCompatBug2.ts(33,1): error TS2322: Type '{ f: (n: b2 = {b: 0, a: 0 }; ~~~~ -!!! error TS2322: Type '{ b: number; a: number; }' is not assignable to type '{ b: number; }'. +!!! error TS2322: Type '{ b: 0; a: number; }' is not assignable to type '{ b: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type '{ b: number; }'. var b3: { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; }; @@ -38,16 +38,16 @@ 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: Type '{ f: (n: number) => 0; g: (s: string) => 0; }' 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) => 0; g: (s: string) => 0; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, }; // error 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: Type '{ f: (n: number) => 0; m: 0; }' 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) => 0; m: 0; }'. f: (n) => { return 0; }, m: 0, }; // error @@ -62,8 +62,8 @@ 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: Type '{ f: (n: number) => 0; g: (s: string) => 0; n: 0; 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) => 0; g: (s: string) => 0; n: 0; k: (a: any) => any; }'. f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, diff --git a/tests/baselines/reference/assignmentCompatBug2.types b/tests/baselines/reference/assignmentCompatBug2.types index 414f91b5bdcfd..bffed88d7e9e1 100644 --- a/tests/baselines/reference/assignmentCompatBug2.types +++ b/tests/baselines/reference/assignmentCompatBug2.types @@ -14,9 +14,9 @@ b2 = { a: 0 }; // error >0 : 0 b2 = {b: 0, a: 0 }; ->b2 = {b: 0, a: 0 } : { b: number; a: number; } +>b2 = {b: 0, a: 0 } : { b: 0; a: number; } >b2 : { b: number; } ->{b: 0, a: 0 } : { b: number; a: number; } +>{b: 0, a: 0 } : { b: 0; a: number; } >b : number >0 : 0 >a : number @@ -34,19 +34,19 @@ var b3: { f(n: number): number; g(s: string): number; m: number; n?: number; k?( >a : any b3 = { ->b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0,} : { f: (n: number) => number; g: (s: string) => number; m: number; } +>b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0,} : { f: (n: number) => 0; g: (s: string) => 0; m: 0; } >b3 : { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; } ->{ f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0,} : { f: (n: number) => number; g: (s: string) => number; m: number; } +>{ f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0,} : { f: (n: number) => 0; g: (s: string) => 0; m: 0; } f: (n) => { return 0; }, ->f : (n: number) => number ->(n) => { return 0; } : (n: number) => number +>f : (n: number) => 0 +>(n) => { return 0; } : (n: number) => 0 >n : number >0 : 0 g: (s) => { return 0; }, ->g : (s: string) => number ->(s) => { return 0; } : (s: string) => number +>g : (s: string) => 0 +>(s) => { return 0; } : (s: string) => 0 >s : string >0 : 0 @@ -57,32 +57,32 @@ b3 = { }; // ok b3 = { ->b3 = { f: (n) => { return 0; }, g: (s) => { return 0; },} : { f: (n: number) => number; g: (s: string) => number; } +>b3 = { f: (n) => { return 0; }, g: (s) => { return 0; },} : { f: (n: number) => 0; g: (s: string) => 0; } >b3 : { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; } ->{ f: (n) => { return 0; }, g: (s) => { return 0; },} : { f: (n: number) => number; g: (s: string) => number; } +>{ f: (n) => { return 0; }, g: (s) => { return 0; },} : { f: (n: number) => 0; g: (s: string) => 0; } f: (n) => { return 0; }, ->f : (n: number) => number ->(n) => { return 0; } : (n: number) => number +>f : (n: number) => 0 +>(n) => { return 0; } : (n: number) => 0 >n : number >0 : 0 g: (s) => { return 0; }, ->g : (s: string) => number ->(s) => { return 0; } : (s: string) => number +>g : (s: string) => 0 +>(s) => { return 0; } : (s: string) => 0 >s : string >0 : 0 }; // error b3 = { ->b3 = { f: (n) => { return 0; }, m: 0,} : { f: (n: number) => number; m: number; } +>b3 = { f: (n) => { return 0; }, m: 0,} : { f: (n: number) => 0; m: 0; } >b3 : { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; } ->{ f: (n) => { return 0; }, m: 0,} : { f: (n: number) => number; m: number; } +>{ f: (n) => { return 0; }, m: 0,} : { f: (n: number) => 0; m: 0; } f: (n) => { return 0; }, ->f : (n: number) => number ->(n) => { return 0; } : (n: number) => number +>f : (n: number) => 0 +>(n) => { return 0; } : (n: number) => 0 >n : number >0 : 0 @@ -93,19 +93,19 @@ b3 = { }; // error b3 = { ->b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; m: number; n: number; k: (a: any) => any; } +>b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => 0; g: (s: string) => 0; m: 0; n: 0; k: (a: any) => any; } >b3 : { f(n: number): number; g(s: string): number; m: number; n?: number; k?(a: any): any; } ->{ f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; m: number; n: number; k: (a: any) => any; } +>{ f: (n) => { return 0; }, g: (s) => { return 0; }, m: 0, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => 0; g: (s: string) => 0; m: 0; n: 0; k: (a: any) => any; } f: (n) => { return 0; }, ->f : (n: number) => number ->(n) => { return 0; } : (n: number) => number +>f : (n: number) => 0 +>(n) => { return 0; } : (n: number) => 0 >n : number >0 : 0 g: (s) => { return 0; }, ->g : (s: string) => number ->(s) => { return 0; } : (s: string) => number +>g : (s: string) => 0 +>(s) => { return 0; } : (s: string) => 0 >s : string >0 : 0 @@ -126,19 +126,19 @@ b3 = { }; // ok b3 = { ->b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; } +>b3 = { f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => 0; g: (s: string) => 0; n: 0; k: (a: any) => any; } >b3 : { 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, k: (a) =>{ return null; },} : { f: (n: number) => number; g: (s: string) => number; n: number; k: (a: any) => any; } +>{ f: (n) => { return 0; }, g: (s) => { return 0; }, n: 0, k: (a) =>{ return null; },} : { f: (n: number) => 0; g: (s: string) => 0; n: 0; k: (a: any) => any; } f: (n) => { return 0; }, ->f : (n: number) => number ->(n) => { return 0; } : (n: number) => number +>f : (n: number) => 0 +>(n) => { return 0; } : (n: number) => 0 >n : number >0 : 0 g: (s) => { return 0; }, ->g : (s: string) => number ->(s) => { return 0; } : (s: string) => number +>g : (s: string) => 0 +>(s) => { return 0; } : (s: string) => 0 >s : string >0 : 0 diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt index 2316320f480c9..8b5da65edd92e 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.errors.txt @@ -1,9 +1,9 @@ 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,5): error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. +tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(4,5): error TS2345: Argument of type '{ id: 1234; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. Types of property 'name' are incompatible. Type 'boolean' 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 TS2345: Argument of type '{ name: "hello"; }' is not assignable to parameter of type '{ id: number; name?: string; }'. + Property 'id' is missing in type '{ name: "hello"; }'. ==== tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts (3 errors) ==== @@ -14,10 +14,10 @@ tests/cases/compiler/assignmentCompatFunctionsWithOptionalArgs.ts(5,5): error TS foo({ id: 1234, name: "hello" }); // Ok foo({ id: 1234, name: false }); // Error, name of wrong type ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ id: number; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. +!!! error TS2345: Argument of type '{ id: 1234; name: boolean; }' is not assignable to parameter of type '{ id: number; name?: string; }'. !!! error TS2345: Types of property 'name' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type '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 TS2345: Argument of type '{ name: "hello"; }' is not assignable to parameter of type '{ id: number; name?: string; }'. +!!! error TS2345: Property 'id' is missing in type '{ name: "hello"; }'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.types b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.types index 1f1beea0b38c6..f407fedede474 100644 --- a/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.types +++ b/tests/baselines/reference/assignmentCompatFunctionsWithOptionalArgs.types @@ -8,14 +8,14 @@ function foo(x: { id: number; name?: string; }): void; foo({ id: 1234 }); // Ok >foo({ id: 1234 }) : void >foo : (x: { id: number; name?: string; }) => void ->{ id: 1234 } : { id: number; } +>{ id: 1234 } : { id: 1234; } >id : number >1234 : 1234 foo({ id: 1234, name: "hello" }); // Ok >foo({ id: 1234, name: "hello" }) : void >foo : (x: { id: number; name?: string; }) => void ->{ id: 1234, name: "hello" } : { id: number; name: string; } +>{ id: 1234, name: "hello" } : { id: 1234; name: "hello"; } >id : number >1234 : 1234 >name : string diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types index 1bb87d3255f9c..730c83eb44d25 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.types @@ -38,15 +38,15 @@ var a: () => number; >a : () => number a = () => 1 // ok, same number of required params ->a = () => 1 : () => number +>a = () => 1 : () => 1 >a : () => number ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 a = (x?: number) => 1; // ok, same number of required params ->a = (x?: number) => 1 : (x?: number) => number +>a = (x?: number) => 1 : (x?: number) => 1 >a : () => number ->(x?: number) => 1 : (x?: number) => number +>(x?: number) => 1 : (x?: number) => 1 >x : number >1 : 1 @@ -104,22 +104,22 @@ var a2: (x?: number) => number; >x : number a2 = () => 1; // ok, same number of required params ->a2 = () => 1 : () => number +>a2 = () => 1 : () => 1 >a2 : (x?: number) => number ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 a2 = (x?: number) => 1; // ok, same number of required params ->a2 = (x?: number) => 1 : (x?: number) => number +>a2 = (x?: number) => 1 : (x?: number) => 1 >a2 : (x?: number) => number ->(x?: number) => 1 : (x?: number) => number +>(x?: number) => 1 : (x?: number) => 1 >x : number >1 : 1 a2 = (x: number) => 1; // ok, same number of params ->a2 = (x: number) => 1 : (x: number) => number +>a2 = (x: number) => 1 : (x: number) => 1 >a2 : (x?: number) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 @@ -170,22 +170,22 @@ var a3: (x: number) => number; >x : number a3 = () => 1; // ok, fewer required params ->a3 = () => 1 : () => number +>a3 = () => 1 : () => 1 >a3 : (x: number) => number ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 a3 = (x?: number) => 1; // ok, fewer required params ->a3 = (x?: number) => 1 : (x?: number) => number +>a3 = (x?: number) => 1 : (x?: number) => 1 >a3 : (x: number) => number ->(x?: number) => 1 : (x?: number) => number +>(x?: number) => 1 : (x?: number) => 1 >x : number >1 : 1 a3 = (x: number) => 1; // ok, same number of required params ->a3 = (x: number) => 1 : (x: number) => number +>a3 = (x: number) => 1 : (x: number) => 1 >a3 : (x: number) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 @@ -245,30 +245,30 @@ var a4: (x: number, y?: number) => number; >y : number a4 = () => 1; // ok, fewer required params ->a4 = () => 1 : () => number +>a4 = () => 1 : () => 1 >a4 : (x: number, y?: number) => number ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 a4 = (x?: number, y?: number) => 1; // ok, fewer required params ->a4 = (x?: number, y?: number) => 1 : (x?: number, y?: number) => number +>a4 = (x?: number, y?: number) => 1 : (x?: number, y?: number) => 1 >a4 : (x: number, y?: number) => number ->(x?: number, y?: number) => 1 : (x?: number, y?: number) => number +>(x?: number, y?: number) => 1 : (x?: number, y?: number) => 1 >x : number >y : number >1 : 1 a4 = (x: number) => 1; // ok, same number of required params ->a4 = (x: number) => 1 : (x: number) => number +>a4 = (x: number) => 1 : (x: number) => 1 >a4 : (x: number, y?: number) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 a4 = (x: number, y: number) => 1; // ok, same number of params ->a4 = (x: number, y: number) => 1 : (x: number, y: number) => number +>a4 = (x: number, y: number) => 1 : (x: number, y: number) => 1 >a4 : (x: number, y?: number) => number ->(x: number, y: number) => 1 : (x: number, y: number) => number +>(x: number, y: number) => 1 : (x: number, y: number) => 1 >x : number >y : number >1 : 1 @@ -321,30 +321,30 @@ var a5: (x?: number, y?: number) => number; >y : number a5 = () => 1; // ok, fewer required params ->a5 = () => 1 : () => number +>a5 = () => 1 : () => 1 >a5 : (x?: number, y?: number) => number ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 a5 = (x?: number, y?: number) => 1; // ok, fewer required params ->a5 = (x?: number, y?: number) => 1 : (x?: number, y?: number) => number +>a5 = (x?: number, y?: number) => 1 : (x?: number, y?: number) => 1 >a5 : (x?: number, y?: number) => number ->(x?: number, y?: number) => 1 : (x?: number, y?: number) => number +>(x?: number, y?: number) => 1 : (x?: number, y?: number) => 1 >x : number >y : number >1 : 1 a5 = (x: number) => 1; // ok, fewer params in lambda ->a5 = (x: number) => 1 : (x: number) => number +>a5 = (x: number) => 1 : (x: number) => 1 >a5 : (x?: number, y?: number) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 a5 = (x: number, y: number) => 1; // ok, same number of params ->a5 = (x: number, y: number) => 1 : (x: number, y: number) => number +>a5 = (x: number, y: number) => 1 : (x: number, y: number) => 1 >a5 : (x?: number, y?: number) => number ->(x: number, y: number) => 1 : (x: number, y: number) => number +>(x: number, y: number) => 1 : (x: number, y: number) => 1 >x : number >y : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt index 6b563ef26312e..e56968a548218 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.errors.txt @@ -1,28 +1,28 @@ -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(13,5): error TS2322: Type '(...args: string[]) => 1' is not assignable to type '(...args: number[]) => number'. Types of parameters 'args' and 'args' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(17,5): error TS2322: Type '(x?: string) => 1' is not assignable to type '(...args: number[]) => number'. Types of parameters 'x' and 'args' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(26,5): error TS2322: Type '(x: number, ...args: string[]) => 1' is not assignable to type '(x: number, ...z: number[]) => number'. Types of parameters 'args' and 'z' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(35,5): error TS2322: Type '(x: number, y?: number, z?: number) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(36,5): error TS2322: Type '(x: number, ...z: number[]) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. Types of parameters 'z' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(37,5): error TS2322: Type '(x: string, y?: string, z?: string) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(41,5): error TS2322: Type '(x?: number, y?: number) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(43,5): error TS2322: Type '(x: number, y?: number) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. Types of parameters 'y' and 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithCallSignaturesWithRestParameters.ts(45,5): error TS2322: Type '(x: number, ...args: string[]) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. Types of parameters 'args' and 'z' are incompatible. Type 'number' is not assignable to type 'string'. @@ -42,7 +42,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (...args: number[]) => 1; // ok, same number of required params a = (...args: string[]) => 1; // error, type mismatch ~ -!!! error TS2322: Type '(...args: string[]) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Type '(...args: string[]) => 1' is not assignable to type '(...args: number[]) => number'. !!! error TS2322: Types of parameters 'args' and 'args' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a = (x?: number) => 1; // ok, same number of required params @@ -50,7 +50,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a = (x: number) => 1; // ok, rest param corresponds to infinite number of params a = (x?: string) => 1; // error, incompatible type ~ -!!! error TS2322: Type '(x?: string) => number' is not assignable to type '(...args: number[]) => number'. +!!! error TS2322: Type '(x?: string) => 1' is not assignable to type '(...args: number[]) => number'. !!! error TS2322: Types of parameters 'x' and 'args' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. @@ -63,7 +63,7 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error ~~ -!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x: number, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, ...args: string[]) => 1' is not assignable to type '(x: number, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'args' and 'z' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params @@ -76,17 +76,17 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a3 = (x: number, y: string) => 1; // ok, all present params match a3 = (x: number, y?: number, z?: number) => 1; // error ~~ -!!! error TS2322: Type '(x: number, y?: number, z?: number) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, y?: number, z?: number) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a3 = (x: number, ...z: number[]) => 1; // error ~~ -!!! error TS2322: Type '(x: number, ...z: number[]) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, ...z: number[]) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'z' and 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a3 = (x: string, y?: string, z?: string) => 1; // error ~~ -!!! error TS2322: Type '(x: string, y?: string, z?: string) => number' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: string, y?: string, z?: string) => 1' is not assignable to type '(x: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. @@ -94,18 +94,18 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme a4 = () => 1; // ok, fewer required params a4 = (x?: number, y?: number) => 1; // error, type mismatch ~~ -!!! error TS2322: Type '(x?: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x?: number, y?: number) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a4 = (x: number) => 1; // ok, all present params match a4 = (x: number, y?: number) => 1; // error, second param has type mismatch ~~ -!!! error TS2322: Type '(x: number, y?: number) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, y?: number) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'y' and 'y' are incompatible. !!! error TS2322: Type 'string' is not assignable to type 'number'. a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch ~~ -!!! error TS2322: Type '(x: number, ...args: string[]) => number' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. +!!! error TS2322: Type '(x: number, ...args: string[]) => 1' is not assignable to type '(x?: number, y?: string, ...z: number[]) => number'. !!! error TS2322: Types of parameters 'args' and 'z' are incompatible. !!! error TS2322: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types index a2c726527cb0f..755b105b0f663 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.types @@ -31,52 +31,52 @@ var a: (...args: number[]) => number; // ok, same number of required params >args : number[] a = () => 1; // ok, same number of required params ->a = () => 1 : () => number +>a = () => 1 : () => 1 >a : (...args: number[]) => number ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 a = (...args: number[]) => 1; // ok, same number of required params ->a = (...args: number[]) => 1 : (...args: number[]) => number +>a = (...args: number[]) => 1 : (...args: number[]) => 1 >a : (...args: number[]) => number ->(...args: number[]) => 1 : (...args: number[]) => number +>(...args: number[]) => 1 : (...args: number[]) => 1 >args : number[] >1 : 1 a = (...args: string[]) => 1; // error, type mismatch ->a = (...args: string[]) => 1 : (...args: string[]) => number +>a = (...args: string[]) => 1 : (...args: string[]) => 1 >a : (...args: number[]) => number ->(...args: string[]) => 1 : (...args: string[]) => number +>(...args: string[]) => 1 : (...args: string[]) => 1 >args : string[] >1 : 1 a = (x?: number) => 1; // ok, same number of required params ->a = (x?: number) => 1 : (x?: number) => number +>a = (x?: number) => 1 : (x?: number) => 1 >a : (...args: number[]) => number ->(x?: number) => 1 : (x?: number) => number +>(x?: number) => 1 : (x?: number) => 1 >x : number >1 : 1 a = (x?: number, y?: number, z?: number) => 1; // ok, same number of required params ->a = (x?: number, y?: number, z?: number) => 1 : (x?: number, y?: number, z?: number) => number +>a = (x?: number, y?: number, z?: number) => 1 : (x?: number, y?: number, z?: number) => 1 >a : (...args: number[]) => number ->(x?: number, y?: number, z?: number) => 1 : (x?: number, y?: number, z?: number) => number +>(x?: number, y?: number, z?: number) => 1 : (x?: number, y?: number, z?: number) => 1 >x : number >y : number >z : number >1 : 1 a = (x: number) => 1; // ok, rest param corresponds to infinite number of params ->a = (x: number) => 1 : (x: number) => number +>a = (x: number) => 1 : (x: number) => 1 >a : (...args: number[]) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 a = (x?: string) => 1; // error, incompatible type ->a = (x?: string) => 1 : (x?: string) => number +>a = (x?: string) => 1 : (x?: string) => 1 >a : (...args: number[]) => number ->(x?: string) => 1 : (x?: string) => number +>(x?: string) => 1 : (x?: string) => 1 >x : string >1 : 1 @@ -87,60 +87,60 @@ var a2: (x: number, ...z: number[]) => number; >z : number[] a2 = () => 1; // ok, fewer required params ->a2 = () => 1 : () => number +>a2 = () => 1 : () => 1 >a2 : (x: number, ...z: number[]) => number ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 a2 = (...args: number[]) => 1; // ok, fewer required params ->a2 = (...args: number[]) => 1 : (...args: number[]) => number +>a2 = (...args: number[]) => 1 : (...args: number[]) => 1 >a2 : (x: number, ...z: number[]) => number ->(...args: number[]) => 1 : (...args: number[]) => number +>(...args: number[]) => 1 : (...args: number[]) => 1 >args : number[] >1 : 1 a2 = (x?: number) => 1; // ok, fewer required params ->a2 = (x?: number) => 1 : (x?: number) => number +>a2 = (x?: number) => 1 : (x?: number) => 1 >a2 : (x: number, ...z: number[]) => number ->(x?: number) => 1 : (x?: number) => number +>(x?: number) => 1 : (x?: number) => 1 >x : number >1 : 1 a2 = (x: number) => 1; // ok, same number of required params ->a2 = (x: number) => 1 : (x: number) => number +>a2 = (x: number) => 1 : (x: number) => 1 >a2 : (x: number, ...z: number[]) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 a2 = (x: number, ...args: number[]) => 1; // ok, same number of required params ->a2 = (x: number, ...args: number[]) => 1 : (x: number, ...args: number[]) => number +>a2 = (x: number, ...args: number[]) => 1 : (x: number, ...args: number[]) => 1 >a2 : (x: number, ...z: number[]) => number ->(x: number, ...args: number[]) => 1 : (x: number, ...args: number[]) => number +>(x: number, ...args: number[]) => 1 : (x: number, ...args: number[]) => 1 >x : number >args : number[] >1 : 1 a2 = (x: number, ...args: string[]) => 1; // should be type mismatch error ->a2 = (x: number, ...args: string[]) => 1 : (x: number, ...args: string[]) => number +>a2 = (x: number, ...args: string[]) => 1 : (x: number, ...args: string[]) => 1 >a2 : (x: number, ...z: number[]) => number ->(x: number, ...args: string[]) => 1 : (x: number, ...args: string[]) => number +>(x: number, ...args: string[]) => 1 : (x: number, ...args: string[]) => 1 >x : number >args : string[] >1 : 1 a2 = (x: number, y: number) => 1; // ok, rest param corresponds to infinite number of params ->a2 = (x: number, y: number) => 1 : (x: number, y: number) => number +>a2 = (x: number, y: number) => 1 : (x: number, y: number) => 1 >a2 : (x: number, ...z: number[]) => number ->(x: number, y: number) => 1 : (x: number, y: number) => number +>(x: number, y: number) => 1 : (x: number, y: number) => 1 >x : number >y : number >1 : 1 a2 = (x: number, y?: number) => 1; // ok, same number of required params ->a2 = (x: number, y?: number) => 1 : (x: number, y?: number) => number +>a2 = (x: number, y?: number) => 1 : (x: number, y?: number) => 1 >a2 : (x: number, ...z: number[]) => number ->(x: number, y?: number) => 1 : (x: number, y?: number) => number +>(x: number, y?: number) => 1 : (x: number, y?: number) => 1 >x : number >y : number >1 : 1 @@ -152,54 +152,54 @@ var a3: (x: number, y?: string, ...z: number[]) => number; >z : number[] a3 = () => 1; // ok, fewer required params ->a3 = () => 1 : () => number +>a3 = () => 1 : () => 1 >a3 : (x: number, y?: string, ...z: number[]) => number ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 a3 = (x?: number) => 1; // ok, fewer required params ->a3 = (x?: number) => 1 : (x?: number) => number +>a3 = (x?: number) => 1 : (x?: number) => 1 >a3 : (x: number, y?: string, ...z: number[]) => number ->(x?: number) => 1 : (x?: number) => number +>(x?: number) => 1 : (x?: number) => 1 >x : number >1 : 1 a3 = (x: number) => 1; // ok, same number of required params ->a3 = (x: number) => 1 : (x: number) => number +>a3 = (x: number) => 1 : (x: number) => 1 >a3 : (x: number, y?: string, ...z: number[]) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 a3 = (x: number, y: string) => 1; // ok, all present params match ->a3 = (x: number, y: string) => 1 : (x: number, y: string) => number +>a3 = (x: number, y: string) => 1 : (x: number, y: string) => 1 >a3 : (x: number, y?: string, ...z: number[]) => number ->(x: number, y: string) => 1 : (x: number, y: string) => number +>(x: number, y: string) => 1 : (x: number, y: string) => 1 >x : number >y : string >1 : 1 a3 = (x: number, y?: number, z?: number) => 1; // error ->a3 = (x: number, y?: number, z?: number) => 1 : (x: number, y?: number, z?: number) => number +>a3 = (x: number, y?: number, z?: number) => 1 : (x: number, y?: number, z?: number) => 1 >a3 : (x: number, y?: string, ...z: number[]) => number ->(x: number, y?: number, z?: number) => 1 : (x: number, y?: number, z?: number) => number +>(x: number, y?: number, z?: number) => 1 : (x: number, y?: number, z?: number) => 1 >x : number >y : number >z : number >1 : 1 a3 = (x: number, ...z: number[]) => 1; // error ->a3 = (x: number, ...z: number[]) => 1 : (x: number, ...z: number[]) => number +>a3 = (x: number, ...z: number[]) => 1 : (x: number, ...z: number[]) => 1 >a3 : (x: number, y?: string, ...z: number[]) => number ->(x: number, ...z: number[]) => 1 : (x: number, ...z: number[]) => number +>(x: number, ...z: number[]) => 1 : (x: number, ...z: number[]) => 1 >x : number >z : number[] >1 : 1 a3 = (x: string, y?: string, z?: string) => 1; // error ->a3 = (x: string, y?: string, z?: string) => 1 : (x: string, y?: string, z?: string) => number +>a3 = (x: string, y?: string, z?: string) => 1 : (x: string, y?: string, z?: string) => 1 >a3 : (x: number, y?: string, ...z: number[]) => number ->(x: string, y?: string, z?: string) => 1 : (x: string, y?: string, z?: string) => number +>(x: string, y?: string, z?: string) => 1 : (x: string, y?: string, z?: string) => 1 >x : string >y : string >z : string @@ -212,46 +212,46 @@ var a4: (x?: number, y?: string, ...z: number[]) => number; >z : number[] a4 = () => 1; // ok, fewer required params ->a4 = () => 1 : () => number +>a4 = () => 1 : () => 1 >a4 : (x?: number, y?: string, ...z: number[]) => number ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 a4 = (x?: number, y?: number) => 1; // error, type mismatch ->a4 = (x?: number, y?: number) => 1 : (x?: number, y?: number) => number +>a4 = (x?: number, y?: number) => 1 : (x?: number, y?: number) => 1 >a4 : (x?: number, y?: string, ...z: number[]) => number ->(x?: number, y?: number) => 1 : (x?: number, y?: number) => number +>(x?: number, y?: number) => 1 : (x?: number, y?: number) => 1 >x : number >y : number >1 : 1 a4 = (x: number) => 1; // ok, all present params match ->a4 = (x: number) => 1 : (x: number) => number +>a4 = (x: number) => 1 : (x: number) => 1 >a4 : (x?: number, y?: string, ...z: number[]) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 a4 = (x: number, y?: number) => 1; // error, second param has type mismatch ->a4 = (x: number, y?: number) => 1 : (x: number, y?: number) => number +>a4 = (x: number, y?: number) => 1 : (x: number, y?: number) => 1 >a4 : (x?: number, y?: string, ...z: number[]) => number ->(x: number, y?: number) => 1 : (x: number, y?: number) => number +>(x: number, y?: number) => 1 : (x: number, y?: number) => 1 >x : number >y : number >1 : 1 a4 = (x?: number, y?: string) => 1; // ok, same number of required params with matching types ->a4 = (x?: number, y?: string) => 1 : (x?: number, y?: string) => number +>a4 = (x?: number, y?: string) => 1 : (x?: number, y?: string) => 1 >a4 : (x?: number, y?: string, ...z: number[]) => number ->(x?: number, y?: string) => 1 : (x?: number, y?: string) => number +>(x?: number, y?: string) => 1 : (x?: number, y?: string) => 1 >x : number >y : string >1 : 1 a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch ->a4 = (x: number, ...args: string[]) => 1 : (x: number, ...args: string[]) => number +>a4 = (x: number, ...args: string[]) => 1 : (x: number, ...args: string[]) => 1 >a4 : (x?: number, y?: string, ...z: number[]) => number ->(x: number, ...args: string[]) => 1 : (x: number, ...args: string[]) => number +>(x: number, ...args: string[]) => 1 : (x: number, ...args: string[]) => 1 >x : number >args : string[] >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types index 88eadd4c36ac8..6929e92e89452 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers3.types +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers3.types @@ -51,14 +51,14 @@ var b: { foo: string; baz?: string } var a2: S2 = { foo: '' }; >a2 : S2 >S2 : S2 ->{ foo: '' } : { foo: string; } +>{ foo: '' } : { foo: ""; } >foo : string >'' : "" var b2: T2 = { foo: '' }; >b2 : T2 >T2 : T2 ->{ foo: '' } : { foo: string; } +>{ foo: '' } : { foo: ""; } >foo : string >'' : "" diff --git a/tests/baselines/reference/assignmentCompatability1.types b/tests/baselines/reference/assignmentCompatability1.types index 6f47a6e5244ce..e2facb75b2a85 100644 --- a/tests/baselines/reference/assignmentCompatability1.types +++ b/tests/baselines/reference/assignmentCompatability1.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability10.types b/tests/baselines/reference/assignmentCompatability10.types index 9784acfdabc75..66cd3a72c1074 100644 --- a/tests/baselines/reference/assignmentCompatability10.types +++ b/tests/baselines/reference/assignmentCompatability10.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability11.types b/tests/baselines/reference/assignmentCompatability11.types index d035fe7408444..7e2e9f22a0409 100644 --- a/tests/baselines/reference/assignmentCompatability11.types +++ b/tests/baselines/reference/assignmentCompatability11.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability12.types b/tests/baselines/reference/assignmentCompatability12.types index 34e83a7dc4444..a5db9f623ffad 100644 --- a/tests/baselines/reference/assignmentCompatability12.types +++ b/tests/baselines/reference/assignmentCompatability12.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability13.types b/tests/baselines/reference/assignmentCompatability13.types index 3ee0e4a15b5c6..7579edc27d755 100644 --- a/tests/baselines/reference/assignmentCompatability13.types +++ b/tests/baselines/reference/assignmentCompatability13.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability14.types b/tests/baselines/reference/assignmentCompatability14.types index 0eee6b216952c..c5a380326f108 100644 --- a/tests/baselines/reference/assignmentCompatability14.types +++ b/tests/baselines/reference/assignmentCompatability14.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability15.types b/tests/baselines/reference/assignmentCompatability15.types index 426c55f55dc58..6fbdde8d3c8a6 100644 --- a/tests/baselines/reference/assignmentCompatability15.types +++ b/tests/baselines/reference/assignmentCompatability15.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability16.types b/tests/baselines/reference/assignmentCompatability16.types index bc37bd93de635..7300d4d117a89 100644 --- a/tests/baselines/reference/assignmentCompatability16.types +++ b/tests/baselines/reference/assignmentCompatability16.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability17.types b/tests/baselines/reference/assignmentCompatability17.types index b6d6854d8a91a..42ad8c0a90b1f 100644 --- a/tests/baselines/reference/assignmentCompatability17.types +++ b/tests/baselines/reference/assignmentCompatability17.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability18.types b/tests/baselines/reference/assignmentCompatability18.types index cae2094c99299..218df595db002 100644 --- a/tests/baselines/reference/assignmentCompatability18.types +++ b/tests/baselines/reference/assignmentCompatability18.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability19.types b/tests/baselines/reference/assignmentCompatability19.types index 41fad382aa596..87ab7000aa333 100644 --- a/tests/baselines/reference/assignmentCompatability19.types +++ b/tests/baselines/reference/assignmentCompatability19.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability2.types b/tests/baselines/reference/assignmentCompatability2.types index 58fb86b5c7f1c..4a070940b4fe9 100644 --- a/tests/baselines/reference/assignmentCompatability2.types +++ b/tests/baselines/reference/assignmentCompatability2.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability20.types b/tests/baselines/reference/assignmentCompatability20.types index 666ad22e6812f..53ab9ddbe32ac 100644 --- a/tests/baselines/reference/assignmentCompatability20.types +++ b/tests/baselines/reference/assignmentCompatability20.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability21.types b/tests/baselines/reference/assignmentCompatability21.types index 2b0c8e90b7b24..67edab5edbd69 100644 --- a/tests/baselines/reference/assignmentCompatability21.types +++ b/tests/baselines/reference/assignmentCompatability21.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability22.types b/tests/baselines/reference/assignmentCompatability22.types index d94f7b51ee77b..ef8277571f4c9 100644 --- a/tests/baselines/reference/assignmentCompatability22.types +++ b/tests/baselines/reference/assignmentCompatability22.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability23.types b/tests/baselines/reference/assignmentCompatability23.types index 8c3f1155f71e4..74c926854b64d 100644 --- a/tests/baselines/reference/assignmentCompatability23.types +++ b/tests/baselines/reference/assignmentCompatability23.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability24.types b/tests/baselines/reference/assignmentCompatability24.types index 63fccee0c1ce1..cd2bda6bca871 100644 --- a/tests/baselines/reference/assignmentCompatability24.types +++ b/tests/baselines/reference/assignmentCompatability24.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability25.types b/tests/baselines/reference/assignmentCompatability25.types index 3f24a798d65c5..4bd23458cbe11 100644 --- a/tests/baselines/reference/assignmentCompatability25.types +++ b/tests/baselines/reference/assignmentCompatability25.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability26.types b/tests/baselines/reference/assignmentCompatability26.types index 9653a606705ad..c11a4656fe3a4 100644 --- a/tests/baselines/reference/assignmentCompatability26.types +++ b/tests/baselines/reference/assignmentCompatability26.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability27.types b/tests/baselines/reference/assignmentCompatability27.types index c04554e5764e9..6ecd689252db5 100644 --- a/tests/baselines/reference/assignmentCompatability27.types +++ b/tests/baselines/reference/assignmentCompatability27.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability28.types b/tests/baselines/reference/assignmentCompatability28.types index bdf277b0664de..f578fd2e4fe09 100644 --- a/tests/baselines/reference/assignmentCompatability28.types +++ b/tests/baselines/reference/assignmentCompatability28.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability29.types b/tests/baselines/reference/assignmentCompatability29.types index 7a87e4f8bee1f..6851063e5158d 100644 --- a/tests/baselines/reference/assignmentCompatability29.types +++ b/tests/baselines/reference/assignmentCompatability29.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability3.types b/tests/baselines/reference/assignmentCompatability3.types index 4525500cfec16..da58a3c7ea820 100644 --- a/tests/baselines/reference/assignmentCompatability3.types +++ b/tests/baselines/reference/assignmentCompatability3.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability30.types b/tests/baselines/reference/assignmentCompatability30.types index ca541edb5548b..8e50ef418bb7b 100644 --- a/tests/baselines/reference/assignmentCompatability30.types +++ b/tests/baselines/reference/assignmentCompatability30.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability31.types b/tests/baselines/reference/assignmentCompatability31.types index 2c4ec726bcb48..2efc40f1c4ab2 100644 --- a/tests/baselines/reference/assignmentCompatability31.types +++ b/tests/baselines/reference/assignmentCompatability31.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability32.types b/tests/baselines/reference/assignmentCompatability32.types index e7e9c3ef929dd..27fd212b76ecb 100644 --- a/tests/baselines/reference/assignmentCompatability32.types +++ b/tests/baselines/reference/assignmentCompatability32.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability33.types b/tests/baselines/reference/assignmentCompatability33.types index 9420c0f1bc995..d45061fabe730 100644 --- a/tests/baselines/reference/assignmentCompatability33.types +++ b/tests/baselines/reference/assignmentCompatability33.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability34.types b/tests/baselines/reference/assignmentCompatability34.types index 323dd84c787ba..040a079820398 100644 --- a/tests/baselines/reference/assignmentCompatability34.types +++ b/tests/baselines/reference/assignmentCompatability34.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability35.types b/tests/baselines/reference/assignmentCompatability35.types index 50da60fd0d928..3e0b639c9309b 100644 --- a/tests/baselines/reference/assignmentCompatability35.types +++ b/tests/baselines/reference/assignmentCompatability35.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability36.types b/tests/baselines/reference/assignmentCompatability36.types index 59ccc04195fbf..0d3402cd9788b 100644 --- a/tests/baselines/reference/assignmentCompatability36.types +++ b/tests/baselines/reference/assignmentCompatability36.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability37.types b/tests/baselines/reference/assignmentCompatability37.types index 44f1b7d120b0d..1835fa49fdb32 100644 --- a/tests/baselines/reference/assignmentCompatability37.types +++ b/tests/baselines/reference/assignmentCompatability37.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability38.types b/tests/baselines/reference/assignmentCompatability38.types index ae23533fb0891..fe05af57cbafe 100644 --- a/tests/baselines/reference/assignmentCompatability38.types +++ b/tests/baselines/reference/assignmentCompatability38.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability39.types b/tests/baselines/reference/assignmentCompatability39.types index 9621c62d07c51..a386a9234bfbe 100644 --- a/tests/baselines/reference/assignmentCompatability39.types +++ b/tests/baselines/reference/assignmentCompatability39.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability4.types b/tests/baselines/reference/assignmentCompatability4.types index bc5e805875c1d..c22c59cb22856 100644 --- a/tests/baselines/reference/assignmentCompatability4.types +++ b/tests/baselines/reference/assignmentCompatability4.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability40.types b/tests/baselines/reference/assignmentCompatability40.types index 31a598ffe2583..2aa5c13ce21ca 100644 --- a/tests/baselines/reference/assignmentCompatability40.types +++ b/tests/baselines/reference/assignmentCompatability40.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability41.types b/tests/baselines/reference/assignmentCompatability41.types index 343cd4e81b68b..ffe0abbfa13bc 100644 --- a/tests/baselines/reference/assignmentCompatability41.types +++ b/tests/baselines/reference/assignmentCompatability41.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability42.types b/tests/baselines/reference/assignmentCompatability42.types index 168d718e1e43a..fe5abae58885a 100644 --- a/tests/baselines/reference/assignmentCompatability42.types +++ b/tests/baselines/reference/assignmentCompatability42.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability43.types b/tests/baselines/reference/assignmentCompatability43.types index 8693eb35fbe72..d376f230854b1 100644 --- a/tests/baselines/reference/assignmentCompatability43.types +++ b/tests/baselines/reference/assignmentCompatability43.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 @@ -33,7 +33,7 @@ module __test2__ { >U : U >obj2 : interfaceTwo >interfaceTwo : interfaceTwo ->{ one: 1, two: "a" } : { one: number; two: string; } +>{ one: 1, two: "a" } : { one: 1; two: "a"; } >one : number >1 : 1 >two : string diff --git a/tests/baselines/reference/assignmentCompatability5.types b/tests/baselines/reference/assignmentCompatability5.types index 755ce16ec69cf..9c1c3d12f667a 100644 --- a/tests/baselines/reference/assignmentCompatability5.types +++ b/tests/baselines/reference/assignmentCompatability5.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 @@ -30,7 +30,7 @@ module __test2__ { >T : T >obj1 : interfaceOne >interfaceOne : interfaceOne ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability6.types b/tests/baselines/reference/assignmentCompatability6.types index d437d5a746962..86510f180d4cc 100644 --- a/tests/baselines/reference/assignmentCompatability6.types +++ b/tests/baselines/reference/assignmentCompatability6.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability7.types b/tests/baselines/reference/assignmentCompatability7.types index 3dad9966d836a..525e45ac0cd5d 100644 --- a/tests/baselines/reference/assignmentCompatability7.types +++ b/tests/baselines/reference/assignmentCompatability7.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 @@ -33,7 +33,7 @@ module __test2__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability8.types b/tests/baselines/reference/assignmentCompatability8.types index d4cc5ebc33e7d..df0171a258aa2 100644 --- a/tests/baselines/reference/assignmentCompatability8.types +++ b/tests/baselines/reference/assignmentCompatability8.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentCompatability9.types b/tests/baselines/reference/assignmentCompatability9.types index 671697f35f716..f9faac91f67cd 100644 --- a/tests/baselines/reference/assignmentCompatability9.types +++ b/tests/baselines/reference/assignmentCompatability9.types @@ -12,7 +12,7 @@ module __test1__ { >U : U >obj4 : interfaceWithPublicAndOptional >interfaceWithPublicAndOptional : interfaceWithPublicAndOptional ->{ one: 1 } : { one: number; } +>{ one: 1 } : { one: 1; } >one : number >1 : 1 diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.types b/tests/baselines/reference/assignmentToObjectAndFunction.types index d7c6a4f4b1299..17c0e76d61d2e 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.types +++ b/tests/baselines/reference/assignmentToObjectAndFunction.types @@ -9,10 +9,10 @@ var errObj: Object = { toString: 0 }; // Error, incompatible toString var goodObj: Object = { >goodObj : Object >Object : Object ->{ toString(x?) { return ""; }} : { toString(x?: any): string; } +>{ toString(x?) { return ""; }} : { toString(x?: any): ""; } toString(x?) { ->toString : (x?: any) => string +>toString : (x?: any) => "" >x : any return ""; diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.types b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.types index ab95fb8cb2f21..9742043aa6118 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.types +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.types @@ -109,31 +109,31 @@ module M2 { >3 : 3 } M2.M3 = { x: 3 }; // OK ->M2.M3 = { x: 3 } : { x: number; } +>M2.M3 = { x: 3 } : { x: 3; } >M2.M3 : typeof M2.M3 >M2 : typeof M2 >M3 : typeof M2.M3 ->{ x: 3 } : { x: number; } +>{ x: 3 } : { x: 3; } >x : number >3 : 3 (M2).M3 = { x: 3 }; // OK ->(M2).M3 = { x: 3 } : { x: number; } +>(M2).M3 = { x: 3 } : { x: 3; } >(M2).M3 : typeof M2.M3 >(M2) : typeof M2 >M2 : typeof M2 >M3 : typeof M2.M3 ->{ x: 3 } : { x: number; } +>{ x: 3 } : { x: 3; } >x : number >3 : 3 (M2.M3) = { x: 3 }; // OK ->(M2.M3) = { x: 3 } : { x: number; } +>(M2.M3) = { x: 3 } : { x: 3; } >(M2.M3) : typeof M2.M3 >M2.M3 : typeof M2.M3 >M2 : typeof M2 >M3 : typeof M2.M3 ->{ x: 3 } : { x: number; } +>{ x: 3 } : { x: 3; } >x : number >3 : 3 diff --git a/tests/baselines/reference/asyncFunctionReturnType.types b/tests/baselines/reference/asyncFunctionReturnType.types index d1dab14ba87c6..82b0c9b248ab4 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.types +++ b/tests/baselines/reference/asyncFunctionReturnType.types @@ -15,7 +15,7 @@ async function fAsyncExplicit(): Promise<[number, boolean]> { // This is contextually typed as a tuple. return [1, true]; ->[1, true] : [number, true] +>[1, true] : [1, true] >1 : 1 >true : true } diff --git a/tests/baselines/reference/bestCommonTypeOfTuple.types b/tests/baselines/reference/bestCommonTypeOfTuple.types index d62503b57d612..7d4561c00bc33 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple.types +++ b/tests/baselines/reference/bestCommonTypeOfTuple.types @@ -61,16 +61,16 @@ t2 = [E1.one, E2.two]; >two : E2 t3 = [5, undefined]; ->t3 = [5, undefined] : [number, undefined] +>t3 = [5, undefined] : [5, undefined] >t3 : [number, any] ->[5, undefined] : [number, undefined] +>[5, undefined] : [5, undefined] >5 : 5 >undefined : undefined t4 = [E1.one, E2.two, 20]; ->t4 = [E1.one, E2.two, 20] : [E1, E2, number] +>t4 = [E1.one, E2.two, 20] : [E1, E2, 20] >t4 : [E1, E2, number] ->[E1.one, E2.two, 20] : [E1, E2, number] +>[E1.one, E2.two, 20] : [E1, E2, 20] >E1.one : E1 >E1 : typeof E1 >one : E1 diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types index 8dc3c31867fc3..b9e69fdd21d8e 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types index 130b52c84717d..166eb0393a153 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types @@ -5,7 +5,7 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] ->["", "abc"] : string[] +>["", "abc"] : ("" | "abc")[] >"" : "" >"abc" : "abc" diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index 4032aa8ac249a..eedabcd9ea695 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -70,8 +70,8 @@ var p_cast = ({ >p_cast : Point > ({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}) : Point >Point : Point ->({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}) : { x: number; y: number; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; } ->{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }} : { x: number; y: number; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; } +>({ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }}) : { x: 0; y: 0; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; } +>{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }, mult: function(p) { return p; }} : { x: 0; y: 0; add: (dx: number, dy: number) => Point; mult: (p: Point) => Point; } x: 0, >x : number diff --git a/tests/baselines/reference/castingTuple.types b/tests/baselines/reference/castingTuple.types index 0b9aa0a14870e..ed848b5327be4 100644 --- a/tests/baselines/reference/castingTuple.types +++ b/tests/baselines/reference/castingTuple.types @@ -38,7 +38,7 @@ enum E2 { one } // no error var numStrTuple: [number, string] = [5, "foo"]; >numStrTuple : [number, string] ->[5, "foo"] : [number, string] +>[5, "foo"] : [5, "foo"] >5 : 5 >"foo" : "foo" @@ -124,7 +124,7 @@ var array1 = <{}[]>emptyObjTuple; var unionTuple: [C, string | number] = [new C(), "foo"]; >unionTuple : [C, string | number] >C : C ->[new C(), "foo"] : [C, string] +>[new C(), "foo"] : [C, "foo"] >new C() : C >C : typeof C >"foo" : "foo" @@ -133,7 +133,7 @@ var unionTuple2: [C, string | number, D] = [new C(), "foo", new D()]; >unionTuple2 : [C, string | number, D] >C : C >D : D ->[new C(), "foo", new D()] : [C, string, D] +>[new C(), "foo", new D()] : [C, "foo", D] >new C() : C >C : typeof C >"foo" : "foo" @@ -142,7 +142,7 @@ var unionTuple2: [C, string | number, D] = [new C(), "foo", new D()]; var unionTuple3: [number, string| number] = [10, "foo"]; >unionTuple3 : [number, string | number] ->[10, "foo"] : [number, string] +>[10, "foo"] : [10, "foo"] >10 : 10 >"foo" : "foo" diff --git a/tests/baselines/reference/checkJsdocTypedefInParamTag1.types b/tests/baselines/reference/checkJsdocTypedefInParamTag1.types index b0847a71522b5..bd2ab0f64d94c 100644 --- a/tests/baselines/reference/checkJsdocTypedefInParamTag1.types +++ b/tests/baselines/reference/checkJsdocTypedefInParamTag1.types @@ -22,7 +22,7 @@ function foo(opts) { foo({x: 'abc'}); >foo({x: 'abc'}) : void >foo : (opts: { x: string; y?: string; z?: string; w?: string; }) => void ->{x: 'abc'} : { x: string; } +>{x: 'abc'} : { x: "abc"; } >x : string >'abc' : "abc" @@ -46,7 +46,7 @@ function foo1(opts) { foo1({anotherX: "world"}); >foo1({anotherX: "world"}) : void >foo1 : (opts: { anotherX: string; anotherY?: string; }) => void ->{anotherX: "world"} : { anotherX: string; } +>{anotherX: "world"} : { anotherX: "world"; } >anotherX : string >"world" : "world" @@ -71,7 +71,7 @@ function foo2(opts) { foo2({x: 'abc'}); >foo2({x: 'abc'}) : void >foo2 : (opts: { x: string; y?: string; z?: string; w?: string; }) => void ->{x: 'abc'} : { x: string; } +>{x: 'abc'} : { x: "abc"; } >x : string >'abc' : "abc" diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1.types b/tests/baselines/reference/computedPropertiesInDestructuring1.types index efbcf0fb42a2f..7129c87475811 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1.types +++ b/tests/baselines/reference/computedPropertiesInDestructuring1.types @@ -113,12 +113,12 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >"bar" : "bar" ({["bar"]: bar2} = {bar: "bar"}); ->({["bar"]: bar2} = {bar: "bar"}) : { bar: string; } ->{["bar"]: bar2} = {bar: "bar"} : { bar: string; } +>({["bar"]: bar2} = {bar: "bar"}) : { bar: "bar"; } +>{["bar"]: bar2} = {bar: "bar"} : { bar: "bar"; } >{["bar"]: bar2} : { ["bar"]: string; } >"bar" : "bar" >bar2 : string ->{bar: "bar"} : { bar: string; } +>{bar: "bar"} : { bar: "bar"; } >bar : string >"bar" : "bar" diff --git a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types index 79fb83720231c..67f2d8f9b4090 100644 --- a/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types +++ b/tests/baselines/reference/computedPropertiesInDestructuring1_ES6.types @@ -119,12 +119,12 @@ let [{[foo.toExponential()]: bar7}] = [{bar: "bar"}]; >"bar" : "bar" ({["bar"]: bar2} = {bar: "bar"}); ->({["bar"]: bar2} = {bar: "bar"}) : { bar: string; } ->{["bar"]: bar2} = {bar: "bar"} : { bar: string; } +>({["bar"]: bar2} = {bar: "bar"}) : { bar: "bar"; } +>{["bar"]: bar2} = {bar: "bar"} : { bar: "bar"; } >{["bar"]: bar2} : { ["bar"]: string; } >"bar" : "bar" >bar2 : string ->{bar: "bar"} : { bar: string; } +>{bar: "bar"} : { bar: "bar"; } >bar : string >"bar" : "bar" diff --git a/tests/baselines/reference/computedPropertyNames48_ES5.types b/tests/baselines/reference/computedPropertyNames48_ES5.types index 25818fff967dd..2b71a9768e338 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES5.types +++ b/tests/baselines/reference/computedPropertyNames48_ES5.types @@ -17,7 +17,7 @@ var a: any; extractIndexer({ >extractIndexer({ [a]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ [a]: ""} : { [x: number]: string; } +>{ [a]: ""} : { [x: number]: ""; } [a]: "" >a : any @@ -28,7 +28,7 @@ extractIndexer({ extractIndexer({ >extractIndexer({ [E.x]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ [E.x]: ""} : { [E.x]: string; } +>{ [E.x]: ""} : { [E.x]: ""; } [E.x]: "" >E.x : E @@ -41,7 +41,7 @@ extractIndexer({ extractIndexer({ >extractIndexer({ ["" || 0]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ ["" || 0]: ""} : { ["" || 0]: string; } +>{ ["" || 0]: ""} : { ["" || 0]: ""; } ["" || 0]: "" >"" || 0 : 0 diff --git a/tests/baselines/reference/computedPropertyNames48_ES6.types b/tests/baselines/reference/computedPropertyNames48_ES6.types index 65f93239f30a9..577753a542591 100644 --- a/tests/baselines/reference/computedPropertyNames48_ES6.types +++ b/tests/baselines/reference/computedPropertyNames48_ES6.types @@ -17,7 +17,7 @@ var a: any; extractIndexer({ >extractIndexer({ [a]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ [a]: ""} : { [x: number]: string; } +>{ [a]: ""} : { [x: number]: ""; } [a]: "" >a : any @@ -28,7 +28,7 @@ extractIndexer({ extractIndexer({ >extractIndexer({ [E.x]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ [E.x]: ""} : { [E.x]: string; } +>{ [E.x]: ""} : { [E.x]: ""; } [E.x]: "" >E.x : E @@ -41,7 +41,7 @@ extractIndexer({ extractIndexer({ >extractIndexer({ ["" || 0]: ""}) : string >extractIndexer : (p: { [n: number]: T; }) => T ->{ ["" || 0]: ""} : { ["" || 0]: string; } +>{ ["" || 0]: ""} : { ["" || 0]: ""; } ["" || 0]: "" >"" || 0 : 0 diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt index f277df6f4c8f6..7fa95fe942616 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts(5,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts(5,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. Index signatures are incompatible. - Type '"" | 0' is not assignable to type 'boolean'. - Type '""' is not assignable to type 'boolean'. + Type 'string | number' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES5.ts (1 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. -!!! error TS2322: Type '""' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.types index ec75655aa5d95..15e596084a9b5 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES5.types @@ -9,7 +9,7 @@ interface I { var o: I = { >o : I >I : I ->{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: "" | 0; } +>{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", >+"foo" : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt index 689ec135d3f10..116cd1a25311e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES6.ts(5,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES6.ts(5,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. Index signatures are incompatible. - Type '"" | 0' is not assignable to type 'boolean'. - Type '""' is not assignable to type 'boolean'. + Type 'string | number' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType10_ES6.ts (1 errors) ==== @@ -11,10 +11,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. -!!! error TS2322: Type '""' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.types index 4f61e710c8da0..251f5da73c157 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType10_ES6.types @@ -9,7 +9,7 @@ interface I { var o: I = { >o : I >I : I ->{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: "" | 0; } +>{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", >+"foo" : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types index f144bb9d020e9..518fb38da1e8c 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES5.types @@ -19,7 +19,7 @@ declare function foo(obj: I): T foo({ >foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] >foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: true | "" | (() => void) | 0 | number[]; [x: number]: (() => void) | 0 | number[]; p: ""; 0: () => void; } +>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: true | "" | (() => void) | 0 | 0[]; [x: number]: (() => void) | 0 | 0[]; p: ""; 0: () => void; } p: "", >p : string @@ -43,7 +43,7 @@ foo({ [+"hi"]: [0] >+"hi" : number >"hi" : "hi" ->[0] : number[] +>[0] : 0[] >0 : 0 }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types index 6b8c8ae2e34fc..bc106adde4e66 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType6_ES6.types @@ -19,7 +19,7 @@ declare function foo(obj: I): T foo({ >foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[] >foo : (obj: I) => T ->{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: true | "" | (() => void) | 0 | number[]; [x: number]: (() => void) | 0 | number[]; p: ""; 0: () => void; } +>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: true | "" | (() => void) | 0 | 0[]; [x: number]: (() => void) | 0 | 0[]; p: ""; 0: () => void; } p: "", >p : string @@ -43,7 +43,7 @@ foo({ [+"hi"]: [0] >+"hi" : number >"hi" : "hi" ->[0] : number[] +>[0] : 0[] >0 : 0 }); diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types index b77a129a0b43e..c05bd64c8b08f 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES5.types @@ -35,7 +35,7 @@ declare function g(obj: J): T; foo({ >foo({ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[] >foo : (obj: I) => T ->{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; } +>{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: boolean | (() => void) | 0 | 0[]; [x: number]: (() => void) | 0 | 0[]; 0: () => void; } 0: () => { }, >() => { } : () => void @@ -55,7 +55,7 @@ foo({ [+"hi"]: [0] >+"hi" : number >"hi" : "hi" ->[0] : number[] +>[0] : 0[] >0 : 0 }); @@ -63,7 +63,7 @@ foo({ g({ p: "" }); >g({ p: "" }) : string >g : (obj: J) => T ->{ p: "" } : { p: string; } +>{ p: "" } : { p: ""; } >p : string >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types index f041b2b4eb49a..20beffaea26b6 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType7_ES6.types @@ -35,7 +35,7 @@ declare function g(obj: J): T; foo({ >foo({ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[] >foo : (obj: I) => T ->{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: number | boolean | (() => void) | number[]; [x: number]: number | (() => void) | number[]; 0: () => void; } +>{ 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: boolean | (() => void) | 0 | 0[]; [x: number]: (() => void) | 0 | 0[]; 0: () => void; } 0: () => { }, >() => { } : () => void @@ -55,7 +55,7 @@ foo({ [+"hi"]: [0] >+"hi" : number >"hi" : "hi" ->[0] : number[] +>[0] : 0[] >0 : 0 }); @@ -63,7 +63,7 @@ foo({ g({ p: "" }); >g({ p: "" }) : string >g : (obj: J) => T ->{ p: "" } : { p: string; } +>{ p: "" } : { p: ""; } >p : string >"" : "" diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt index 6bfc98ae6a82a..ee36609095a04 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. Index signatures are incompatible. - Type '"" | 0' is not assignable to type 'boolean'. - Type '""' is not assignable to type 'boolean'. + Type 'string | number' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. -!!! error TS2322: Type '""' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [""+"foo"]: "", [""+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.types index 290c8ed18155c..5bc49c6e86fe4 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES5.types @@ -12,7 +12,7 @@ interface I { var o: I = { >o : I >I : I ->{ [""+"foo"]: "", [""+"bar"]: 0} : { [x: string]: "" | 0; } +>{ [""+"foo"]: "", [""+"bar"]: 0} : { [x: string]: string | number; } [""+"foo"]: "", >""+"foo" : string diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt index 30f0b6f529e95..1048fd2e119e7 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(6,5): error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. Index signatures are incompatible. - Type '"" | 0' is not assignable to type 'boolean'. - Type '""' is not assignable to type 'boolean'. + Type 'string | number' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: string]: "" | 0; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. -!!! error TS2322: Type '""' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [""+"foo"]: "", [""+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.types index cb2bb5b1c94f2..d8108935ac0dd 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType8_ES6.types @@ -12,7 +12,7 @@ interface I { var o: I = { >o : I >I : I ->{ [""+"foo"]: "", [""+"bar"]: 0} : { [x: string]: "" | 0; } +>{ [""+"foo"]: "", [""+"bar"]: 0} : { [x: string]: string | number; } [""+"foo"]: "", >""+"foo" : string diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt index 4f94dd3467f85..e76b3a704dc6e 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(6,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. Index signatures are incompatible. - Type '"" | 0' is not assignable to type 'boolean'. - Type '""' is not assignable to type 'boolean'. + Type 'string | number' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. -!!! error TS2322: Type '""' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.types b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.types index 76aa8b00bc145..acadffbf76615 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES5.types @@ -12,7 +12,7 @@ interface I { var o: I = { >o : I >I : I ->{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: "" | 0; } +>{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", >+"foo" : number diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt index 5eeccfe729302..468ad400c26cc 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(6,5): error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. +tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(6,5): error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. Index signatures are incompatible. - Type '"" | 0' is not assignable to type 'boolean'. - Type '""' is not assignable to type 'boolean'. + Type 'string | number' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts (1 errors) ==== @@ -12,10 +12,10 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualTy var o: I = { ~ -!!! error TS2322: Type '{ [x: number]: "" | 0; }' is not assignable to type 'I'. +!!! error TS2322: Type '{ [x: number]: string | number; }' is not assignable to type 'I'. !!! error TS2322: Index signatures are incompatible. -!!! error TS2322: Type '"" | 0' is not assignable to type 'boolean'. -!!! error TS2322: Type '""' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'. +!!! error TS2322: Type 'string' is not assignable to type 'boolean'. [+"foo"]: "", [+"bar"]: 0 } \ No newline at end of file diff --git a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.types b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.types index 6d5101eb6e4ce..eef180fbaea55 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.types +++ b/tests/baselines/reference/computedPropertyNamesContextualType9_ES6.types @@ -12,7 +12,7 @@ interface I { var o: I = { >o : I >I : I ->{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: "" | 0; } +>{ [+"foo"]: "", [+"bar"]: 0} : { [x: number]: string | number; } [+"foo"]: "", >+"foo" : number diff --git a/tests/baselines/reference/concatError.types b/tests/baselines/reference/concatError.types index 729704789074a..5228aaabe69a4 100644 --- a/tests/baselines/reference/concatError.types +++ b/tests/baselines/reference/concatError.types @@ -18,7 +18,7 @@ fa = fa.concat([0]); >fa.concat : { (...items: ReadonlyArray[]): number[]; (...items: (number | ReadonlyArray)[]): number[]; } >fa : number[] >concat : { (...items: ReadonlyArray[]): number[]; (...items: (number | ReadonlyArray)[]): number[]; } ->[0] : number[] +>[0] : 0[] >0 : 0 fa = fa.concat(0); diff --git a/tests/baselines/reference/concatTuples.types b/tests/baselines/reference/concatTuples.types index 147d76efd0436..415979ad3b937 100644 --- a/tests/baselines/reference/concatTuples.types +++ b/tests/baselines/reference/concatTuples.types @@ -1,8 +1,8 @@ === tests/cases/compiler/concatTuples.ts === let ijs: [number, number][] = [[1, 2]]; >ijs : [number, number][] ->[[1, 2]] : [number, number][] ->[1, 2] : [number, number] +>[[1, 2]] : [1, 2][] +>[1, 2] : [1, 2] >1 : 1 >2 : 2 @@ -13,11 +13,11 @@ ijs = ijs.concat([[3, 4], [5, 6]]); >ijs.concat : { (...items: ReadonlyArray<[number, number]>[]): [number, number][]; (...items: ([number, number] | ReadonlyArray<[number, number]>)[]): [number, number][]; } >ijs : [number, number][] >concat : { (...items: ReadonlyArray<[number, number]>[]): [number, number][]; (...items: ([number, number] | ReadonlyArray<[number, number]>)[]): [number, number][]; } ->[[3, 4], [5, 6]] : [number, number][] ->[3, 4] : [number, number] +>[[3, 4], [5, 6]] : ([3, 4] | [5, 6])[] +>[3, 4] : [3, 4] >3 : 3 >4 : 4 ->[5, 6] : [number, number] +>[5, 6] : [5, 6] >5 : 5 >6 : 6 diff --git a/tests/baselines/reference/constructorWithAssignableReturnExpression.types b/tests/baselines/reference/constructorWithAssignableReturnExpression.types index b542cdb2b7b66..53f62de037db7 100644 --- a/tests/baselines/reference/constructorWithAssignableReturnExpression.types +++ b/tests/baselines/reference/constructorWithAssignableReturnExpression.types @@ -30,7 +30,7 @@ class E { constructor() { return { x: 1 }; ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 } diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types index d8217600a66e1..28867d921430c 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types @@ -580,7 +580,7 @@ module TypeScriptAllInOne { var a: number[] = [1, 2, 3, 4, 5, ];/*[] bug*/ // YES [] >a : number[] ->[1, 2, 3, 4, 5, ] : number[] +>[1, 2, 3, 4, 5, ] : (1 | 4 | 2 | 3 | 5)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/contextualTypeFromJSDoc.types b/tests/baselines/reference/contextualTypeFromJSDoc.types index f1121935d382b..cf8bd9e887a22 100644 --- a/tests/baselines/reference/contextualTypeFromJSDoc.types +++ b/tests/baselines/reference/contextualTypeFromJSDoc.types @@ -2,19 +2,19 @@ /** @type {Array<[string, {x?:number, y?:number}]>} */ const arr = [ >arr : [string, { x?: number; y?: number; }][] ->[ ['a', { x: 1 }], ['b', { y: 2 }]] : ([string, { x: number; }] | [string, { y: number; }])[] +>[ ['a', { x: 1 }], ['b', { y: 2 }]] : (["a", { x: 1; }] | ["b", { y: 2; }])[] ['a', { x: 1 }], ->['a', { x: 1 }] : [string, { x: number; }] +>['a', { x: 1 }] : ["a", { x: 1; }] >'a' : "a" ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 ['b', { y: 2 }] ->['b', { y: 2 }] : [string, { y: number; }] +>['b', { y: 2 }] : ["b", { y: 2; }] >'b' : "b" ->{ y: 2 } : { y: number; } +>{ y: 2 } : { y: 2; } >y : number >2 : 2 @@ -25,19 +25,19 @@ function f() { >f : () => [string, { x?: number; y?: number; }][] return [ ->[ ['a', { x: 1 }], ['b', { y: 2 }] ] : ([string, { x: number; }] | [string, { y: number; }])[] +>[ ['a', { x: 1 }], ['b', { y: 2 }] ] : (["a", { x: 1; }] | ["b", { y: 2; }])[] ['a', { x: 1 }], ->['a', { x: 1 }] : [string, { x: number; }] +>['a', { x: 1 }] : ["a", { x: 1; }] >'a' : "a" ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 ['b', { y: 2 }] ->['b', { y: 2 }] : [string, { y: number; }] +>['b', { y: 2 }] : ["b", { y: 2; }] >'b' : "b" ->{ y: 2 } : { y: number; } +>{ y: 2 } : { y: 2; } >y : number >2 : 2 @@ -56,19 +56,19 @@ class C { >x : [string, { x?: number; y?: number; }][] return [ ->[ ['a', { x: 1 }], ['b', { y: 2 }] ] : ([string, { x: number; }] | [string, { y: number; }])[] +>[ ['a', { x: 1 }], ['b', { y: 2 }] ] : (["a", { x: 1; }] | ["b", { y: 2; }])[] ['a', { x: 1 }], ->['a', { x: 1 }] : [string, { x: number; }] +>['a', { x: 1 }] : ["a", { x: 1; }] >'a' : "a" ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 ['b', { y: 2 }] ->['b', { y: 2 }] : [string, { y: number; }] +>['b', { y: 2 }] : ["b", { y: 2; }] >'b' : "b" ->{ y: 2 } : { y: number; } +>{ y: 2 } : { y: 2; } >y : number >2 : 2 diff --git a/tests/baselines/reference/contextualTypeLogicalOr.types b/tests/baselines/reference/contextualTypeLogicalOr.types index 7d380a2ace3f8..fdfb974d8bd3e 100644 --- a/tests/baselines/reference/contextualTypeLogicalOr.types +++ b/tests/baselines/reference/contextualTypeLogicalOr.types @@ -30,108 +30,108 @@ var a = >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4] || ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 x && [1, 2, 3, 4]; ->x && [1, 2, 3, 4] : number[] +>x && [1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >x : number ->[1, 2, 3, 4] : number[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/contextualTypeShouldBeLiteral.js b/tests/baselines/reference/contextualTypeShouldBeLiteral.js new file mode 100644 index 0000000000000..dcb9da993c1cb --- /dev/null +++ b/tests/baselines/reference/contextualTypeShouldBeLiteral.js @@ -0,0 +1,136 @@ +//// [contextualTypeShouldBeLiteral.ts] +interface X { + type: 'x'; + value: string; + method(): void; +} + +interface Y { + type: 'y'; + value: 'none' | 'done'; + method(): void; +} + +function foo(bar: X | Y) { } + +foo({ + type: 'y', + value: 'done', + method() { + this; + this.type; + this.value; + } +}); + +interface X2 { + type1: 'x'; + value: string; + method(): void; +} + +interface Y2 { + type2: 'y'; + value: 'none' | 'done'; + method(): void; +} + +function foo2(bar: X2 | Y2) { } + +foo2({ + type2: 'y', + value: 'done', + method() { + this; + this.value; + } +}); + +interface X3 { + type: 'x'; + value: 1 | 2 | 3; + xtra: number; +} + +interface Y3 { + type: 'y'; + value: 11 | 12 | 13; + ytra: number; +} + +let xy: X3 | Y3 = { + type: 'y', + value: 11, + ytra: 12 +}; + +xy; + + +interface LikeA { + x: 'x'; + y: 'y'; + value: string; + method(): void; +} + +interface LikeB { + x: 'xx'; + y: 'yy'; + value: number; + method(): void; +} + +let xyz: LikeA | LikeB = { + x: 'x', + y: 'y', + value: "foo", + method() { + this; + this.x; + this.y; + this.value; + } +}; + +xyz; + +//// [contextualTypeShouldBeLiteral.js] +"use strict"; +function foo(bar) { } +foo({ + type: 'y', + value: 'done', + method: function () { + this; + this.type; + this.value; + } +}); +function foo2(bar) { } +foo2({ + type2: 'y', + value: 'done', + method: function () { + this; + this.value; + } +}); +var xy = { + type: 'y', + value: 11, + ytra: 12 +}; +xy; +var xyz = { + x: 'x', + y: 'y', + value: "foo", + method: function () { + this; + this.x; + this.y; + this.value; + } +}; +xyz; diff --git a/tests/baselines/reference/contextualTypeShouldBeLiteral.symbols b/tests/baselines/reference/contextualTypeShouldBeLiteral.symbols new file mode 100644 index 0000000000000..314117b509d94 --- /dev/null +++ b/tests/baselines/reference/contextualTypeShouldBeLiteral.symbols @@ -0,0 +1,229 @@ +=== tests/cases/compiler/contextualTypeShouldBeLiteral.ts === +interface X { +>X : Symbol(X, Decl(contextualTypeShouldBeLiteral.ts, 0, 0)) + + type: 'x'; +>type : Symbol(X.type, Decl(contextualTypeShouldBeLiteral.ts, 0, 13)) + + value: string; +>value : Symbol(X.value, Decl(contextualTypeShouldBeLiteral.ts, 1, 14)) + + method(): void; +>method : Symbol(X.method, Decl(contextualTypeShouldBeLiteral.ts, 2, 18)) +} + +interface Y { +>Y : Symbol(Y, Decl(contextualTypeShouldBeLiteral.ts, 4, 1)) + + type: 'y'; +>type : Symbol(Y.type, Decl(contextualTypeShouldBeLiteral.ts, 6, 13)) + + value: 'none' | 'done'; +>value : Symbol(Y.value, Decl(contextualTypeShouldBeLiteral.ts, 7, 14)) + + method(): void; +>method : Symbol(Y.method, Decl(contextualTypeShouldBeLiteral.ts, 8, 27)) +} + +function foo(bar: X | Y) { } +>foo : Symbol(foo, Decl(contextualTypeShouldBeLiteral.ts, 10, 1)) +>bar : Symbol(bar, Decl(contextualTypeShouldBeLiteral.ts, 12, 13)) +>X : Symbol(X, Decl(contextualTypeShouldBeLiteral.ts, 0, 0)) +>Y : Symbol(Y, Decl(contextualTypeShouldBeLiteral.ts, 4, 1)) + +foo({ +>foo : Symbol(foo, Decl(contextualTypeShouldBeLiteral.ts, 10, 1)) + + type: 'y', +>type : Symbol(type, Decl(contextualTypeShouldBeLiteral.ts, 14, 5)) + + value: 'done', +>value : Symbol(value, Decl(contextualTypeShouldBeLiteral.ts, 15, 14)) + + method() { +>method : Symbol(method, Decl(contextualTypeShouldBeLiteral.ts, 16, 18)) + + this; +>this : Symbol(Y, Decl(contextualTypeShouldBeLiteral.ts, 4, 1)) + + this.type; +>this.type : Symbol(Y.type, Decl(contextualTypeShouldBeLiteral.ts, 6, 13)) +>this : Symbol(Y, Decl(contextualTypeShouldBeLiteral.ts, 4, 1)) +>type : Symbol(Y.type, Decl(contextualTypeShouldBeLiteral.ts, 6, 13)) + + this.value; +>this.value : Symbol(Y.value, Decl(contextualTypeShouldBeLiteral.ts, 7, 14)) +>this : Symbol(Y, Decl(contextualTypeShouldBeLiteral.ts, 4, 1)) +>value : Symbol(Y.value, Decl(contextualTypeShouldBeLiteral.ts, 7, 14)) + } +}); + +interface X2 { +>X2 : Symbol(X2, Decl(contextualTypeShouldBeLiteral.ts, 22, 3)) + + type1: 'x'; +>type1 : Symbol(X2.type1, Decl(contextualTypeShouldBeLiteral.ts, 24, 14)) + + value: string; +>value : Symbol(X2.value, Decl(contextualTypeShouldBeLiteral.ts, 25, 15)) + + method(): void; +>method : Symbol(X2.method, Decl(contextualTypeShouldBeLiteral.ts, 26, 18)) +} + +interface Y2 { +>Y2 : Symbol(Y2, Decl(contextualTypeShouldBeLiteral.ts, 28, 1)) + + type2: 'y'; +>type2 : Symbol(Y2.type2, Decl(contextualTypeShouldBeLiteral.ts, 30, 14)) + + value: 'none' | 'done'; +>value : Symbol(Y2.value, Decl(contextualTypeShouldBeLiteral.ts, 31, 15)) + + method(): void; +>method : Symbol(Y2.method, Decl(contextualTypeShouldBeLiteral.ts, 32, 27)) +} + +function foo2(bar: X2 | Y2) { } +>foo2 : Symbol(foo2, Decl(contextualTypeShouldBeLiteral.ts, 34, 1)) +>bar : Symbol(bar, Decl(contextualTypeShouldBeLiteral.ts, 36, 14)) +>X2 : Symbol(X2, Decl(contextualTypeShouldBeLiteral.ts, 22, 3)) +>Y2 : Symbol(Y2, Decl(contextualTypeShouldBeLiteral.ts, 28, 1)) + +foo2({ +>foo2 : Symbol(foo2, Decl(contextualTypeShouldBeLiteral.ts, 34, 1)) + + type2: 'y', +>type2 : Symbol(type2, Decl(contextualTypeShouldBeLiteral.ts, 38, 6)) + + value: 'done', +>value : Symbol(value, Decl(contextualTypeShouldBeLiteral.ts, 39, 15)) + + method() { +>method : Symbol(method, Decl(contextualTypeShouldBeLiteral.ts, 40, 18)) + + this; + this.value; +>this.value : Symbol(value, Decl(contextualTypeShouldBeLiteral.ts, 25, 15), Decl(contextualTypeShouldBeLiteral.ts, 31, 15)) +>value : Symbol(value, Decl(contextualTypeShouldBeLiteral.ts, 25, 15), Decl(contextualTypeShouldBeLiteral.ts, 31, 15)) + } +}); + +interface X3 { +>X3 : Symbol(X3, Decl(contextualTypeShouldBeLiteral.ts, 45, 3)) + + type: 'x'; +>type : Symbol(X3.type, Decl(contextualTypeShouldBeLiteral.ts, 47, 14)) + + value: 1 | 2 | 3; +>value : Symbol(X3.value, Decl(contextualTypeShouldBeLiteral.ts, 48, 14)) + + xtra: number; +>xtra : Symbol(X3.xtra, Decl(contextualTypeShouldBeLiteral.ts, 49, 21)) +} + +interface Y3 { +>Y3 : Symbol(Y3, Decl(contextualTypeShouldBeLiteral.ts, 51, 1)) + + type: 'y'; +>type : Symbol(Y3.type, Decl(contextualTypeShouldBeLiteral.ts, 53, 14)) + + value: 11 | 12 | 13; +>value : Symbol(Y3.value, Decl(contextualTypeShouldBeLiteral.ts, 54, 14)) + + ytra: number; +>ytra : Symbol(Y3.ytra, Decl(contextualTypeShouldBeLiteral.ts, 55, 24)) +} + +let xy: X3 | Y3 = { +>xy : Symbol(xy, Decl(contextualTypeShouldBeLiteral.ts, 59, 3)) +>X3 : Symbol(X3, Decl(contextualTypeShouldBeLiteral.ts, 45, 3)) +>Y3 : Symbol(Y3, Decl(contextualTypeShouldBeLiteral.ts, 51, 1)) + + type: 'y', +>type : Symbol(type, Decl(contextualTypeShouldBeLiteral.ts, 59, 19)) + + value: 11, +>value : Symbol(value, Decl(contextualTypeShouldBeLiteral.ts, 60, 14)) + + ytra: 12 +>ytra : Symbol(ytra, Decl(contextualTypeShouldBeLiteral.ts, 61, 14)) + +}; + +xy; +>xy : Symbol(xy, Decl(contextualTypeShouldBeLiteral.ts, 59, 3)) + + +interface LikeA { +>LikeA : Symbol(LikeA, Decl(contextualTypeShouldBeLiteral.ts, 65, 3)) + + x: 'x'; +>x : Symbol(LikeA.x, Decl(contextualTypeShouldBeLiteral.ts, 68, 17)) + + y: 'y'; +>y : Symbol(LikeA.y, Decl(contextualTypeShouldBeLiteral.ts, 69, 11)) + + value: string; +>value : Symbol(LikeA.value, Decl(contextualTypeShouldBeLiteral.ts, 70, 11)) + + method(): void; +>method : Symbol(LikeA.method, Decl(contextualTypeShouldBeLiteral.ts, 71, 18)) +} + +interface LikeB { +>LikeB : Symbol(LikeB, Decl(contextualTypeShouldBeLiteral.ts, 73, 1)) + + x: 'xx'; +>x : Symbol(LikeB.x, Decl(contextualTypeShouldBeLiteral.ts, 75, 17)) + + y: 'yy'; +>y : Symbol(LikeB.y, Decl(contextualTypeShouldBeLiteral.ts, 76, 12)) + + value: number; +>value : Symbol(LikeB.value, Decl(contextualTypeShouldBeLiteral.ts, 77, 12)) + + method(): void; +>method : Symbol(LikeB.method, Decl(contextualTypeShouldBeLiteral.ts, 78, 18)) +} + +let xyz: LikeA | LikeB = { +>xyz : Symbol(xyz, Decl(contextualTypeShouldBeLiteral.ts, 82, 3)) +>LikeA : Symbol(LikeA, Decl(contextualTypeShouldBeLiteral.ts, 65, 3)) +>LikeB : Symbol(LikeB, Decl(contextualTypeShouldBeLiteral.ts, 73, 1)) + + x: 'x', +>x : Symbol(x, Decl(contextualTypeShouldBeLiteral.ts, 82, 26)) + + y: 'y', +>y : Symbol(y, Decl(contextualTypeShouldBeLiteral.ts, 83, 11)) + + value: "foo", +>value : Symbol(value, Decl(contextualTypeShouldBeLiteral.ts, 84, 11)) + + method() { +>method : Symbol(method, Decl(contextualTypeShouldBeLiteral.ts, 85, 17)) + + this; +>this : Symbol(LikeA, Decl(contextualTypeShouldBeLiteral.ts, 65, 3)) + + this.x; +>this.x : Symbol(LikeA.x, Decl(contextualTypeShouldBeLiteral.ts, 68, 17)) +>this : Symbol(LikeA, Decl(contextualTypeShouldBeLiteral.ts, 65, 3)) +>x : Symbol(LikeA.x, Decl(contextualTypeShouldBeLiteral.ts, 68, 17)) + + this.y; +>this.y : Symbol(LikeA.y, Decl(contextualTypeShouldBeLiteral.ts, 69, 11)) +>this : Symbol(LikeA, Decl(contextualTypeShouldBeLiteral.ts, 65, 3)) +>y : Symbol(LikeA.y, Decl(contextualTypeShouldBeLiteral.ts, 69, 11)) + + this.value; +>this.value : Symbol(LikeA.value, Decl(contextualTypeShouldBeLiteral.ts, 70, 11)) +>this : Symbol(LikeA, Decl(contextualTypeShouldBeLiteral.ts, 65, 3)) +>value : Symbol(LikeA.value, Decl(contextualTypeShouldBeLiteral.ts, 70, 11)) + } +}; + +xyz; +>xyz : Symbol(xyz, Decl(contextualTypeShouldBeLiteral.ts, 82, 3)) + diff --git a/tests/baselines/reference/contextualTypeShouldBeLiteral.types b/tests/baselines/reference/contextualTypeShouldBeLiteral.types new file mode 100644 index 0000000000000..20c3e2d3ea404 --- /dev/null +++ b/tests/baselines/reference/contextualTypeShouldBeLiteral.types @@ -0,0 +1,248 @@ +=== tests/cases/compiler/contextualTypeShouldBeLiteral.ts === +interface X { +>X : X + + type: 'x'; +>type : "x" + + value: string; +>value : string + + method(): void; +>method : () => void +} + +interface Y { +>Y : Y + + type: 'y'; +>type : "y" + + value: 'none' | 'done'; +>value : "none" | "done" + + method(): void; +>method : () => void +} + +function foo(bar: X | Y) { } +>foo : (bar: X | Y) => void +>bar : X | Y +>X : X +>Y : Y + +foo({ +>foo({ type: 'y', value: 'done', method() { this; this.type; this.value; }}) : void +>foo : (bar: X | Y) => void +>{ type: 'y', value: 'done', method() { this; this.type; this.value; }} : { type: "y"; value: "done"; method(): void; } + + type: 'y', +>type : string +>'y' : "y" + + value: 'done', +>value : string +>'done' : "done" + + method() { +>method : () => void + + this; +>this : Y + + this.type; +>this.type : "y" +>this : Y +>type : "y" + + this.value; +>this.value : "none" | "done" +>this : Y +>value : "none" | "done" + } +}); + +interface X2 { +>X2 : X2 + + type1: 'x'; +>type1 : "x" + + value: string; +>value : string + + method(): void; +>method : () => void +} + +interface Y2 { +>Y2 : Y2 + + type2: 'y'; +>type2 : "y" + + value: 'none' | 'done'; +>value : "none" | "done" + + method(): void; +>method : () => void +} + +function foo2(bar: X2 | Y2) { } +>foo2 : (bar: X2 | Y2) => void +>bar : X2 | Y2 +>X2 : X2 +>Y2 : Y2 + +foo2({ +>foo2({ type2: 'y', value: 'done', method() { this; this.value; }}) : void +>foo2 : (bar: X2 | Y2) => void +>{ type2: 'y', value: 'done', method() { this; this.value; }} : { type2: "y"; value: "done"; method(): void; } + + type2: 'y', +>type2 : string +>'y' : "y" + + value: 'done', +>value : string +>'done' : "done" + + method() { +>method : () => void + + this; +>this : X2 | Y2 + + this.value; +>this.value : string +>this : X2 | Y2 +>value : string + } +}); + +interface X3 { +>X3 : X3 + + type: 'x'; +>type : "x" + + value: 1 | 2 | 3; +>value : 1 | 2 | 3 + + xtra: number; +>xtra : number +} + +interface Y3 { +>Y3 : Y3 + + type: 'y'; +>type : "y" + + value: 11 | 12 | 13; +>value : 11 | 12 | 13 + + ytra: number; +>ytra : number +} + +let xy: X3 | Y3 = { +>xy : X3 | Y3 +>X3 : X3 +>Y3 : Y3 +>{ type: 'y', value: 11, ytra: 12} : { type: "y"; value: 11; ytra: 12; } + + type: 'y', +>type : string +>'y' : "y" + + value: 11, +>value : number +>11 : 11 + + ytra: 12 +>ytra : number +>12 : 12 + +}; + +xy; +>xy : Y3 + + +interface LikeA { +>LikeA : LikeA + + x: 'x'; +>x : "x" + + y: 'y'; +>y : "y" + + value: string; +>value : string + + method(): void; +>method : () => void +} + +interface LikeB { +>LikeB : LikeB + + x: 'xx'; +>x : "xx" + + y: 'yy'; +>y : "yy" + + value: number; +>value : number + + method(): void; +>method : () => void +} + +let xyz: LikeA | LikeB = { +>xyz : LikeA | LikeB +>LikeA : LikeA +>LikeB : LikeB +>{ x: 'x', y: 'y', value: "foo", method() { this; this.x; this.y; this.value; }} : { x: "x"; y: "y"; value: "foo"; method(): void; } + + x: 'x', +>x : string +>'x' : "x" + + y: 'y', +>y : string +>'y' : "y" + + value: "foo", +>value : string +>"foo" : "foo" + + method() { +>method : () => void + + this; +>this : LikeA + + this.x; +>this.x : "x" +>this : LikeA +>x : "x" + + this.y; +>this.y : "y" +>this : LikeA +>y : "y" + + this.value; +>this.value : string +>this : LikeA +>value : string + } +}; + +xyz; +>xyz : LikeA + diff --git a/tests/baselines/reference/contextualTypeWithTuple.errors.txt b/tests/baselines/reference/contextualTypeWithTuple.errors.txt index 58a90919c5b29..516a8c0684939 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.errors.txt +++ b/tests/baselines/reference/contextualTypeWithTuple.errors.txt @@ -1,13 +1,15 @@ -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[5, "foo", boolean]' is not assignable to type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(15,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(18,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. + Types of property 'length' are incompatible. + Type '3' is not assignable to type '2'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(18,1): error TS2322: Type '[{}, 5]' is not assignable to type '[{ a: string; }, number]'. Type '{}' is not assignable to type '{ a: string; }'. Property 'a' is missing in type '{}'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(19,1): error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]'. Property '2' is missing in type '[number, string]'. -tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(20,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. +tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(20,5): error TS2322: Type '["foo", "bar", number]' is not assignable to type '[string, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(23,1): error TS2322: Type '[C, string | number, D]' is not assignable to type '[C, string | number]'. @@ -25,7 +27,7 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23 var numStrTuple: [number, string] = [5, "hello"]; var numStrTuple2: [number, string] = [5, "foo", true]; ~~~~~~~~~~~~ -!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +!!! error TS2322: Type '[5, "foo", boolean]' is not assignable to type '[number, string]'. !!! error TS2322: Types of property 'length' are incompatible. !!! error TS2322: Type '3' is not assignable to type '2'. var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; @@ -42,11 +44,13 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23 numStrTuple = numStrBoolTuple; ~~~~~~~~~~~ !!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'. +!!! error TS2322: Types of property 'length' are incompatible. +!!! error TS2322: Type '3' is not assignable to type '2'. // error objNumTuple = [ {}, 5]; ~~~~~~~~~~~ -!!! error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'. +!!! error TS2322: Type '[{}, 5]' is not assignable to type '[{ a: string; }, number]'. !!! error TS2322: Type '{}' is not assignable to type '{ a: string; }'. !!! error TS2322: Property 'a' is missing in type '{}'. numStrBoolTuple = numStrTuple; @@ -55,7 +59,7 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23 !!! error TS2322: Property '2' is missing in type '[number, string]'. var strStrTuple: [string, string] = ["foo", "bar", 5]; ~~~~~~~~~~~ -!!! error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]'. +!!! error TS2322: Type '["foo", "bar", number]' is not assignable to type '[string, string]'. !!! error TS2322: Types of property 'length' are incompatible. !!! error TS2322: Type '3' is not assignable to type '2'. diff --git a/tests/baselines/reference/contextualTypeWithTuple.types b/tests/baselines/reference/contextualTypeWithTuple.types index ddc683739c8b5..0e9f70a83b5e8 100644 --- a/tests/baselines/reference/contextualTypeWithTuple.types +++ b/tests/baselines/reference/contextualTypeWithTuple.types @@ -2,20 +2,20 @@ // no error var numStrTuple: [number, string] = [5, "hello"]; >numStrTuple : [number, string] ->[5, "hello"] : [number, string] +>[5, "hello"] : [5, "hello"] >5 : 5 >"hello" : "hello" var numStrTuple2: [number, string] = [5, "foo", true]; >numStrTuple2 : [number, string] ->[5, "foo", true] : [number, string, boolean] +>[5, "foo", true] : [5, "foo", boolean] >5 : 5 >"foo" : "foo" >true : true var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; >numStrBoolTuple : [number, string, boolean] ->[5, "foo", true] : [number, string, true] +>[5, "foo", true] : [5, "foo", true] >5 : 5 >"foo" : "foo" >true : true @@ -23,17 +23,17 @@ var numStrBoolTuple: [number, string, boolean] = [5, "foo", true]; var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5]; >objNumTuple : [{ a: string; }, number] >a : string ->[{ a: "world" }, 5] : [{ a: string; }, number] ->{ a: "world" } : { a: string; } +>[{ a: "world" }, 5] : [{ a: "world"; }, 5] +>{ a: "world" } : { a: "world"; } >a : string >"world" : "world" >5 : 5 var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]]; >strTupleTuple : [string, [number, {}]] ->["bar", [5, { x: 1, y: 1 }]] : [string, [number, { x: number; y: number; }]] +>["bar", [5, { x: 1, y: 1 }]] : ["bar", [5, { x: number; y: number; }]] >"bar" : "bar" ->[5, { x: 1, y: 1 }] : [number, { x: number; y: number; }] +>[5, { x: 1, y: 1 }] : [5, { x: number; y: number; }] >5 : 5 >{ x: 1, y: 1 } : { x: number; y: number; } >x : number @@ -50,7 +50,7 @@ class D { } var unionTuple: [C, string | number] = [new C(), "foo"]; >unionTuple : [C, string | number] >C : C ->[new C(), "foo"] : [C, string] +>[new C(), "foo"] : [C, "foo"] >new C() : C >C : typeof C >"foo" : "foo" @@ -58,7 +58,7 @@ var unionTuple: [C, string | number] = [new C(), "foo"]; var unionTuple1: [C, string | number] = [new C(), "foo"]; >unionTuple1 : [C, string | number] >C : C ->[new C(), "foo"] : [C, string] +>[new C(), "foo"] : [C, "foo"] >new C() : C >C : typeof C >"foo" : "foo" @@ -67,7 +67,7 @@ var unionTuple2: [C, string | number, D] = [new C(), "foo", new D()]; >unionTuple2 : [C, string | number, D] >C : C >D : D ->[new C(), "foo", new D()] : [C, string, D] +>[new C(), "foo", new D()] : [C, "foo", D] >new C() : C >C : typeof C >"foo" : "foo" @@ -76,7 +76,7 @@ var unionTuple2: [C, string | number, D] = [new C(), "foo", new D()]; var unionTuple3: [number, string| number] = [10, "foo"]; >unionTuple3 : [number, string | number] ->[10, "foo"] : [number, string] +>[10, "foo"] : [10, "foo"] >10 : 10 >"foo" : "foo" @@ -92,9 +92,9 @@ numStrTuple = numStrBoolTuple; // error objNumTuple = [ {}, 5]; ->objNumTuple = [ {}, 5] : [{}, number] +>objNumTuple = [ {}, 5] : [{}, 5] >objNumTuple : [{ a: string; }, number] ->[ {}, 5] : [{}, number] +>[ {}, 5] : [{}, 5] >{} : {} >5 : 5 @@ -105,7 +105,7 @@ numStrBoolTuple = numStrTuple; var strStrTuple: [string, string] = ["foo", "bar", 5]; >strStrTuple : [string, string] ->["foo", "bar", 5] : [string, string, number] +>["foo", "bar", 5] : ["foo", "bar", number] >"foo" : "foo" >"bar" : "bar" >5 : 5 diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types index 97c5f0fdf9035..8b6aa4cc84dac 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeIndexSignatures.types @@ -89,7 +89,7 @@ var x: IWithNoStringIndexSignature | IWithStringIndexSignature1 = { foo: "hello" >x : IWithNoStringIndexSignature | IWithStringIndexSignature1 >IWithNoStringIndexSignature : IWithNoStringIndexSignature >IWithStringIndexSignature1 : IWithStringIndexSignature1 ->{ foo: "hello" } : { foo: string; } +>{ foo: "hello" } : { foo: "hello"; } >foo : string >"hello" : "hello" @@ -142,7 +142,7 @@ var x3: IWithNoNumberIndexSignature | IWithNumberIndexSignature1 = { 0: "hello" >x3 : IWithNoNumberIndexSignature | IWithNumberIndexSignature1 >IWithNoNumberIndexSignature : IWithNoNumberIndexSignature >IWithNumberIndexSignature1 : IWithNumberIndexSignature1 ->{ 0: "hello" } : { 0: string; } +>{ 0: "hello" } : { 0: "hello"; } >"hello" : "hello" var x4: IWithNumberIndexSignature1 | IWithNumberIndexSignature2 = { 1: a => a.toString() }; // a should be number diff --git a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types index 3d13b94bc5942..ec4f239e4d3c6 100644 --- a/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types +++ b/tests/baselines/reference/contextualTypeWithUnionTypeMembers.types @@ -76,7 +76,7 @@ var i1Ori2: I1 | I2 = { // Like i1 >i1Ori2 : I1 | I2 >I1 : I1 >I2 : I2 ->{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; } +>{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello",} : { commonPropertyType: "hello"; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: "Hello"; } commonPropertyType: "hello", >commonPropertyType : string @@ -109,7 +109,7 @@ var i1Ori2: I1 | I2 = { // Like i2 >i1Ori2 : I1 | I2 >I1 : I1 >I2 : I2 ->{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } +>{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello",} : { commonPropertyType: "hello"; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: "Hello"; } commonPropertyType: "hello", >commonPropertyType : string @@ -142,7 +142,7 @@ var i1Ori2: I1 | I2 = { // Like i1 and i2 both >i1Ori2 : I1 | I2 >I1 : I1 >I2 : I2 ->{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello",} : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } +>{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello",} : { commonPropertyType: "hello"; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: "Hello"; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: "Hello"; } commonPropertyType: "hello", >commonPropertyType : string @@ -187,10 +187,10 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 >Array : T[] >I1 : I1 >I2 : I2 ->[i1, i2, { // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", }, { // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }, { // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }] : (I1 | I2 | { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; })[] +>[i1, i2, { // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", }, { // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }, { // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", }] : (I1 | I2 | { commonPropertyType: "hello"; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: "Hello"; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: "Hello"; })[] >i1 : I1 >i2 : I2 ->{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; } +>{ // Like i1 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", } : { commonPropertyType: "hello"; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: "Hello"; } commonPropertyType: "hello", >commonPropertyType : string @@ -220,7 +220,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 }, { // Like i2 ->{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } +>{ // Like i2 commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: "hello"; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: "Hello"; } commonPropertyType: "hello", >commonPropertyType : string @@ -249,7 +249,7 @@ var arrayI1OrI2: Array | I2> = [i1, i2, { // Like i1 >"Hello" : "Hello" }, { // Like i1 and i2 both ->{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: string; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: string; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: string; } +>{ // Like i1 and i2 both commonPropertyType: "hello", commonMethodType: a=> a, commonMethodWithTypeParameter: a => a, methodOnlyInI1: a => a, propertyOnlyInI1: "Hello", methodOnlyInI2: a => a, propertyOnlyInI2: "Hello", } : { commonPropertyType: "hello"; commonMethodType: (a: string) => string; commonMethodWithTypeParameter: (a: number) => number; methodOnlyInI1: (a: string) => string; propertyOnlyInI1: "Hello"; methodOnlyInI2: (a: string) => string; propertyOnlyInI2: "Hello"; } commonPropertyType: "hello", >commonPropertyType : string @@ -335,7 +335,7 @@ var i11Ori21: I11 | I21 = { >i11Ori21 : I11 | I21 >I11 : I11 >I21 : I21 ->{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: string; } +>{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: "hello"; } // Like i1 commonMethodDifferentReturnType: (a, b) => { @@ -365,7 +365,7 @@ var i11Ori21: I11 | I21 = { >i11Ori21 : I11 | I21 >I11 : I11 >I21 : I21 ->{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10,} : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } +>{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10,} : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: 10; } // Like i2 commonMethodDifferentReturnType: (a, b) => { @@ -402,7 +402,7 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { >i11 || i21 : I11 | I21 >i11 : I11 >i21 : I21 ->{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: string; } +>{ // Like i1 commonMethodDifferentReturnType: (a, b) => { var z = a.charAt(b); return z; }, commonPropertyDifferentType: "hello", } : { commonMethodDifferentReturnType: (a: string, b: number) => string; commonPropertyDifferentType: "hello"; } // Like i1 commonMethodDifferentReturnType: (a, b) => { @@ -428,7 +428,7 @@ var arrayOrI11OrI21: Array = [i11, i21, i11 || i21, { >"hello" : "hello" }, { ->{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, } : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: number; } +>{ // Like i2 commonMethodDifferentReturnType: (a, b) => { var z = a.charCodeAt(b); return z; }, commonPropertyDifferentType: 10, } : { commonMethodDifferentReturnType: (a: string, b: number) => number; commonPropertyDifferentType: 10; } // Like i2 commonMethodDifferentReturnType: (a, b) => { diff --git a/tests/baselines/reference/contextualTyping.types b/tests/baselines/reference/contextualTyping.types index c2379425e1e4f..83b1704464d45 100644 --- a/tests/baselines/reference/contextualTyping.types +++ b/tests/baselines/reference/contextualTyping.types @@ -71,8 +71,8 @@ var c3t2 = ({ >c3t2 : IFoo >({ n: 1}) : IFoo >IFoo : IFoo ->({ n: 1}) : { n: number; } ->{ n: 1} : { n: number; } +>({ n: 1}) : { n: 1; } +>{ n: 1} : { n: 1; } n: 1 >n : number @@ -284,8 +284,8 @@ c7t2[0] = ({n: 1}); >0 : 0 >({n: 1}) : IFoo >IFoo : IFoo ->({n: 1}) : { n: number; } ->{n: 1} : { n: number; } +>({n: 1}) : { n: 1; } +>{n: 1} : { n: 1; } >n : number >1 : 1 @@ -448,8 +448,8 @@ objc8.t2 = ({ >t2 : IFoo >({ n: 1}) : IFoo >IFoo : IFoo ->({ n: 1}) : { n: number; } ->{ n: 1} : { n: number; } +>({ n: 1}) : { n: 1; } +>{ n: 1} : { n: 1; } n: 1 >n : number @@ -665,8 +665,8 @@ var c12t2 = ({ >c12t2 : IFoo > ({ n: 1}) : IFoo >IFoo : IFoo ->({ n: 1}) : { n: number; } ->{ n: 1} : { n: number; } +>({ n: 1}) : { n: 1; } +>{ n: 1} : { n: 1; } n: 1 >n : number @@ -921,11 +921,11 @@ Point.prototype.add = function(dx, dy) { }; Point.prototype = { ->Point.prototype = { x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: number, dy: number) => Point; } +>Point.prototype = { x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: 0; y: 0; add: (dx: number, dy: number) => Point; } >Point.prototype : Point >Point : typeof Point >prototype : Point ->{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: number, dy: number) => Point; } +>{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: 0; y: 0; add: (dx: number, dy: number) => Point; } x: 0, >x : number diff --git a/tests/baselines/reference/contextualTyping1.types b/tests/baselines/reference/contextualTyping1.types index 1f300311e944a..481786980707c 100644 --- a/tests/baselines/reference/contextualTyping1.types +++ b/tests/baselines/reference/contextualTyping1.types @@ -2,7 +2,7 @@ var foo: {id:number;} = {id:4}; >foo : { id: number; } >id : number ->{id:4} : { id: number; } +>{id:4} : { id: 4; } >id : number >4 : 4 diff --git a/tests/baselines/reference/contextualTyping10.types b/tests/baselines/reference/contextualTyping10.types index 6379d6f82aa13..50a66de7c1aad 100644 --- a/tests/baselines/reference/contextualTyping10.types +++ b/tests/baselines/reference/contextualTyping10.types @@ -3,11 +3,11 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2}]; } >foo : foo >bar : { id: number; }[] >id : number ->[{id:1}, {id:2}] : { id: number; }[] ->{id:1} : { id: number; } +>[{id:1}, {id:2}] : ({ id: 1; } | { id: 2; })[] +>{id:1} : { id: 1; } >id : number >1 : 1 ->{id:2} : { id: number; } +>{id:2} : { id: 2; } >id : number >2 : 2 diff --git a/tests/baselines/reference/contextualTyping12.errors.txt b/tests/baselines/reference/contextualTyping12.errors.txt index 22ed6ad931e3b..7c082ae5e899c 100644 --- a/tests/baselines/reference/contextualTyping12.errors.txt +++ b/tests/baselines/reference/contextualTyping12.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/contextualTyping12.ts(1,57): error TS2322: Type '({ id: number; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'. - Type '{ id: number; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'. - Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +tests/cases/compiler/contextualTyping12.ts(1,57): error TS2322: Type '({ id: 1; } | { id: 2; name: string; })[]' is not assignable to type '{ id: number; }[]'. + Type '{ id: 1; } | { id: 2; name: string; }' is not assignable to type '{ id: number; }'. + Type '{ id: 2; name: string; }' is not assignable to type '{ id: number; }'. Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== tests/cases/compiler/contextualTyping12.ts (1 errors) ==== class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } ~~~~~~~~~~ -!!! error TS2322: Type '({ id: number; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'. -!!! error TS2322: Type '{ id: number; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '({ id: 1; } | { id: 2; name: string; })[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type '{ id: 1; } | { id: 2; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '{ id: 2; name: string; }' is not assignable to type '{ id: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping12.types b/tests/baselines/reference/contextualTyping12.types index d4da0d519eae2..b45b8a41d8109 100644 --- a/tests/baselines/reference/contextualTyping12.types +++ b/tests/baselines/reference/contextualTyping12.types @@ -3,11 +3,11 @@ class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; } >foo : foo >bar : { id: number; }[] >id : number ->[{id:1}, {id:2, name:"foo"}] : ({ id: number; } | { id: number; name: string; })[] ->{id:1} : { id: number; } +>[{id:1}, {id:2, name:"foo"}] : ({ id: 1; } | { id: 2; name: string; })[] +>{id:1} : { id: 1; } >id : number >1 : 1 ->{id:2, name:"foo"} : { id: number; name: string; } +>{id:2, name:"foo"} : { id: 2; name: string; } >id : number >2 : 2 >name : string diff --git a/tests/baselines/reference/contextualTyping16.types b/tests/baselines/reference/contextualTyping16.types index 6eded1712c1b0..50c24b04f0b7e 100644 --- a/tests/baselines/reference/contextualTyping16.types +++ b/tests/baselines/reference/contextualTyping16.types @@ -2,12 +2,12 @@ var foo: {id:number;} = {id:4}; foo = {id:5}; >foo : { id: number; } >id : number ->{id:4} : { id: number; } +>{id:4} : { id: 4; } >id : number >4 : 4 ->foo = {id:5} : { id: number; } +>foo = {id:5} : { id: 5; } >foo : { id: number; } ->{id:5} : { id: number; } +>{id:5} : { id: 5; } >id : number >5 : 5 diff --git a/tests/baselines/reference/contextualTyping17.errors.txt b/tests/baselines/reference/contextualTyping17.errors.txt index b6375c9c9c954..c951aacb7dfce 100644 --- a/tests/baselines/reference/contextualTyping17.errors.txt +++ b/tests/baselines/reference/contextualTyping17.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping17.ts(1,47): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +tests/cases/compiler/contextualTyping17.ts(1,47): error TS2322: Type '{ id: 5; name: string; }' is not assignable to type '{ id: number; }'. Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== tests/cases/compiler/contextualTyping17.ts (1 errors) ==== var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; ~~~~~~~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '{ id: 5; name: string; }' is not assignable to type '{ id: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping17.types b/tests/baselines/reference/contextualTyping17.types index 2f4d99353bc02..b3cb1e25ba621 100644 --- a/tests/baselines/reference/contextualTyping17.types +++ b/tests/baselines/reference/contextualTyping17.types @@ -2,12 +2,12 @@ var foo: {id:number;} = {id:4}; foo = {id: 5, name:"foo"}; >foo : { id: number; } >id : number ->{id:4} : { id: number; } +>{id:4} : { id: 4; } >id : number >4 : 4 ->foo = {id: 5, name:"foo"} : { id: number; name: string; } +>foo = {id: 5, name:"foo"} : { id: 5; name: string; } >foo : { id: number; } ->{id: 5, name:"foo"} : { id: number; name: string; } +>{id: 5, name:"foo"} : { id: 5; name: string; } >id : number >5 : 5 >name : string diff --git a/tests/baselines/reference/contextualTyping18.types b/tests/baselines/reference/contextualTyping18.types index 3d5ee402828a1..737b9ee1e75e5 100644 --- a/tests/baselines/reference/contextualTyping18.types +++ b/tests/baselines/reference/contextualTyping18.types @@ -6,9 +6,9 @@ var foo: {id:number;} = <{id:number;}>({ }); foo = {id: 5}; >id : number >({ }) : {} >{ } : {} ->foo = {id: 5} : { id: number; } +>foo = {id: 5} : { id: 5; } >foo : { id: number; } ->{id: 5} : { id: number; } +>{id: 5} : { id: 5; } >id : number >5 : 5 diff --git a/tests/baselines/reference/contextualTyping19.types b/tests/baselines/reference/contextualTyping19.types index c5ad59fa61bee..b93fb68d45104 100644 --- a/tests/baselines/reference/contextualTyping19.types +++ b/tests/baselines/reference/contextualTyping19.types @@ -2,17 +2,17 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2}]; >foo : { id: number; }[] >id : number ->[{id:1}] : { id: number; }[] ->{id:1} : { id: number; } +>[{id:1}] : { id: 1; }[] +>{id:1} : { id: 1; } >id : number >1 : 1 ->foo = [{id:1}, {id:2}] : { id: number; }[] +>foo = [{id:1}, {id:2}] : ({ id: 1; } | { id: 2; })[] >foo : { id: number; }[] ->[{id:1}, {id:2}] : { id: number; }[] ->{id:1} : { id: number; } +>[{id:1}, {id:2}] : ({ id: 1; } | { id: 2; })[] +>{id:1} : { id: 1; } >id : number >1 : 1 ->{id:2} : { id: number; } +>{id:2} : { id: 2; } >id : number >2 : 2 diff --git a/tests/baselines/reference/contextualTyping2.errors.txt b/tests/baselines/reference/contextualTyping2.errors.txt index 1daa4a2a71f0d..7f16b6a372fba 100644 --- a/tests/baselines/reference/contextualTyping2.errors.txt +++ b/tests/baselines/reference/contextualTyping2.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping2.ts(1,32): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +tests/cases/compiler/contextualTyping2.ts(1,32): error TS2322: Type '{ id: 4; name: string; }' is not assignable to type '{ id: number; }'. Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== tests/cases/compiler/contextualTyping2.ts (1 errors) ==== var foo: {id:number;} = {id:4, name:"foo"}; ~~~~~~~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '{ id: 4; name: string; }' is not assignable to type '{ id: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping2.types b/tests/baselines/reference/contextualTyping2.types index 3cd1231119351..acbaa55759738 100644 --- a/tests/baselines/reference/contextualTyping2.types +++ b/tests/baselines/reference/contextualTyping2.types @@ -2,7 +2,7 @@ var foo: {id:number;} = {id:4, name:"foo"}; >foo : { id: number; } >id : number ->{id:4, name:"foo"} : { id: number; name: string; } +>{id:4, name:"foo"} : { id: 4; name: string; } >id : number >4 : 4 >name : string diff --git a/tests/baselines/reference/contextualTyping20.errors.txt b/tests/baselines/reference/contextualTyping20.errors.txt index a9112f1db84d1..7ee5315a78f1d 100644 --- a/tests/baselines/reference/contextualTyping20.errors.txt +++ b/tests/baselines/reference/contextualTyping20.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/contextualTyping20.ts(1,58): error TS2322: Type '({ id: number; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'. - Type '{ id: number; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'. - Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +tests/cases/compiler/contextualTyping20.ts(1,58): error TS2322: Type '({ id: 1; } | { id: 2; name: string; })[]' is not assignable to type '{ id: number; }[]'. + Type '{ id: 1; } | { id: 2; name: string; }' is not assignable to type '{ id: number; }'. + Type '{ id: 2; name: string; }' is not assignable to type '{ id: number; }'. Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== tests/cases/compiler/contextualTyping20.ts (1 errors) ==== var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; ~~~~~~~~~~ -!!! error TS2322: Type '({ id: number; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'. -!!! error TS2322: Type '{ id: number; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '({ id: 1; } | { id: 2; name: string; })[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type '{ id: 1; } | { id: 2; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '{ id: 2; name: string; }' is not assignable to type '{ id: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping20.types b/tests/baselines/reference/contextualTyping20.types index 83e7801a76aa5..1efa714d5c663 100644 --- a/tests/baselines/reference/contextualTyping20.types +++ b/tests/baselines/reference/contextualTyping20.types @@ -2,17 +2,17 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, {id:2, name:"foo"}]; >foo : { id: number; }[] >id : number ->[{id:1}] : { id: number; }[] ->{id:1} : { id: number; } +>[{id:1}] : { id: 1; }[] +>{id:1} : { id: 1; } >id : number >1 : 1 ->foo = [{id:1}, {id:2, name:"foo"}] : ({ id: number; } | { id: number; name: string; })[] +>foo = [{id:1}, {id:2, name:"foo"}] : ({ id: 1; } | { id: 2; name: string; })[] >foo : { id: number; }[] ->[{id:1}, {id:2, name:"foo"}] : ({ id: number; } | { id: number; name: string; })[] ->{id:1} : { id: number; } +>[{id:1}, {id:2, name:"foo"}] : ({ id: 1; } | { id: 2; name: string; })[] +>{id:1} : { id: 1; } >id : number >1 : 1 ->{id:2, name:"foo"} : { id: number; name: string; } +>{id:2, name:"foo"} : { id: 2; name: string; } >id : number >2 : 2 >name : string diff --git a/tests/baselines/reference/contextualTyping21.errors.txt b/tests/baselines/reference/contextualTyping21.errors.txt index 0bac30d5b4462..6c805841a9750 100644 --- a/tests/baselines/reference/contextualTyping21.errors.txt +++ b/tests/baselines/reference/contextualTyping21.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. - Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. +tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: 1; })[]' is not assignable to type '{ id: number; }[]'. + Type 'number | { id: 1; }' is not assignable to type '{ id: number; }'. Type 'number' is not assignable to type '{ id: number; }'. ==== tests/cases/compiler/contextualTyping21.ts (1 errors) ==== var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; ~~~ -!!! error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'. -!!! error TS2322: Type 'number | { id: number; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '(number | { id: 1; })[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type 'number | { id: 1; }' is not assignable to type '{ id: number; }'. !!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping21.types b/tests/baselines/reference/contextualTyping21.types index 30c9820bd20cb..38b29a344cf19 100644 --- a/tests/baselines/reference/contextualTyping21.types +++ b/tests/baselines/reference/contextualTyping21.types @@ -2,14 +2,14 @@ var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1]; >foo : { id: number; }[] >id : number ->[{id:1}] : { id: number; }[] ->{id:1} : { id: number; } +>[{id:1}] : { id: 1; }[] +>{id:1} : { id: 1; } >id : number >1 : 1 ->foo = [{id:1}, 1] : (number | { id: number; })[] +>foo = [{id:1}, 1] : (number | { id: 1; })[] >foo : { id: number; }[] ->[{id:1}, 1] : (number | { id: number; })[] ->{id:1} : { id: number; } +>[{id:1}, 1] : (number | { id: 1; })[] +>{id:1} : { id: 1; } >id : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/contextualTyping23.types b/tests/baselines/reference/contextualTyping23.types index 351ee51c28d4c..605d0bd5c9d64 100644 --- a/tests/baselines/reference/contextualTyping23.types +++ b/tests/baselines/reference/contextualTyping23.types @@ -3,9 +3,9 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(a){return 5 >foo : (a: { (): number; (i: number): number; }) => number >a : { (): number; (i: number): number; } >i : number ->foo = function(a){return 5} : (a: { (): number; (i: number): number; }) => number +>foo = function(a){return 5} : (a: { (): number; (i: number): number; }) => 5 >foo : (a: { (): number; (i: number): number; }) => number ->function(a){return 5} : (a: { (): number; (i: number): number; }) => number +>function(a){return 5} : (a: { (): number; (i: number): number; }) => 5 >a : { (): number; (i: number): number; } >5 : 5 diff --git a/tests/baselines/reference/contextualTyping24.errors.txt b/tests/baselines/reference/contextualTyping24.errors.txt index ea97305062518..bafe2070bba79 100644 --- a/tests/baselines/reference/contextualTyping24.errors.txt +++ b/tests/baselines/reference/contextualTyping24.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(this: void, a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. +tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(this: void, a: string) => 5' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. Types of parameters 'a' and 'a' are incompatible. Type '{ (): number; (i: number): number; }' is not assignable to type 'string'. @@ -6,6 +6,6 @@ tests/cases/compiler/contextualTyping24.ts(1,55): error TS2322: Type '(this: voi ==== tests/cases/compiler/contextualTyping24.ts (1 errors) ==== var foo:(a:{():number; (i:number):number; })=>number; foo = function(this: void, a:string){return 5}; ~~~ -!!! error TS2322: Type '(this: void, a: string) => number' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. +!!! error TS2322: Type '(this: void, a: string) => 5' is not assignable to type '(a: { (): number; (i: number): number; }) => number'. !!! error TS2322: Types of parameters 'a' and 'a' are incompatible. !!! error TS2322: Type '{ (): number; (i: number): number; }' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping24.types b/tests/baselines/reference/contextualTyping24.types index 4d3f8cf1fb7aa..eca2125e38044 100644 --- a/tests/baselines/reference/contextualTyping24.types +++ b/tests/baselines/reference/contextualTyping24.types @@ -3,9 +3,9 @@ var foo:(a:{():number; (i:number):number; })=>number; foo = function(this: void, >foo : (a: { (): number; (i: number): number; }) => number >a : { (): number; (i: number): number; } >i : number ->foo = function(this: void, a:string){return 5} : (this: void, a: string) => number +>foo = function(this: void, a:string){return 5} : (this: void, a: string) => 5 >foo : (a: { (): number; (i: number): number; }) => number ->function(this: void, a:string){return 5} : (this: void, a: string) => number +>function(this: void, a:string){return 5} : (this: void, a: string) => 5 >this : void >a : string >5 : 5 diff --git a/tests/baselines/reference/contextualTyping28.types b/tests/baselines/reference/contextualTyping28.types index bf246ce5b723b..0308b0ef4f4a2 100644 --- a/tests/baselines/reference/contextualTyping28.types +++ b/tests/baselines/reference/contextualTyping28.types @@ -4,6 +4,6 @@ function foo(param:number[]){}; foo([1]); >param : number[] >foo([1]) : void >foo : (param: number[]) => void ->[1] : number[] +>[1] : 1[] >1 : 1 diff --git a/tests/baselines/reference/contextualTyping29.types b/tests/baselines/reference/contextualTyping29.types index ba96d77393ccb..93f5d43388eab 100644 --- a/tests/baselines/reference/contextualTyping29.types +++ b/tests/baselines/reference/contextualTyping29.types @@ -4,7 +4,7 @@ function foo(param:number[]){}; foo([1, 3]); >param : number[] >foo([1, 3]) : void >foo : (param: number[]) => void ->[1, 3] : number[] +>[1, 3] : (1 | 3)[] >1 : 1 >3 : 3 diff --git a/tests/baselines/reference/contextualTyping3.types b/tests/baselines/reference/contextualTyping3.types index c582cc0eb07af..b445905a9f459 100644 --- a/tests/baselines/reference/contextualTyping3.types +++ b/tests/baselines/reference/contextualTyping3.types @@ -3,7 +3,7 @@ class foo { public bar:{id:number;} = {id:5}; } >foo : foo >bar : { id: number; } >id : number ->{id:5} : { id: number; } +>{id:5} : { id: 5; } >id : number >5 : 5 diff --git a/tests/baselines/reference/contextualTyping30.errors.txt b/tests/baselines/reference/contextualTyping30.errors.txt index eda30769ac81d..3c125a5a38305 100644 --- a/tests/baselines/reference/contextualTyping30.errors.txt +++ b/tests/baselines/reference/contextualTyping30.errors.txt @@ -1,11 +1,11 @@ -tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number'. +tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type '(string | 1)[]' is not assignable to parameter of type 'number[]'. + Type 'string | 1' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. ==== tests/cases/compiler/contextualTyping30.ts (1 errors) ==== function foo(param:number[]){}; foo([1, "a"]); ~~~~~~~~ -!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number'. +!!! error TS2345: Argument of type '(string | 1)[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: Type 'string | 1' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping31.types b/tests/baselines/reference/contextualTyping31.types index 3b9da8bd4344f..77229d7ea5845 100644 --- a/tests/baselines/reference/contextualTyping31.types +++ b/tests/baselines/reference/contextualTyping31.types @@ -4,6 +4,6 @@ function foo(param:number[]){}; foo([1]); >param : number[] >foo([1]) : void >foo : (param: number[]) => void ->[1] : number[] +>[1] : 1[] >1 : 1 diff --git a/tests/baselines/reference/contextualTyping34.types b/tests/baselines/reference/contextualTyping34.types index 48dd3e41a66e5..1b4b00e8d2a97 100644 --- a/tests/baselines/reference/contextualTyping34.types +++ b/tests/baselines/reference/contextualTyping34.types @@ -3,8 +3,8 @@ var foo = <{ id: number;}> ({id:4}); >foo : { id: number; } ><{ id: number;}> ({id:4}) : { id: number; } >id : number ->({id:4}) : { id: number; } ->{id:4} : { id: number; } +>({id:4}) : { id: 4; } +>{id:4} : { id: 4; } >id : number >4 : 4 diff --git a/tests/baselines/reference/contextualTyping35.types b/tests/baselines/reference/contextualTyping35.types index 4465e0ca1a957..647adb7378273 100644 --- a/tests/baselines/reference/contextualTyping35.types +++ b/tests/baselines/reference/contextualTyping35.types @@ -3,7 +3,7 @@ var foo = <{ id: number;}> {id:4, name: "as"}; >foo : { id: number; } ><{ id: number;}> {id:4, name: "as"} : { id: number; } >id : number ->{id:4, name: "as"} : { id: number; name: string; } +>{id:4, name: "as"} : { id: 4; name: string; } >id : number >4 : 4 >name : string diff --git a/tests/baselines/reference/contextualTyping36.types b/tests/baselines/reference/contextualTyping36.types index 2cd07e33ee6ef..77c0a0124afd9 100644 --- a/tests/baselines/reference/contextualTyping36.types +++ b/tests/baselines/reference/contextualTyping36.types @@ -4,7 +4,7 @@ var foo = <{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })]; ><{ id: number; }[]>[{ id: 4 }, <{ id: number; }>({ })] : { id: number; }[] >id : number >[{ id: 4 }, <{ id: number; }>({ })] : { id: number; }[] ->{ id: 4 } : { id: number; } +>{ id: 4 } : { id: 4; } >id : number >4 : 4 ><{ id: number; }>({ }) : { id: number; } diff --git a/tests/baselines/reference/contextualTyping4.errors.txt b/tests/baselines/reference/contextualTyping4.errors.txt index c472e7ccb18d0..81479dee0791c 100644 --- a/tests/baselines/reference/contextualTyping4.errors.txt +++ b/tests/baselines/reference/contextualTyping4.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/contextualTyping4.ts(1,46): error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +tests/cases/compiler/contextualTyping4.ts(1,46): error TS2322: Type '{ id: 5; name: string; }' is not assignable to type '{ id: number; }'. Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== tests/cases/compiler/contextualTyping4.ts (1 errors) ==== class foo { public bar:{id:number;} = {id:5, name:"foo"}; } ~~~~~~~~~~ -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '{ id: 5; name: string; }' is not assignable to type '{ id: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping4.types b/tests/baselines/reference/contextualTyping4.types index a314dd5b21b3c..1d977a02599ac 100644 --- a/tests/baselines/reference/contextualTyping4.types +++ b/tests/baselines/reference/contextualTyping4.types @@ -3,7 +3,7 @@ class foo { public bar:{id:number;} = {id:5, name:"foo"}; } >foo : foo >bar : { id: number; } >id : number ->{id:5, name:"foo"} : { id: number; name: string; } +>{id:5, name:"foo"} : { id: 5; name: string; } >id : number >5 : 5 >name : string diff --git a/tests/baselines/reference/contextualTyping6.types b/tests/baselines/reference/contextualTyping6.types index 222212bdbf465..222b663a21e99 100644 --- a/tests/baselines/reference/contextualTyping6.types +++ b/tests/baselines/reference/contextualTyping6.types @@ -2,11 +2,11 @@ var foo:{id:number;}[] = [{id:1}, {id:2}]; >foo : { id: number; }[] >id : number ->[{id:1}, {id:2}] : { id: number; }[] ->{id:1} : { id: number; } +>[{id:1}, {id:2}] : ({ id: 1; } | { id: 2; })[] +>{id:1} : { id: 1; } >id : number >1 : 1 ->{id:2} : { id: number; } +>{id:2} : { id: 2; } >id : number >2 : 2 diff --git a/tests/baselines/reference/contextualTyping9.errors.txt b/tests/baselines/reference/contextualTyping9.errors.txt index 4a12574fa2110..5a1ac71fed6ba 100644 --- a/tests/baselines/reference/contextualTyping9.errors.txt +++ b/tests/baselines/reference/contextualTyping9.errors.txt @@ -1,13 +1,13 @@ -tests/cases/compiler/contextualTyping9.ts(1,42): error TS2322: Type '({ id: number; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'. - Type '{ id: number; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'. - Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +tests/cases/compiler/contextualTyping9.ts(1,42): error TS2322: Type '({ id: 1; } | { id: 2; name: string; })[]' is not assignable to type '{ id: number; }[]'. + Type '{ id: 1; } | { id: 2; name: string; }' is not assignable to type '{ id: number; }'. + Type '{ id: 2; name: string; }' is not assignable to type '{ id: number; }'. Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. ==== tests/cases/compiler/contextualTyping9.ts (1 errors) ==== var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; ~~~~~~~~~~ -!!! error TS2322: Type '({ id: number; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'. -!!! error TS2322: Type '{ id: number; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'. -!!! error TS2322: Type '{ id: number; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '({ id: 1; } | { id: 2; name: string; })[]' is not assignable to type '{ id: number; }[]'. +!!! error TS2322: Type '{ id: 1; } | { id: 2; name: string; }' is not assignable to type '{ id: number; }'. +!!! error TS2322: Type '{ id: 2; name: string; }' is not assignable to type '{ id: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'name' does not exist in type '{ id: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping9.types b/tests/baselines/reference/contextualTyping9.types index d009b35689e1c..eb9481cd866fa 100644 --- a/tests/baselines/reference/contextualTyping9.types +++ b/tests/baselines/reference/contextualTyping9.types @@ -2,11 +2,11 @@ var foo:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; >foo : { id: number; }[] >id : number ->[{id:1}, {id:2, name:"foo"}] : ({ id: number; } | { id: number; name: string; })[] ->{id:1} : { id: number; } +>[{id:1}, {id:2, name:"foo"}] : ({ id: 1; } | { id: 2; name: string; })[] +>{id:1} : { id: 1; } >id : number >1 : 1 ->{id:2, name:"foo"} : { id: number; name: string; } +>{id:2, name:"foo"} : { id: 2; name: string; } >id : number >2 : 2 >name : string diff --git a/tests/baselines/reference/contextualTypingOfOptionalMembers.types b/tests/baselines/reference/contextualTypingOfOptionalMembers.types index 515685f5c534d..d70ebab99dfce 100644 --- a/tests/baselines/reference/contextualTypingOfOptionalMembers.types +++ b/tests/baselines/reference/contextualTypingOfOptionalMembers.types @@ -45,7 +45,7 @@ declare function app>(obj: Optionsapp({ state: 100, actions: { foo: s => s // Should be typed number => number }, view: (s, a) => undefined as any,}) : void >app : >(obj: Options) => void ->{ state: 100, actions: { foo: s => s // Should be typed number => number }, view: (s, a) => undefined as any,} : { state: number; actions: { foo: (s: number) => number; }; view: (s: number, a: ActionsObject) => any; } +>{ state: 100, actions: { foo: s => s // Should be typed number => number }, view: (s, a) => undefined as any,} : { state: 100; actions: { foo: (s: number) => number; }; view: (s: number, a: ActionsObject) => any; } state: 100, >state : number @@ -136,7 +136,7 @@ declare function app2>(obj: Options2 app2({ >app2({ state: 100, actions: { foo: s => s // Should be typed number => number }, view: (s, a) => undefined as any,}) : void >app2 : >(obj: Options2) => void ->{ state: 100, actions: { foo: s => s // Should be typed number => number }, view: (s, a) => undefined as any,} : { state: number; actions: { foo: (s: number) => number; }; view: (s: number, a: ActionsObject) => any; } +>{ state: 100, actions: { foo: s => s // Should be typed number => number }, view: (s, a) => undefined as any,} : { state: 100; actions: { foo: (s: number) => number; }; view: (s: number, a: ActionsObject) => any; } state: 100, >state : number @@ -185,7 +185,7 @@ declare function app3>(obj: Optionsapp3({ state: 100, actions: [ s => s // Should be typed number => number ], view: (s, a) => undefined as any,}) : void >app3 : State)[]>(obj: Options) => void ->{ state: 100, actions: [ s => s // Should be typed number => number ], view: (s, a) => undefined as any,} : { state: number; actions: ((s: number) => number)[]; view: (s: number, a: ((state: number) => number)[]) => any; } +>{ state: 100, actions: [ s => s // Should be typed number => number ], view: (s, a) => undefined as any,} : { state: 100; actions: ((s: number) => number)[]; view: (s: number, a: ((state: number) => number)[]) => any; } state: 100, >state : number diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializer.types b/tests/baselines/reference/contextuallyTypedBindingInitializer.types index 4efd22a4c8426..fc8ff0816be7a 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializer.types +++ b/tests/baselines/reference/contextuallyTypedBindingInitializer.types @@ -69,7 +69,7 @@ interface Tuples { function g({ prop = ["hello", 1234] }: Tuples) {} >g : ({ prop }: Tuples) => void >prop : [string, number] ->["hello", 1234] : [string, number] +>["hello", 1234] : ["hello", 1234] >"hello" : "hello" >1234 : 1234 >Tuples : Tuples diff --git a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types index 1548e626e6da1..82c4924c33773 100644 --- a/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types +++ b/tests/baselines/reference/contextuallyTypedBindingInitializerNegative.types @@ -80,8 +80,8 @@ interface Tuples { } function g({ prop = [101, 1234] }: Tuples) {} >g : ({ prop }: Tuples) => void ->prop : [string, number] | [number, number] ->[101, 1234] : [number, number] +>prop : [string, number] | [number, 1234] +>[101, 1234] : [number, 1234] >101 : 101 >1234 : 1234 >Tuples : Tuples @@ -94,7 +94,7 @@ interface StringUnion { } function h({ prop = "baz" }: StringUnion) {} >h : ({ prop }: StringUnion) => void ->prop : "foo" | "bar" | "baz" +>prop : string >"baz" : "baz" >StringUnion : StringUnion diff --git a/tests/baselines/reference/contextuallyTypedIife.types b/tests/baselines/reference/contextuallyTypedIife.types index 7b86fe1f33786..ddcb8effb5a8e 100644 --- a/tests/baselines/reference/contextuallyTypedIife.types +++ b/tests/baselines/reference/contextuallyTypedIife.types @@ -179,7 +179,7 @@ >({ q }) => q : ({ q }: { q: number; }) => number >q : number >q : number ->{ q : 13 } : { q: number; } +>{ q : 13 } : { q: 13; } >q : number >13 : 13 @@ -190,7 +190,7 @@ >p : number >14 : 14 >p : number ->{ p : 15 } : { p: number; } +>{ p : 15 } : { p: 15; } >p : number >15 : 15 @@ -200,21 +200,21 @@ >({ r = 17 } = { r: 18 }) => r : ({ r }?: { r: number; }) => number >r : number >17 : 17 ->{ r: 18 } : { r: number; } +>{ r: 18 } : { r: 18; } >r : number >18 : 18 >r : number ->{r : 19} : { r: number; } +>{r : 19} : { r: 19; } >r : number >19 : 19 (({ u = 22 } = { u: 23 }) => u)(); >(({ u = 22 } = { u: 23 }) => u)() : number ->(({ u = 22 } = { u: 23 }) => u) : ({ u }?: { u?: number; }) => number ->({ u = 22 } = { u: 23 }) => u : ({ u }?: { u?: number; }) => number +>(({ u = 22 } = { u: 23 }) => u) : ({ u }?: { u?: 23; }) => number +>({ u = 22 } = { u: 23 }) => u : ({ u }?: { u?: 23; }) => number >u : number >22 : 22 ->{ u: 23 } : { u?: number; } +>{ u: 23 } : { u?: 23; } >u : number >23 : 23 >u : number diff --git a/tests/baselines/reference/contextuallyTypedIifeStrict.types b/tests/baselines/reference/contextuallyTypedIifeStrict.types index 5a8a33ac41df2..5d722d8f11bb8 100644 --- a/tests/baselines/reference/contextuallyTypedIifeStrict.types +++ b/tests/baselines/reference/contextuallyTypedIifeStrict.types @@ -179,7 +179,7 @@ >({ q }) => q : ({ q }: { q: number; }) => number >q : number >q : number ->{ q : 13 } : { q: number; } +>{ q : 13 } : { q: 13; } >q : number >13 : 13 @@ -190,7 +190,7 @@ >p : number >14 : 14 >p : number ->{ p : 15 } : { p: number; } +>{ p : 15 } : { p: 15; } >p : number >15 : 15 @@ -200,21 +200,21 @@ >({ r = 17 } = { r: 18 }) => r : ({ r }?: { r: number; }) => number >r : number >17 : 17 ->{ r: 18 } : { r: number; } +>{ r: 18 } : { r: 18; } >r : number >18 : 18 >r : number ->{r : 19} : { r: number; } +>{r : 19} : { r: 19; } >r : number >19 : 19 (({ u = 22 } = { u: 23 }) => u)(); >(({ u = 22 } = { u: 23 }) => u)() : number ->(({ u = 22 } = { u: 23 }) => u) : ({ u }?: { u?: number; }) => number ->({ u = 22 } = { u: 23 }) => u : ({ u }?: { u?: number; }) => number +>(({ u = 22 } = { u: 23 }) => u) : ({ u }?: { u?: 23; }) => number +>({ u = 22 } = { u: 23 }) => u : ({ u }?: { u?: 23; }) => number >u : number >22 : 22 ->{ u: 23 } : { u?: number; } +>{ u: 23 } : { u?: 23; } >u : number >23 : 23 >u : number diff --git a/tests/baselines/reference/contextuallyTypingOrOperator.types b/tests/baselines/reference/contextuallyTypingOrOperator.types index 3ca4ff4ee8f7e..d2f15ba7abe6a 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator.types @@ -11,9 +11,9 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >s.length : number >s : string >length : number ->{ a: s => 1 } : { a: (s: string) => number; } ->a : (s: string) => number ->s => 1 : (s: string) => number +>{ a: s => 1 } : { a: (s: string) => 1; } +>a : (s: string) => 1 +>s => 1 : (s: string) => 1 >s : string >1 : 1 diff --git a/tests/baselines/reference/contextuallyTypingOrOperator2.types b/tests/baselines/reference/contextuallyTypingOrOperator2.types index f72e6f3e92e5c..b1deb1eb24dd8 100644 --- a/tests/baselines/reference/contextuallyTypingOrOperator2.types +++ b/tests/baselines/reference/contextuallyTypingOrOperator2.types @@ -11,9 +11,9 @@ var v: { a: (_: string) => number } = { a: s => s.length } || { a: s => 1 }; >s.length : number >s : string >length : number ->{ a: s => 1 } : { a: (s: string) => number; } ->a : (s: string) => number ->s => 1 : (s: string) => number +>{ a: s => 1 } : { a: (s: string) => 1; } +>a : (s: string) => 1 +>s => 1 : (s: string) => 1 >s : string >1 : 1 diff --git a/tests/baselines/reference/controlFlowDeleteOperator.types b/tests/baselines/reference/controlFlowDeleteOperator.types index 7c8cfc8dd6117..7c5f09d9f941b 100644 --- a/tests/baselines/reference/controlFlowDeleteOperator.types +++ b/tests/baselines/reference/controlFlowDeleteOperator.types @@ -6,7 +6,7 @@ function f() { >x : { a?: string | number | undefined; b: string | number; } >a : string | number | undefined >b : string | number ->{ b: 1 } : { b: number; } +>{ b: 1 } : { b: 1; } >b : number >1 : 1 diff --git a/tests/baselines/reference/controlFlowDestructuringDeclaration.types b/tests/baselines/reference/controlFlowDestructuringDeclaration.types index 2815f2e1884b2..5d6ca10dffa29 100644 --- a/tests/baselines/reference/controlFlowDestructuringDeclaration.types +++ b/tests/baselines/reference/controlFlowDestructuringDeclaration.types @@ -22,7 +22,7 @@ function f2() { let [x]: [string | number] = [1]; >x : string | number ->[1] : [number] +>[1] : [1] >1 : 1 x; @@ -30,7 +30,7 @@ function f2() { let [y]: [string | undefined] = [""]; >y : string | undefined ->[""] : [string] +>[""] : [""] >"" : "" y; @@ -51,7 +51,7 @@ function f3() { let [x]: (string | number)[] = [1]; >x : string | number ->[1] : number[] +>[1] : 1[] >1 : 1 x; @@ -59,7 +59,7 @@ function f3() { let [y]: (string | undefined)[] = [""]; >y : string | undefined ->[""] : string[] +>[""] : ""[] >"" : "" y; @@ -81,7 +81,7 @@ function f4() { let { x }: { x: string | number } = { x: 1 }; >x : string | number >x : string | number ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 @@ -91,7 +91,7 @@ function f4() { let { y }: { y: string | undefined } = { y: "" }; >y : string | undefined >y : string | undefined ->{ y: "" } : { y: string; } +>{ y: "" } : { y: ""; } >y : string >"" : "" @@ -116,7 +116,7 @@ function f5() { let { x }: { x?: string | number } = { x: 1 }; >x : string | number | undefined >x : string | number | undefined ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 @@ -126,7 +126,7 @@ function f5() { let { y }: { y?: string | undefined } = { y: "" }; >y : string | undefined >y : string | undefined ->{ y: "" } : { y: string; } +>{ y: "" } : { y: ""; } >y : string >"" : "" @@ -180,7 +180,7 @@ function f7() { let o: { [x: string]: number } = { x: 1 }; >o : { [x: string]: number; } >x : string ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 diff --git a/tests/baselines/reference/declarationEmitDestructuring2.js b/tests/baselines/reference/declarationEmitDestructuring2.js index 09980c5c9dd11..0b302548e0298 100644 --- a/tests/baselines/reference/declarationEmitDestructuring2.js +++ b/tests/baselines/reference/declarationEmitDestructuring2.js @@ -21,8 +21,8 @@ function h1(_a) { //// [declarationEmitDestructuring2.d.ts] declare function f({x, y: [a, b, c, d]}?: { - x?: number; - y?: [number, number, number, number]; + x?: 10; + y?: [2, 4, 6, 8]; }): void; declare function g([a, b, c, d]?: [number, number, number, number]): void; declare function h([a, [b], [[c]], {x, y: [a, b, c], z: {a1, b1}}]: [any, [any], [[any]], { diff --git a/tests/baselines/reference/declarationEmitDestructuring2.types b/tests/baselines/reference/declarationEmitDestructuring2.types index 92677fce36fec..0bf506fd1f37f 100644 --- a/tests/baselines/reference/declarationEmitDestructuring2.types +++ b/tests/baselines/reference/declarationEmitDestructuring2.types @@ -1,6 +1,6 @@ === tests/cases/compiler/declarationEmitDestructuring2.ts === function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] }) { } ->f : ({ x, y: [a, b, c, d] }?: { x?: number; y?: [number, number, number, number]; }) => void +>f : ({ x, y: [a, b, c, d] }?: { x?: 10; y?: [2, 4, 6, 8]; }) => void >x : number >10 : 10 >y : any @@ -13,11 +13,11 @@ function f({x = 10, y: [a, b, c, d] = [1, 2, 3, 4]} = { x: 10, y: [2, 4, 6, 8] } >2 : 2 >3 : 3 >4 : 4 ->{ x: 10, y: [2, 4, 6, 8] } : { x?: number; y?: [number, number, number, number]; } +>{ x: 10, y: [2, 4, 6, 8] } : { x?: 10; y?: [2, 4, 6, 8]; } >x : number >10 : 10 ->y : [number, number, number, number] ->[2, 4, 6, 8] : [number, number, number, number] +>y : [2, 4, 6, 8] +>[2, 4, 6, 8] : [2, 4, 6, 8] >2 : 2 >4 : 4 >6 : 6 diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types index 26ef7db8a99b3..7c198a30eefb6 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types @@ -15,7 +15,7 @@ var [x11 = 0, y11 = ""] = [1, "hello"]; >0 : 0 >y11 : string >"" : "" ->[1, "hello"] : [number, string] +>[1, "hello"] : [1, "hello"] >1 : 1 >"hello" : "hello" @@ -38,11 +38,11 @@ var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello" >10 : 10 >y12 : boolean >false : false ->[1, ["hello", { x12: 5, y12: true }]] : [number, [string, { x12: number; y12: true; }]] +>[1, ["hello", { x12: 5, y12: true }]] : [number, ["hello", { x12: 5; y12: true; }]] >1 : 1 ->["hello", { x12: 5, y12: true }] : [string, { x12: number; y12: true; }] +>["hello", { x12: 5, y12: true }] : ["hello", { x12: 5; y12: true; }] >"hello" : "hello" ->{ x12: 5, y12: true } : { x12: number; y12: true; } +>{ x12: 5, y12: true } : { x12: 5; y12: true; } >x12 : number >5 : 5 >y12 : boolean diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index 8f6d44a7c3a10..f0eea2cde3a6b 100644 --- a/tests/baselines/reference/declarationsAndAssignments.errors.txt +++ b/tests/baselines/reference/declarationsAndAssignments.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(23,25): tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(24,19): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(28,28): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(29,22): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string | 1' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, but here has type 'string'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string | number' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, but here has type 'string'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. @@ -17,8 +17,8 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,11): tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,14): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(74,11): error TS2459: Type 'undefined[]' has no property 'a' and no string index signature. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(74,14): error TS2459: Type 'undefined[]' has no property 'b' and no string index signature. -tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(106,5): error TS2345: Argument of type '[number, [string, { y: false; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. - Type '[string, { y: false; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(106,5): error TS2345: Argument of type '[2, ["abc", { y: false; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. + Type '["abc", { y: false; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. Type '{ y: false; }' is not assignable to type '{ x: any; y?: boolean; }'. Property 'x' is missing in type '{ y: false; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,6): error TS2322: Type 'string' is not assignable to type 'number'. @@ -99,7 +99,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): var x: number; var y: string; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string | 1' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, but here has type 'string'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string | number' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, but here has type 'string'. } function f8() { @@ -171,8 +171,8 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): f14([2, ["abc", { x: 0 }]]); f14([2, ["abc", { y: false }]]); // Error, no x ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, [string, { y: false; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. -!!! error TS2345: Type '[string, { y: false; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. +!!! error TS2345: Argument of type '[2, ["abc", { y: false; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'. +!!! error TS2345: Type '["abc", { y: false; }]' is not assignable to type '[string, { x: any; y?: boolean; }]'. !!! error TS2345: Type '{ y: false; }' is not assignable to type '{ x: any; y?: boolean; }'. !!! error TS2345: Property 'x' is missing in type '{ y: false; }'. diff --git a/tests/baselines/reference/declarationsAndAssignments.types b/tests/baselines/reference/declarationsAndAssignments.types index 8e7187bef81a0..98b32af3dc7c6 100644 --- a/tests/baselines/reference/declarationsAndAssignments.types +++ b/tests/baselines/reference/declarationsAndAssignments.types @@ -221,7 +221,7 @@ function f6() { >0 : 0 >y : string >"" : "" ->[1, "hello"] : [number, string] +>[1, "hello"] : [1, "hello"] >1 : 1 >"hello" : "hello" @@ -238,9 +238,9 @@ function f7() { var [x = 0, y = 1] = [1, "hello"]; // Error, initializer for y must be string >x : number >0 : 0 ->y : string | 1 +>y : string | number >1 : 1 ->[1, "hello"] : [number, string] +>[1, "hello"] : [1, string] >1 : 1 >"hello" : "hello" @@ -248,7 +248,7 @@ function f7() { >x : number var y: string; ->y : string | 1 +>y : string | number } function f8() { @@ -363,11 +363,11 @@ function f12() { >10 : 10 >y : boolean >false : false ->[1, ["hello", { x: 5, y: true }]] : [number, [string, { x: number; y: true; }]] +>[1, ["hello", { x: 5, y: true }]] : [number, ["hello", { x: 5; y: true; }]] >1 : 1 ->["hello", { x: 5, y: true }] : [string, { x: number; y: true; }] +>["hello", { x: 5, y: true }] : ["hello", { x: 5; y: true; }] >"hello" : "hello" ->{ x: 5, y: true } : { x: number; y: true; } +>{ x: 5, y: true } : { x: 5; y: true; } >x : number >5 : 5 >y : boolean @@ -433,9 +433,9 @@ function f14([a = 1, [b = "hello", { x, y: c = false }]]) { f14([2, ["abc", { x: 0, y: true }]]); >f14([2, ["abc", { x: 0, y: true }]]) : void >f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void ->[2, ["abc", { x: 0, y: true }]] : [number, [string, { x: number; y: true; }]] +>[2, ["abc", { x: 0, y: true }]] : [2, ["abc", { x: number; y: true; }]] >2 : 2 ->["abc", { x: 0, y: true }] : [string, { x: number; y: true; }] +>["abc", { x: 0, y: true }] : ["abc", { x: number; y: true; }] >"abc" : "abc" >{ x: 0, y: true } : { x: number; y: true; } >x : number @@ -446,9 +446,9 @@ f14([2, ["abc", { x: 0, y: true }]]); f14([2, ["abc", { x: 0 }]]); >f14([2, ["abc", { x: 0 }]]) : void >f14 : ([a, [b, { x, y: c }]]: [number, [string, { x: any; y?: boolean; }]]) => void ->[2, ["abc", { x: 0 }]] : [number, [string, { x: number; }]] +>[2, ["abc", { x: 0 }]] : [2, ["abc", { x: number; }]] >2 : 2 ->["abc", { x: 0 }] : [string, { x: number; }] +>["abc", { x: 0 }] : ["abc", { x: number; }] >"abc" : "abc" >{ x: 0 } : { x: number; } >x : number @@ -527,7 +527,7 @@ f17({}); f17({ a: "hello" }); >f17({ a: "hello" }) : void >f17 : ({ a, b, c }: { a?: string; b?: number; c?: boolean; }) => void ->{ a: "hello" } : { a: string; } +>{ a: "hello" } : { a: "hello"; } >a : string >"hello" : "hello" @@ -597,7 +597,7 @@ function f18() { >a : number [a = 1, b = "abc"] = [2, "def"]; ->[a = 1, b = "abc"] = [2, "def"] : [number, string] +>[a = 1, b = "abc"] = [2, "def"] : [2, "def"] >[a = 1, b = "abc"] : [number, string] >a = 1 : 1 >a : number @@ -605,7 +605,7 @@ function f18() { >b = "abc" : "abc" >b : string >"abc" : "abc" ->[2, "def"] : [number, string] +>[2, "def"] : [2, "def"] >2 : 2 >"def" : "def" } @@ -646,7 +646,7 @@ function f19() { >a : any [[a, b] = [1, 2]] = [[2, 3]]; ->[[a, b] = [1, 2]] = [[2, 3]] : [[number, number]] +>[[a, b] = [1, 2]] = [[2, 3]] : [[2, 3]] >[[a, b] = [1, 2]] : [[number, number]] >[a, b] = [1, 2] : [number, number] >[a, b] : [any, any] @@ -655,8 +655,8 @@ function f19() { >[1, 2] : [number, number] >1 : 1 >2 : 2 ->[[2, 3]] : [[number, number]] ->[2, 3] : [number, number] +>[[2, 3]] : [[2, 3]] +>[2, 3] : [2, 3] >2 : 2 >3 : 3 @@ -722,47 +722,47 @@ function f20() { >3 : 3 [...a] = [1, 2, 3]; ->[...a] = [1, 2, 3] : number[] +>[...a] = [1, 2, 3] : (1 | 2 | 3)[] >[...a] : number[] >...a : number >a : number[] ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 [x, ...a] = [1, 2, 3]; ->[x, ...a] = [1, 2, 3] : number[] +>[x, ...a] = [1, 2, 3] : (1 | 2 | 3)[] >[x, ...a] : number[] >x : number >...a : number >a : number[] ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 [x, y, ...a] = [1, 2, 3]; ->[x, y, ...a] = [1, 2, 3] : number[] +>[x, y, ...a] = [1, 2, 3] : (1 | 2 | 3)[] >[x, y, ...a] : number[] >x : number >y : number >...a : number >a : number[] ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 [x, y, z, ...a] = [1, 2, 3]; ->[x, y, z, ...a] = [1, 2, 3] : number[] +>[x, y, z, ...a] = [1, 2, 3] : (1 | 2 | 3)[] >[x, y, z, ...a] : number[] >x : number >y : number >z : number >...a : number >a : number[] ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/decrementOperatorWithNumberType.types b/tests/baselines/reference/decrementOperatorWithNumberType.types index c81dc0660ecb2..10c401d479409 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberType.types +++ b/tests/baselines/reference/decrementOperatorWithNumberType.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.types b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.types index 3cebfcff9d8c0..6812c826dd090 100644 --- a/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.types +++ b/tests/baselines/reference/decrementOperatorWithNumberTypeInvalidOperations.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.types b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.types index c22b39a3e6d38..044f701519b4c 100644 --- a/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.types +++ b/tests/baselines/reference/decrementOperatorWithUnsupportedStringType.types @@ -5,7 +5,7 @@ var STRING: string; var STRING1: string[] = ["", ""]; >STRING1 : string[] ->["", ""] : string[] +>["", ""] : ""[] >"" : "" >"" : "" diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.types b/tests/baselines/reference/deleteOperatorWithNumberType.types index e3a26b618e1fd..02dd521c3b190 100644 --- a/tests/baselines/reference/deleteOperatorWithNumberType.types +++ b/tests/baselines/reference/deleteOperatorWithNumberType.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/deleteOperatorWithStringType.types b/tests/baselines/reference/deleteOperatorWithStringType.types index 842ad281ef77d..0dc3f4c97e89e 100644 --- a/tests/baselines/reference/deleteOperatorWithStringType.types +++ b/tests/baselines/reference/deleteOperatorWithStringType.types @@ -5,7 +5,7 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] ->["", "abc"] : string[] +>["", "abc"] : ("" | "abc")[] >"" : "" >"abc" : "abc" diff --git a/tests/baselines/reference/deleteReadonly.types b/tests/baselines/reference/deleteReadonly.types index 77295796afda6..15dde3f965956 100644 --- a/tests/baselines/reference/deleteReadonly.types +++ b/tests/baselines/reference/deleteReadonly.types @@ -32,7 +32,7 @@ interface B { var b: B = { >b : B >B : B ->{ 'test': 'test'} : { 'test': string; } +>{ 'test': 'test'} : { 'test': "test"; } 'test': 'test' >'test' : "test" diff --git a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types index dbcac43d5bd75..e718d736b4553 100644 --- a/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types +++ b/tests/baselines/reference/derivedClassConstructorWithExplicitReturns01.types @@ -14,14 +14,14 @@ class C { >value : number return { ->{ cProp: value, foo() { return "well this looks kinda C-ish."; } } : { cProp: number; foo(): string; } +>{ cProp: value, foo() { return "well this looks kinda C-ish."; } } : { cProp: number; foo(): "well this looks kinda C-ish."; } cProp: value, >cProp : number >value : number foo() { ->foo : () => string +>foo : () => "well this looks kinda C-ish." return "well this looks kinda C-ish."; >"well this looks kinda C-ish." : "well this looks kinda C-ish." @@ -60,7 +60,7 @@ class D extends C { >"You win!" : "You win!" return { ->{ cProp: 1, dProp: () => this, foo() { return "You win!!!!!" } } : { cProp: number; dProp: () => this; foo(): string; } +>{ cProp: 1, dProp: () => this, foo() { return "You win!!!!!" } } : { cProp: 1; dProp: () => this; foo(): "You win!!!!!"; } cProp: 1, >cProp : number @@ -72,7 +72,7 @@ class D extends C { >this : this foo() { return "You win!!!!!" } ->foo : () => string +>foo : () => "You win!!!!!" >"You win!!!!!" : "You win!!!!!" }; diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.errors.txt b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.errors.txt index 19bf8d1ff2284..c6fa5cc8bf148 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.errors.txt +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts(14,36): error TS2345: Argument of type '{ a: number; b: number; }' is not assignable to parameter of type '{ a: number; }'. +tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclarations/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.ts(14,36): error TS2345: Argument of type '{ a: 1; b: number; }' is not assignable to parameter of type '{ a: number; }'. Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. @@ -18,7 +18,7 @@ tests/cases/conformance/classes/propertyMemberDeclarations/memberFunctionDeclara var r = super.foo({ a: 1 }); // { a: number } var r2 = super.foo({ a: 1, b: 2 }); // { a: number } ~~~~ -!!! error TS2345: Argument of type '{ a: number; b: number; }' is not assignable to parameter of type '{ a: number; }'. +!!! error TS2345: Argument of type '{ a: 1; b: number; }' is not assignable to parameter of type '{ a: number; }'. !!! error TS2345: Object literal may only specify known properties, and 'b' does not exist in type '{ a: number; }'. var r3 = this.foo({ a: 1, b: 2 }); // { a: number; b: number; } } diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types index a5e997f96ebd4..73c3e9de92f46 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.types @@ -38,7 +38,7 @@ class Derived extends Base { >super.foo : (x: { a: number; }) => { a: number; } >super : Base >foo : (x: { a: number; }) => { a: number; } ->{ a: 1 } : { a: number; } +>{ a: 1 } : { a: 1; } >a : number >1 : 1 @@ -60,7 +60,7 @@ class Derived extends Base { >this.foo : (x: { a: number; b: number; }) => { a: number; b: number; } >this : this >foo : (x: { a: number; b: number; }) => { a: number; b: number; } ->{ a: 1, b: 2 } : { a: number; b: number; } +>{ a: 1, b: 2 } : { a: 1; b: 2; } >a : number >1 : 1 >b : number diff --git a/tests/baselines/reference/destructureOptionalParameter.types b/tests/baselines/reference/destructureOptionalParameter.types index 18a6d7675dd41..fd96118550b35 100644 --- a/tests/baselines/reference/destructureOptionalParameter.types +++ b/tests/baselines/reference/destructureOptionalParameter.types @@ -12,7 +12,7 @@ function f2({ a, b }: { a: number, b: number } = { a: 0, b: 0 }) { >b : number >a : number >b : number ->{ a: 0, b: 0 } : { a: number; b: number; } +>{ a: 0, b: 0 } : { a: 0; b: 0; } >a : number >0 : 0 >b : number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types index d0d8561b8080d..a62414e57b987 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types @@ -50,7 +50,7 @@ var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; >b3 : number >b4 : number >b5 : string ->[1, 2, "string"] : [number, number, string] +>[1, 2, "string"] : [1, 2, "string"] >1 : 1 >2 : 2 >"string" : "string" @@ -109,8 +109,8 @@ var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] var [[c5], c6]: [[string|number], boolean] = [[1], true]; >c5 : string | number >c6 : boolean ->[[1], true] : [[number], true] ->[1] : [number] +>[[1], true] : [[1], true] +>[1] : [1] >1 : 1 >true : true diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types index 09dc481c477b8..4cc26a9e6749f 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types @@ -50,7 +50,7 @@ var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; >b3 : number >b4 : number >b5 : string ->[1, 2, "string"] : [number, number, string] +>[1, 2, "string"] : [1, 2, "string"] >1 : 1 >2 : 2 >"string" : "string" @@ -109,8 +109,8 @@ var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] var [[c5], c6]: [[string|number], boolean] = [[1], true]; >c5 : string | number >c6 : boolean ->[[1], true] : [[number], true] ->[1] : [number] +>[[1], true] : [[1], true] +>[1] : [1] >1 : 1 >true : true diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types index a07ea6ca017d9..d09da8f410104 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types @@ -50,7 +50,7 @@ var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; >b3 : number >b4 : number >b5 : string ->[1, 2, "string"] : [number, number, string] +>[1, 2, "string"] : [1, 2, "string"] >1 : 1 >2 : 2 >"string" : "string" @@ -109,8 +109,8 @@ var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] var [[c5], c6]: [[string|number], boolean] = [[1], true]; >c5 : string | number >c6 : boolean ->[[1], true] : [[number], true] ->[1] : [number] +>[[1], true] : [[1], true] +>[1] : [1] >1 : 1 >true : true diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index 7fba74522e2e2..6601e489425fa 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[number, 2, string]' is not assignable to type '[number, boolean, string]'. - Type '2' is not assignable to type 'boolean'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,5): error TS2322: Type '[1, number, "string"]' is not assignable to type '[number, boolean, string]'. + Type 'number' is not assignable to type 'boolean'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2322: Type 'number[]' is not assignable to type '[number, number]'. Property '0' is missing in type 'number[]'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(23,5): error TS2322: Type 'number[]' is not assignable to type '[string, string]'. @@ -27,8 +27,8 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss // where N is the numeric index of E in the array assignment pattern, or var [b0, b1, b2]: [number, boolean, string] = [1, 2, "string"]; // Error ~~~~~~~~~~~~ -!!! error TS2322: Type '[number, 2, string]' is not assignable to type '[number, boolean, string]'. -!!! error TS2322: Type '2' is not assignable to type 'boolean'. +!!! error TS2322: Type '[1, number, "string"]' is not assignable to type '[number, boolean, string]'. +!!! error TS2322: Type 'number' is not assignable to type 'boolean'. interface J extends Array { 2: number; } diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types index a19cba3e63a2a..946202083c97e 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types @@ -18,7 +18,7 @@ var [b0, b1, b2]: [number, boolean, string] = [1, 2, "string"]; // Error >b0 : number >b1 : boolean >b2 : string ->[1, 2, "string"] : [number, 2, string] +>[1, 2, "string"] : [1, number, "string"] >1 : 1 >2 : 2 >"string" : "string" @@ -37,13 +37,13 @@ function bar(): J { return <[number, number, number]>[1, 2, 3]; ><[number, number, number]>[1, 2, 3] : [number, number, number] ->[1, 2, 3] : [number, number, number] +>[1, 2, 3] : [1, 2, 3] >1 : 1 >2 : 2 >3 : 3 } var [b3 = "string", b4, b5] = bar(); // Error ->b3 : Number | "string" +>b3 : string | Number >"string" : "string" >b4 : Number >b5 : Number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types index 542a8ad1b3610..6fb536baa6af8 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types @@ -35,7 +35,7 @@ const [f, g = f, h = i, i = f] = [1]; // error for h = i >a : number })([1]); ->[1] : number[] +>[1] : 1[] >1 : 1 (function ([c, d = c, e = e]) { // error for e = e @@ -49,7 +49,7 @@ const [f, g = f, h = i, i = f] = [1]; // error for h = i >e : any })([1]); ->[1] : number[] +>[1] : 1[] >1 : 1 (function ([f, g = f, h = i, i = f]) { // error for h = i @@ -65,6 +65,6 @@ const [f, g = f, h = i, i = f] = [1]; // error for h = i >f : number })([1]) ->[1] : number[] +>[1] : 1[] >1 : 1 diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types index 203815fa9c866..6246ba521bb5a 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types @@ -27,9 +27,9 @@ var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; >{ b21: "string" } : { b21: string; } >b21 : string >"string" : "string" ->{ b2: { b21: "world" } } : { b2?: { b21: string; }; } ->b2 : { b21: string; } ->{ b21: "world" } : { b21: string; } +>{ b2: { b21: "world" } } : { b2?: { b21: "world"; }; } +>b2 : { b21: "world"; } +>{ b21: "world" } : { b21: "world"; } >b21 : string >"world" : "world" @@ -114,7 +114,7 @@ function foo1(): F1 { >F1 : F1 return { ->{ "prop1": 2 } : { "prop1": number; } +>{ "prop1": 2 } : { "prop1": 2; } "prop1": 2 >2 : 2 diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types index 1c3d1f4d00c75..5a7bd1eedd544 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types @@ -27,9 +27,9 @@ var { b2: { b21 } = { b21: "string" } } = { b2: { b21: "world" } }; >{ b21: "string" } : { b21: string; } >b21 : string >"string" : "string" ->{ b2: { b21: "world" } } : { b2?: { b21: string; }; } ->b2 : { b21: string; } ->{ b21: "world" } : { b21: string; } +>{ b2: { b21: "world" } } : { b2?: { b21: "world"; }; } +>b2 : { b21: "world"; } +>{ b21: "world" } : { b21: "world"; } >b21 : string >"world" : "world" @@ -114,7 +114,7 @@ function foo1(): F1 { >F1 : F1 return { ->{ "prop1": 2 } : { "prop1": number; } +>{ "prop1": 2 } : { "prop1": 2; } "prop1": 2 >2 : 2 diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration1ES5.errors.txt index fbbfc3b0d218d..bab853a5df220 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES5.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(12,4): error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(12,4): error TS2345: Argument of type '[1, 2, "world"[][], 3]' is not assignable to parameter of type '[number, number, string[][]]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '3'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5.ts(57,4): error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. @@ -22,7 +22,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5. a1([1, 2, [["world"]]]); a1([1, 2, [["world"]], 3]); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'. +!!! error TS2345: Argument of type '[1, 2, "world"[][], 3]' is not assignable to parameter of type '[number, number, string[][]]'. !!! error TS2345: Types of property 'length' are incompatible. !!! error TS2345: Type '4' is not assignable to type '3'. diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5.types b/tests/baselines/reference/destructuringParameterDeclaration1ES5.types index c7a5c44f1d46d..88b10aac5a358 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES5.types +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5.types @@ -44,11 +44,11 @@ function a4({x, a}: { x: number, a: number }) { } a1([1, 2, [["world"]]]); >a1([1, 2, [["world"]]]) : void >a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, 2, [["world"]]] : [number, number, string[][]] +>[1, 2, [["world"]]] : [1, 2, "world"[][]] >1 : 1 >2 : 2 ->[["world"]] : string[][] ->["world"] : string[] +>[["world"]] : "world"[][] +>["world"] : "world"[] >"world" : "world" a1([1, 2, [["world"]], 3]); @@ -153,7 +153,7 @@ b2("string", { x: 200, y: "string" }); >b2("string", { x: 200, y: "string" }) : void >b2 : (z?: any, o?: { x: number; y: any; }) => void >"string" : "string" ->{ x: 200, y: "string" } : { x: number; y: string; } +>{ x: 200, y: "string" } : { x: 200; y: string; } >x : number >200 : 200 >y : string @@ -163,7 +163,7 @@ b2("string", { x: 200, y: true }); >b2("string", { x: 200, y: true }) : void >b2 : (z?: any, o?: { x: number; y: any; }) => void >"string" : "string" ->{ x: 200, y: true } : { x: number; y: boolean; } +>{ x: 200, y: true } : { x: 200; y: boolean; } >x : number >200 : 200 >y : boolean @@ -218,7 +218,7 @@ function c3({b}: { b: number|string} = { b: "hello" }) { } >c3 : ({ b }?: { b: string | number; }) => void >b : string | number >b : string | number ->{ b: "hello" } : { b: string; } +>{ b: "hello" } : { b: "hello"; } >b : string >"hello" : "hello" @@ -268,7 +268,7 @@ c1(); // Implied type is {z:number}? c1({ z: 1 }) // Implied type is {z:number}? >c1({ z: 1 }) : void >c1 : ({ z }?: { z: number; }) => void ->{ z: 1 } : { z: number; } +>{ z: 1 } : { z: 1; } >z : number >1 : 1 @@ -280,14 +280,14 @@ c2({}); // Implied type is {z?: number} c2({z:1}); // Implied type is {z?: number} >c2({z:1}) : void >c2 : ({ z }: { z?: number; }) => void ->{z:1} : { z: number; } +>{z:1} : { z: 1; } >z : number >1 : 1 c3({ b: 1 }); // Implied type is { b: number|string }. >c3({ b: 1 }) : void >c3 : ({ b }?: { b: string | number; }) => void ->{ b: 1 } : { b: number; } +>{ b: 1 } : { b: 1; } >b : number >1 : 1 diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.errors.txt index 1dc3c61bb3a6e..5d9073f90638b 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts(12,4): error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts(12,4): error TS2345: Argument of type '[1, 2, "world"[][], 3]' is not assignable to parameter of type '[number, number, string[][]]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '3'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts(57,4): error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. @@ -22,7 +22,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5i a1([1, 2, [["world"]]]); a1([1, 2, [["world"]], 3]); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'. +!!! error TS2345: Argument of type '[1, 2, "world"[][], 3]' is not assignable to parameter of type '[number, number, string[][]]'. !!! error TS2345: Types of property 'length' are incompatible. !!! error TS2345: Type '4' is not assignable to type '3'. diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.types b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.types index b41a202758660..2c29b2eb097f2 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.types +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.types @@ -44,11 +44,11 @@ function a4({x, a}: { x: number, a: number }) { } a1([1, 2, [["world"]]]); >a1([1, 2, [["world"]]]) : void >a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, 2, [["world"]]] : [number, number, string[][]] +>[1, 2, [["world"]]] : [1, 2, "world"[][]] >1 : 1 >2 : 2 ->[["world"]] : string[][] ->["world"] : string[] +>[["world"]] : "world"[][] +>["world"] : "world"[] >"world" : "world" a1([1, 2, [["world"]], 3]); @@ -153,7 +153,7 @@ b2("string", { x: 200, y: "string" }); >b2("string", { x: 200, y: "string" }) : void >b2 : (z?: any, o?: { x: number; y: any; }) => void >"string" : "string" ->{ x: 200, y: "string" } : { x: number; y: string; } +>{ x: 200, y: "string" } : { x: 200; y: string; } >x : number >200 : 200 >y : string @@ -163,7 +163,7 @@ b2("string", { x: 200, y: true }); >b2("string", { x: 200, y: true }) : void >b2 : (z?: any, o?: { x: number; y: any; }) => void >"string" : "string" ->{ x: 200, y: true } : { x: number; y: boolean; } +>{ x: 200, y: true } : { x: 200; y: boolean; } >x : number >200 : 200 >y : boolean @@ -218,7 +218,7 @@ function c3({b}: { b: number|string} = { b: "hello" }) { } >c3 : ({ b }?: { b: string | number; }) => void >b : string | number >b : string | number ->{ b: "hello" } : { b: string; } +>{ b: "hello" } : { b: "hello"; } >b : string >"hello" : "hello" @@ -268,7 +268,7 @@ c1(); // Implied type is {z:number}? c1({ z: 1 }) // Implied type is {z:number}? >c1({ z: 1 }) : void >c1 : ({ z }?: { z: number; }) => void ->{ z: 1 } : { z: number; } +>{ z: 1 } : { z: 1; } >z : number >1 : 1 @@ -280,14 +280,14 @@ c2({}); // Implied type is {z?: number} c2({z:1}); // Implied type is {z?: number} >c2({z:1}) : void >c2 : ({ z }: { z?: number; }) => void ->{z:1} : { z: number; } +>{z:1} : { z: 1; } >z : number >1 : 1 c3({ b: 1 }); // Implied type is { b: number|string }. >c3({ b: 1 }) : void >c3 : ({ b }?: { b: string | number; }) => void ->{ b: 1 } : { b: number; } +>{ b: 1 } : { b: 1; } >b : number >1 : 1 diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES6.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration1ES6.errors.txt index f6c17a5c0ea6e..daa74c2e8d610 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES6.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts(14,4): error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts(14,4): error TS2345: Argument of type '[1, 2, "world"[][], 3]' is not assignable to parameter of type '[number, number, string[][]]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '3'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6.ts(58,4): error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. @@ -25,7 +25,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES6. a1([1, 2, [["world"]]]); a1([1, 2, [["world"]], 3]); ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'. +!!! error TS2345: Argument of type '[1, 2, "world"[][], 3]' is not assignable to parameter of type '[number, number, string[][]]'. !!! error TS2345: Types of property 'length' are incompatible. !!! error TS2345: Type '4' is not assignable to type '3'. diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES6.types b/tests/baselines/reference/destructuringParameterDeclaration1ES6.types index 9de904efdec64..2c08864ae3f87 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES6.types +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES6.types @@ -46,11 +46,11 @@ function a4({x, a}: { x: number, a: number }) { } a1([1, 2, [["world"]]]); >a1([1, 2, [["world"]]]) : void >a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, 2, [["world"]]] : [number, number, string[][]] +>[1, 2, [["world"]]] : [1, 2, "world"[][]] >1 : 1 >2 : 2 ->[["world"]] : string[][] ->["world"] : string[] +>[["world"]] : "world"[][] +>["world"] : "world"[] >"world" : "world" a1([1, 2, [["world"]], 3]); @@ -156,7 +156,7 @@ b2("string", { x: 200, y: "string" }); >b2("string", { x: 200, y: "string" }) : void >b2 : (z?: any, o?: { x: number; y: any; }) => void >"string" : "string" ->{ x: 200, y: "string" } : { x: number; y: string; } +>{ x: 200, y: "string" } : { x: 200; y: string; } >x : number >200 : 200 >y : string @@ -166,7 +166,7 @@ b2("string", { x: 200, y: true }); >b2("string", { x: 200, y: true }) : void >b2 : (z?: any, o?: { x: number; y: any; }) => void >"string" : "string" ->{ x: 200, y: true } : { x: number; y: boolean; } +>{ x: 200, y: true } : { x: 200; y: boolean; } >x : number >200 : 200 >y : boolean @@ -201,7 +201,7 @@ function c3({b}: { b: number|string} = { b: "hello" }) { } >c3 : ({ b }?: { b: string | number; }) => void >b : string | number >b : string | number ->{ b: "hello" } : { b: string; } +>{ b: "hello" } : { b: "hello"; } >b : string >"hello" : "hello" @@ -251,7 +251,7 @@ c1(); // Implied type is {z:number}? c1({ z: 1 }) // Implied type is {z:number}? >c1({ z: 1 }) : void >c1 : ({ z }?: { z: number; }) => void ->{ z: 1 } : { z: number; } +>{ z: 1 } : { z: 1; } >z : number >1 : 1 @@ -263,14 +263,14 @@ c2({}); // Implied type is {z?: number} c2({z:1}); // Implied type is {z?: number} >c2({z:1}) : void >c2 : ({ z }: { z?: number; }) => void ->{z:1} : { z: number; } +>{z:1} : { z: 1; } >z : number >1 : 1 c3({ b: 1 }); // Implied type is { b: number|string }. >c3({ b: 1 }) : void >c3 : ({ b }?: { b: string | number; }) => void ->{ b: 1 } : { b: number; } +>{ b: 1 } : { b: 1; } >b : number >1 : 1 diff --git a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt index 96b934236607e..521ba1c8eb7fa 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(7,4): error TS2345: Argument of type '[number, string, string[][]]' is not assignable to parameter of type '[number, number, string[][]]'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(7,4): error TS2345: Argument of type '[1, string, "world"[][]]' is not assignable to parameter of type '[number, number, string[][]]'. Type 'string' is not assignable to type 'number'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(7,29): error TS1005: ',' expected. -tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(8,4): error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(8,4): error TS2345: Argument of type '[1, 2, "world"[][], string]' is not assignable to parameter of type '[number, number, string[][]]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '3'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,8): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. @@ -55,13 +55,13 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts( function a0([a, b, [[c]]]: [number, number, string[][]]) { } a0([1, "string", [["world"]]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, string, string[][]]' is not assignable to parameter of type '[number, number, string[][]]'. +!!! error TS2345: Argument of type '[1, string, "world"[][]]' is not assignable to parameter of type '[number, number, string[][]]'. !!! error TS2345: Type 'string' is not assignable to type 'number'. ~ !!! error TS1005: ',' expected. a0([1, 2, [["world"]], "string"]); // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'. +!!! error TS2345: Argument of type '[1, 2, "world"[][], string]' is not assignable to parameter of type '[number, number, string[][]]'. !!! error TS2345: Types of property 'length' are incompatible. !!! error TS2345: Type '4' is not assignable to type '3'. diff --git a/tests/baselines/reference/destructuringParameterDeclaration2.types b/tests/baselines/reference/destructuringParameterDeclaration2.types index 5810f5bca98cd..aab90cb80edb2 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration2.types +++ b/tests/baselines/reference/destructuringParameterDeclaration2.types @@ -127,7 +127,7 @@ function c3({b}: { b: number|string } = { b: "hello" }) { } >c3 : ({ b }?: { b: string | number; }) => void >b : string | number >b : string | number ->{ b: "hello" } : { b: string; } +>{ b: "hello" } : { b: "hello"; } >b : string >"hello" : "hello" diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types index 33e0d3b6bd868..e01fa3c8decb8 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5.types @@ -137,7 +137,7 @@ a10([1, 2]); // Parameter type is any[] a11([1, 2]); // Parameter type is number[] >a11([1, 2]) : void >a11 : ([a, b, c, ...x]: number[]) => void ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types index 931e149ffe2b4..eb64b72ddb307 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable.types @@ -137,7 +137,7 @@ a10([1, 2]); // Parameter type is any[] a11([1, 2]); // Parameter type is number[] >a11([1, 2]) : void >a11 : ([a, b, c, ...x]: number[]) => void ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types index dc5e64d2c2cea..7591cfb3d725a 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES6.types +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES6.types @@ -137,7 +137,7 @@ a10([1, 2]); // Parameter type is any[] a11([1, 2]); // Parameter type is number[] >a11([1, 2]) : void >a11 : ([a, b, c, ...x]: number[]) => void ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index cdc7938d1af64..093c12f7d48af 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -9,8 +9,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( Type 'string' is not assignable to type '[[any]]'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(23,4): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]]]'. Property '2' is missing in type '[number, number]'. -tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(24,4): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(24,4): error TS2345: Argument of type '(string | 1 | 2)[]' is not assignable to parameter of type 'number[]'. + Type 'string | 1 | 2' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(29,17): error TS1317: A parameter property cannot be declared using a rest parameter. tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(34,22): error TS2304: Cannot find name 'E1'. @@ -62,8 +62,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( !!! error TS2345: Property '2' is missing in type '[number, number]'. a6([1, 2, "string"]); // Error, parameter type is number[] ~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number'. +!!! error TS2345: Argument of type '(string | 1 | 2)[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: Type 'string | 1 | 2' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. diff --git a/tests/baselines/reference/destructuringParameterProperties1.types b/tests/baselines/reference/destructuringParameterProperties1.types index e1bdd8b263168..5c3926b1061cc 100644 --- a/tests/baselines/reference/destructuringParameterProperties1.types +++ b/tests/baselines/reference/destructuringParameterProperties1.types @@ -51,7 +51,7 @@ c1 = new C1(["larry", "{curly}", "moe"]); >c1 : C1 >new C1(["larry", "{curly}", "moe"]) : C1 >C1 : typeof C1 ->["larry", "{curly}", "moe"] : string[] +>["larry", "{curly}", "moe"] : ("larry" | "{curly}" | "moe")[] >"larry" : "larry" >"{curly}" : "{curly}" >"moe" : "moe" @@ -78,7 +78,7 @@ var c2 = new C2(["10", 10, !!10]); >c2 : C2 >new C2(["10", 10, !!10]) : C2 >C2 : typeof C2 ->["10", 10, !!10] : [string, number, boolean] +>["10", 10, !!10] : ["10", 10, boolean] >"10" : "10" >10 : 10 >!!10 : boolean @@ -104,7 +104,7 @@ var c3 = new C3({x: 0, y: "", z: false}); >c3 : C3 >new C3({x: 0, y: "", z: false}) : C3 >C3 : typeof C3 ->{x: 0, y: "", z: false} : { x: number; y: string; z: false; } +>{x: 0, y: "", z: false} : { x: 0; y: ""; z: false; } >x : number >0 : 0 >y : string @@ -117,7 +117,7 @@ c3 = new C3({x: 0, "y": "y", z: true}); >c3 : C3 >new C3({x: 0, "y": "y", z: true}) : C3 >C3 : typeof C3 ->{x: 0, "y": "y", z: true} : { x: number; "y": string; z: true; } +>{x: 0, "y": "y", z: true} : { x: 0; "y": "y"; z: true; } >x : number >0 : 0 >"y" : "y" diff --git a/tests/baselines/reference/destructuringParameterProperties2.errors.txt b/tests/baselines/reference/destructuringParameterProperties2.errors.txt index d47e50db85384..759eadeb52a9c 100644 --- a/tests/baselines/reference/destructuringParameterProperties2.errors.txt +++ b/tests/baselines/reference/destructuringParameterProperties2.errors.txt @@ -5,8 +5,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(4 tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(9,21): error TS2339: Property 'a' does not exist on type 'C1'. tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(13,21): error TS2339: Property 'b' does not exist on type 'C1'. tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(17,21): error TS2339: Property 'c' does not exist on type 'C1'. -tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(21,27): error TS2345: Argument of type '[number, undefined, ""]' is not assignable to parameter of type '[number, string, boolean]'. - Type '""' is not assignable to type 'boolean'. +tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(21,27): error TS2345: Argument of type '[0, undefined, string]' is not assignable to parameter of type '[number, string, boolean]'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts (8 errors) ==== @@ -46,8 +46,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterProperties2.ts(2 var x = new C1(undefined, [0, undefined, ""]); ~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, undefined, ""]' is not assignable to parameter of type '[number, string, boolean]'. -!!! error TS2345: Type '""' is not assignable to type 'boolean'. +!!! error TS2345: Argument of type '[0, undefined, string]' is not assignable to parameter of type '[number, string, boolean]'. +!!! error TS2345: Type 'string' is not assignable to type 'boolean'. var [x_a, x_b, x_c] = [x.getA(), x.getB(), x.getC()]; var y = new C1(10, [0, "", true]); diff --git a/tests/baselines/reference/destructuringParameterProperties2.types b/tests/baselines/reference/destructuringParameterProperties2.types index 3b9ea8d273f3a..4bbc487d937a0 100644 --- a/tests/baselines/reference/destructuringParameterProperties2.types +++ b/tests/baselines/reference/destructuringParameterProperties2.types @@ -103,7 +103,7 @@ var y = new C1(10, [0, "", true]); >new C1(10, [0, "", true]) : C1 >C1 : typeof C1 >10 : 10 ->[0, "", true] : [number, string, true] +>[0, "", true] : [0, "", true] >0 : 0 >"" : "" >true : true @@ -131,7 +131,7 @@ var z = new C1(10, [undefined, "", null]); >new C1(10, [undefined, "", null]) : C1 >C1 : typeof C1 >10 : 10 ->[undefined, "", null] : [undefined, string, null] +>[undefined, "", null] : [undefined, "", null] >undefined : undefined >"" : "" >null : null diff --git a/tests/baselines/reference/destructuringParameterProperties3.types b/tests/baselines/reference/destructuringParameterProperties3.types index 34c683941c7ad..af8a301beb10a 100644 --- a/tests/baselines/reference/destructuringParameterProperties3.types +++ b/tests/baselines/reference/destructuringParameterProperties3.types @@ -82,7 +82,7 @@ var x = new C1(undefined, [0, true, ""]); >new C1(undefined, [0, true, ""]) : C1 >C1 : typeof C1 >undefined : undefined ->[0, true, ""] : [number, true, string] +>[0, true, ""] : [0, true, ""] >0 : 0 >true : true >"" : "" @@ -110,7 +110,7 @@ var y = new C1(10, [0, true, true]); >new C1(10, [0, true, true]) : C1 >C1 : typeof C1 >10 : 10 ->[0, true, true] : [number, true, true] +>[0, true, true] : [0, true, true] >0 : 0 >true : true >true : true @@ -138,7 +138,7 @@ var z = new C1(10, [undefined, "", ""]); >new C1(10, [undefined, "", ""]) : C1<10, string, string> >C1 : typeof C1 >10 : 10 ->[undefined, "", ""] : [undefined, string, string] +>[undefined, "", ""] : [undefined, "", ""] >undefined : undefined >"" : "" >"" : "" diff --git a/tests/baselines/reference/destructuringTypeGuardFlow.types b/tests/baselines/reference/destructuringTypeGuardFlow.types index e04dfa645c9ca..58fd616a2a006 100644 --- a/tests/baselines/reference/destructuringTypeGuardFlow.types +++ b/tests/baselines/reference/destructuringTypeGuardFlow.types @@ -24,13 +24,13 @@ type foo = { const aFoo: foo = { bar: 3, baz: "b", nested: { a: 1, b: "y" } }; >aFoo : foo >foo : foo ->{ bar: 3, baz: "b", nested: { a: 1, b: "y" } } : { bar: number; baz: string; nested: { a: number; b: string; }; } +>{ bar: 3, baz: "b", nested: { a: 1, b: "y" } } : { bar: 3; baz: "b"; nested: { a: 1; b: "y"; }; } >bar : number >3 : 3 >baz : string >"b" : "b" ->nested : { a: number; b: string; } ->{ a: 1, b: "y" } : { a: number; b: string; } +>nested : { a: 1; b: "y"; } +>{ a: 1, b: "y" } : { a: 1; b: "y"; } >a : number >1 : 1 >b : string diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types index 6f95b19843409..789a73a917eb2 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types @@ -6,7 +6,7 @@ var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } >a2 : string >a1 : number >a2 : string ->{ a1: 10, a2: "world" } : { a1: number; a2: string; } +>{ a1: 10, a2: "world" } : { a1: 10; a2: "world"; } >a1 : number >10 : 10 >a2 : string @@ -16,10 +16,10 @@ var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; >a3 : number >a4 : string >a5 : boolean ->[1, [["hello"]], true] : [number, [[string]], true] +>[1, [["hello"]], true] : [1, [["hello"]], true] >1 : 1 ->[["hello"]] : [[string]] ->["hello"] : [string] +>[["hello"]] : [["hello"]] +>["hello"] : ["hello"] >"hello" : "hello" >true : true @@ -31,9 +31,9 @@ var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; >{ b11: "string" } : { b11: string; } >b11 : string >"string" : "string" ->{ b1: { b11: "world" } } : { b1?: { b11: string; }; } ->b1 : { b11: string; } ->{ b11: "world" } : { b11: string; } +>{ b1: { b11: "world" } } : { b1?: { b11: "world"; }; } +>b1 : { b11: "world"; } +>{ b11: "world" } : { b11: "world"; } >b11 : string >"world" : "world" @@ -52,19 +52,19 @@ var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >true : true >b4 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } ->[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] +>[3, false, { t1: false, t2: "hello" }] : [3, false, { t1: false; t2: "hello"; }] >3 : 3 >false : false ->{ t1: false, t2: "hello" } : { t1: false; t2: string; } +>{ t1: false, t2: "hello" } : { t1: false; t2: "hello"; } >t1 : boolean >false : false >t2 : string >"hello" : "hello" var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : 3 +>b5 : number >3 : 3 ->b6 : true +>b6 : boolean >true : true >b7 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } @@ -132,12 +132,12 @@ var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; >1000 : 1000 >b4 : number >200 : 200 ->{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } ->e : [number, number, { b1: number; b4: number; }] ->[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] +>{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: 4; b4: 0; }]; } +>e : [number, number, { b1: 4; b4: 0; }] +>[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: 4; b4: 0; }] >1 : 1 >2 : 2 ->{ b1: 4, b4: 0 } : { b1: number; b4: number; } +>{ b1: 4, b4: 0 } : { b1: 4; b4: 0; } >b1 : number >4 : 4 >b4 : number @@ -189,11 +189,11 @@ var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } >null : null >h : { h1: number[]; } >h1 : number[] ->{ h: { h1: [1, 2] } } : { h: { h1: number[]; }; } ->h : { h1: number[]; } ->{ h1: [1, 2] } : { h1: number[]; } ->h1 : number[] ->[1, 2] : number[] +>{ h: { h1: [1, 2] } } : { h: { h1: (1 | 2)[]; }; } +>h : { h1: (1 | 2)[]; } +>{ h1: [1, 2] } : { h1: (1 | 2)[]; } +>h1 : (1 | 2)[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.types index 6ef4c3d574979..461785c626925 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.types @@ -6,7 +6,7 @@ var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } >a2 : string >a1 : number >a2 : string ->{ a1: 10, a2: "world" } : { a1: number; a2: string; } +>{ a1: 10, a2: "world" } : { a1: 10; a2: "world"; } >a1 : number >10 : 10 >a2 : string @@ -16,10 +16,10 @@ var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; >a3 : number >a4 : string >a5 : boolean ->[1, [["hello"]], true] : [number, [[string]], true] +>[1, [["hello"]], true] : [1, [["hello"]], true] >1 : 1 ->[["hello"]] : [[string]] ->["hello"] : [string] +>[["hello"]] : [["hello"]] +>["hello"] : ["hello"] >"hello" : "hello" >true : true @@ -31,9 +31,9 @@ var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; >{ b11: "string" } : { b11: string; } >b11 : string >"string" : "string" ->{ b1: { b11: "world" } } : { b1?: { b11: string; }; } ->b1 : { b11: string; } ->{ b11: "world" } : { b11: string; } +>{ b1: { b11: "world" } } : { b1?: { b11: "world"; }; } +>b1 : { b11: "world"; } +>{ b11: "world" } : { b11: "world"; } >b11 : string >"world" : "world" @@ -52,19 +52,19 @@ var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >true : true >b4 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } ->[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] +>[3, false, { t1: false, t2: "hello" }] : [3, false, { t1: false; t2: "hello"; }] >3 : 3 >false : false ->{ t1: false, t2: "hello" } : { t1: false; t2: string; } +>{ t1: false, t2: "hello" } : { t1: false; t2: "hello"; } >t1 : boolean >false : false >t2 : string >"hello" : "hello" var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : 3 +>b5 : number >3 : 3 ->b6 : true +>b6 : boolean >true : true >b7 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } @@ -132,12 +132,12 @@ var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; >1000 : 1000 >b4 : number >200 : 200 ->{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } ->e : [number, number, { b1: number; b4: number; }] ->[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] +>{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: 4; b4: 0; }]; } +>e : [number, number, { b1: 4; b4: 0; }] +>[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: 4; b4: 0; }] >1 : 1 >2 : 2 ->{ b1: 4, b4: 0 } : { b1: number; b4: number; } +>{ b1: 4, b4: 0 } : { b1: 4; b4: 0; } >b1 : number >4 : 4 >b4 : number @@ -189,11 +189,11 @@ var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } >null : null >h : { h1: number[]; } >h1 : number[] ->{ h: { h1: [1, 2] } } : { h: { h1: number[]; }; } ->h : { h1: number[]; } ->{ h1: [1, 2] } : { h1: number[]; } ->h1 : number[] ->[1, 2] : number[] +>{ h: { h1: [1, 2] } } : { h: { h1: (1 | 2)[]; }; } +>h : { h1: (1 | 2)[]; } +>{ h1: [1, 2] } : { h1: (1 | 2)[]; } +>h1 : (1 | 2)[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types index d01326991c0d4..7264d5bb4b9b7 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types @@ -6,7 +6,7 @@ var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } >a2 : string >a1 : number >a2 : string ->{ a1: 10, a2: "world" } : { a1: number; a2: string; } +>{ a1: 10, a2: "world" } : { a1: 10; a2: "world"; } >a1 : number >10 : 10 >a2 : string @@ -16,10 +16,10 @@ var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; >a3 : number >a4 : string >a5 : boolean ->[1, [["hello"]], true] : [number, [[string]], true] +>[1, [["hello"]], true] : [1, [["hello"]], true] >1 : 1 ->[["hello"]] : [[string]] ->["hello"] : [string] +>[["hello"]] : [["hello"]] +>["hello"] : ["hello"] >"hello" : "hello" >true : true @@ -31,9 +31,9 @@ var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; >{ b11: "string" } : { b11: string; } >b11 : string >"string" : "string" ->{ b1: { b11: "world" } } : { b1?: { b11: string; }; } ->b1 : { b11: string; } ->{ b11: "world" } : { b11: string; } +>{ b1: { b11: "world" } } : { b1?: { b11: "world"; }; } +>b1 : { b11: "world"; } +>{ b11: "world" } : { b11: "world"; } >b11 : string >"world" : "world" @@ -52,19 +52,19 @@ var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; >true : true >b4 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } ->[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] +>[3, false, { t1: false, t2: "hello" }] : [3, false, { t1: false; t2: "hello"; }] >3 : 3 >false : false ->{ t1: false, t2: "hello" } : { t1: false; t2: string; } +>{ t1: false, t2: "hello" } : { t1: false; t2: "hello"; } >t1 : boolean >false : false >t2 : string >"hello" : "hello" var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : 3 +>b5 : number >3 : 3 ->b6 : true +>b6 : boolean >true : true >b7 : { t1: boolean; t2: string; } >temp : { t1: boolean; t2: string; } @@ -132,12 +132,12 @@ var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; >1000 : 1000 >b4 : number >200 : 200 ->{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } ->e : [number, number, { b1: number; b4: number; }] ->[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] +>{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: 4; b4: 0; }]; } +>e : [number, number, { b1: 4; b4: 0; }] +>[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: 4; b4: 0; }] >1 : 1 >2 : 2 ->{ b1: 4, b4: 0 } : { b1: number; b4: number; } +>{ b1: 4, b4: 0 } : { b1: 4; b4: 0; } >b1 : number >4 : 4 >b4 : number @@ -189,11 +189,11 @@ var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } >null : null >h : { h1: number[]; } >h1 : number[] ->{ h: { h1: [1, 2] } } : { h: { h1: number[]; }; } ->h : { h1: number[]; } ->{ h1: [1, 2] } : { h1: number[]; } ->h1 : number[] ->[1, 2] : number[] +>{ h: { h1: [1, 2] } } : { h: { h1: (1 | 2)[]; }; } +>h : { h1: (1 | 2)[]; } +>{ h1: [1, 2] } : { h1: (1 | 2)[]; } +>h1 : (1 | 2)[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt index c831b10a467fb..c9b72856b4637 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt +++ b/tests/baselines/reference/destructuringVariableDeclaration2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(3,5): error TS2322: Type '{ a1: boolean; a2: number; }' is not assignable to type '{ a1: number; a2: string; }'. Types of property 'a1' are incompatible. Type 'boolean' is not assignable to type 'number'. -tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,5): error TS2322: Type '[number, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. +tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(4,5): error TS2322: Type '[1, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. Type '[[boolean]]' is not assignable to type '[[string]]'. Type '[boolean]' is not assignable to type '[string]'. Type 'boolean' is not assignable to type 'string'. @@ -19,7 +19,7 @@ tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration2.ts(1 !!! error TS2322: Type 'boolean' is not assignable to type 'number'. var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // Error ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '[number, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. +!!! error TS2322: Type '[1, [[boolean]], true]' is not assignable to type '[number, [[string]], boolean]'. !!! error TS2322: Type '[[boolean]]' is not assignable to type '[[string]]'. !!! error TS2322: Type '[boolean]' is not assignable to type '[string]'. !!! error TS2322: Type 'boolean' is not assignable to type 'string'. diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.types b/tests/baselines/reference/destructuringVariableDeclaration2.types index 2a977ee73f457..b6d1d9bd57c7d 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.types +++ b/tests/baselines/reference/destructuringVariableDeclaration2.types @@ -16,7 +16,7 @@ var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [[false]], true]; // >a3 : number >a4 : string >a5 : boolean ->[1, [[false]], true] : [number, [[boolean]], true] +>[1, [[false]], true] : [1, [[boolean]], true] >1 : 1 >[[false]] : [[boolean]] >[false] : [boolean] @@ -40,7 +40,7 @@ var [b0 = 3, b1 = true, b2 = temp] = [3, false, { t1: false, t2: 5}]; // Error >true : true >b2 : { t1: boolean; t2: string; } | { t1: false; t2: number; } >temp : { t1: boolean; t2: string; } ->[3, false, { t1: false, t2: 5}] : [number, false, { t1: false; t2: number; }] +>[3, false, { t1: false, t2: 5}] : [3, false, { t1: false; t2: number; }] >3 : 3 >false : false >{ t1: false, t2: 5} : { t1: false; t2: number; } @@ -80,11 +80,11 @@ var {d: {d1 = ["string", null]}}: { d: { d1: number[] } } = { d: { d1: [1, 2] } >null : null >d : { d1: number[]; } >d1 : number[] ->{ d: { d1: [1, 2] } } : { d: { d1: number[]; }; } ->d : { d1: number[]; } ->{ d1: [1, 2] } : { d1: number[]; } ->d1 : number[] ->[1, 2] : number[] +>{ d: { d1: [1, 2] } } : { d: { d1: (1 | 2)[]; }; } +>d : { d1: (1 | 2)[]; } +>{ d1: [1, 2] } : { d1: (1 | 2)[]; } +>d1 : (1 | 2)[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/destructuringWithLiteralInitializers.types b/tests/baselines/reference/destructuringWithLiteralInitializers.types index 51c432f7605b7..24c968441423e 100644 --- a/tests/baselines/reference/destructuringWithLiteralInitializers.types +++ b/tests/baselines/reference/destructuringWithLiteralInitializers.types @@ -31,7 +31,7 @@ f2({ x: 1 }); f2({ x: 1, y: 1 }); >f2({ x: 1, y: 1 }) : void >f2 : ({ x, y }: { x: any; y?: number; }) => void ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ x: 1, y: 1 } : { x: number; y: 1; } >x : number >1 : 1 >y : number @@ -53,21 +53,21 @@ f3({}); f3({ x: 1 }); >f3({ x: 1 }) : void >f3 : ({ x, y }: { x?: number; y?: number; }) => void ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 f3({ y: 1 }); >f3({ y: 1 }) : void >f3 : ({ x, y }: { x?: number; y?: number; }) => void ->{ y: 1 } : { y: number; } +>{ y: 1 } : { y: 1; } >y : number >1 : 1 f3({ x: 1, y: 1 }); >f3({ x: 1, y: 1 }) : void >f3 : ({ x, y }: { x?: number; y?: number; }) => void ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ x: 1, y: 1 } : { x: 1; y: 1; } >x : number >1 : 1 >y : number @@ -91,7 +91,7 @@ f4(); f4({ x: 1, y: 1 }); >f4({ x: 1, y: 1 }) : void >f4 : ({ x, y }?: { x: number; y: number; }) => void ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ x: 1, y: 1 } : { x: 1; y: 1; } >x : number >1 : 1 >y : number @@ -114,14 +114,14 @@ f5(); f5({ x: 1 }); >f5({ x: 1 }) : void >f5 : ({ x, y }?: { x: number; y?: number; }) => void ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 f5({ x: 1, y: 1 }); >f5({ x: 1, y: 1 }) : void >f5 : ({ x, y }?: { x: number; y?: number; }) => void ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ x: 1, y: 1 } : { x: 1; y: 1; } >x : number >1 : 1 >y : number @@ -148,21 +148,21 @@ f6({}); f6({ x: 1 }); >f6({ x: 1 }) : void >f6 : ({ x, y }?: { x?: number; y?: number; }) => void ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 f6({ y: 1 }); >f6({ y: 1 }) : void >f6 : ({ x, y }?: { x?: number; y?: number; }) => void ->{ y: 1 } : { y: number; } +>{ y: 1 } : { y: 1; } >y : number >1 : 1 f6({ x: 1, y: 1 }); >f6({ x: 1, y: 1 }) : void >f6 : ({ x, y }?: { x?: number; y?: number; }) => void ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ x: 1, y: 1 } : { x: 1; y: 1; } >x : number >1 : 1 >y : number @@ -194,27 +194,27 @@ f7({ a: {} }); f7({ a: { x: 1 } }); >f7({ a: { x: 1 } }) : void >f7 : ({ a: { x, y } }?: { a: { x?: number; y?: number; }; }) => void ->{ a: { x: 1 } } : { a: { x: number; }; } ->a : { x: number; } ->{ x: 1 } : { x: number; } +>{ a: { x: 1 } } : { a: { x: 1; }; } +>a : { x: 1; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 f7({ a: { y: 1 } }); >f7({ a: { y: 1 } }) : void >f7 : ({ a: { x, y } }?: { a: { x?: number; y?: number; }; }) => void ->{ a: { y: 1 } } : { a: { y: number; }; } ->a : { y: number; } ->{ y: 1 } : { y: number; } +>{ a: { y: 1 } } : { a: { y: 1; }; } +>a : { y: 1; } +>{ y: 1 } : { y: 1; } >y : number >1 : 1 f7({ a: { x: 1, y: 1 } }); >f7({ a: { x: 1, y: 1 } }) : void >f7 : ({ a: { x, y } }?: { a: { x?: number; y?: number; }; }) => void ->{ a: { x: 1, y: 1 } } : { a: { x: number; y: number; }; } ->a : { x: number; y: number; } ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ a: { x: 1, y: 1 } } : { a: { x: 1; y: 1; }; } +>a : { x: 1; y: 1; } +>{ x: 1, y: 1 } : { x: 1; y: 1; } >x : number >1 : 1 >y : number @@ -244,7 +244,7 @@ function g2([x = 0, y = 0]) { } g2([1, 1]); >g2([1, 1]) : void >g2 : ([x, y]: [number, number]) => void ->[1, 1] : [number, number] +>[1, 1] : [1, 1] >1 : 1 >1 : 1 @@ -264,7 +264,7 @@ g3(); g3([1, 1]); >g3([1, 1]) : void >g3 : ([x, y]?: [number, number]) => void ->[1, 1] : [number, number] +>[1, 1] : [1, 1] >1 : 1 >1 : 1 @@ -284,7 +284,7 @@ g4(); g4([1, 1]); >g4([1, 1]) : void >g4 : ([x, y]?: [number, number]) => void ->[1, 1] : [number, number] +>[1, 1] : [1, 1] >1 : 1 >1 : 1 @@ -304,7 +304,7 @@ g5(); g5([1, 1]); >g5([1, 1]) : void >g5 : ([x, y]?: [number, number]) => void ->[1, 1] : [number, number] +>[1, 1] : [1, 1] >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types index d61bd343c64e6..ab612fd740f0d 100644 --- a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.types @@ -21,10 +21,10 @@ interface IIntervalTreeNode { var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // was error here because best common type is {} >test : IIntervalTreeNode[] >IIntervalTreeNode : IIntervalTreeNode ->[{ interval: { begin: 0 }, children: null }] : { interval: { begin: number; }; children: null; }[] ->{ interval: { begin: 0 }, children: null } : { interval: { begin: number; }; children: null; } ->interval : { begin: number; } ->{ begin: 0 } : { begin: number; } +>[{ interval: { begin: 0 }, children: null }] : { interval: { begin: 0; }; children: null; }[] +>{ interval: { begin: 0 }, children: null } : { interval: { begin: 0; }; children: null; } +>interval : { begin: 0; } +>{ begin: 0 } : { begin: 0; } >begin : number >0 : 0 >children : null diff --git a/tests/baselines/reference/doubleUnderscoreMappedTypes.types b/tests/baselines/reference/doubleUnderscoreMappedTypes.types index 6cac09578eef3..42fe30467b53b 100644 --- a/tests/baselines/reference/doubleUnderscoreMappedTypes.types +++ b/tests/baselines/reference/doubleUnderscoreMappedTypes.types @@ -13,7 +13,7 @@ interface Properties { const ok: Properties = { >ok : Properties >Properties : Properties ->{ property1: "", __property2: ""} : { property1: string; __property2: string; } +>{ property1: "", __property2: ""} : { property1: ""; __property2: ""; } property1: "", >property1 : string @@ -45,7 +45,7 @@ const partial: Partial = { >partial : Partial >Partial : Partial >Properties : Properties ->{ property1: "", __property2: ""} : { property1: string; __property2: string; } +>{ property1: "", __property2: ""} : { property1: ""; __property2: ""; } property1: "", >property1 : string diff --git a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.types b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.types index 83637f261dee5..3147b8ef29a44 100644 --- a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.types +++ b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES5.types @@ -5,7 +5,7 @@ >({ "1": "one", "2": "two" } as { [key: string]: string })[x] : string >({ "1": "one", "2": "two" } as { [key: string]: string }) : { [key: string]: string; } >{ "1": "one", "2": "two" } as { [key: string]: string } : { [key: string]: string; } ->{ "1": "one", "2": "two" } : { "1": string; "2": string; } +>{ "1": "one", "2": "two" } : { "1": "one"; "2": "two"; } >"one" : "one" >"two" : "two" >key : string @@ -17,7 +17,7 @@ >({ "1": "one", "2": "two" } as { [key: string]: string }).x : string >({ "1": "one", "2": "two" } as { [key: string]: string }) : { [key: string]: string; } >{ "1": "one", "2": "two" } as { [key: string]: string } : { [key: string]: string; } ->{ "1": "one", "2": "two" } : { "1": string; "2": string; } +>{ "1": "one", "2": "two" } : { "1": "one"; "2": "two"; } >"one" : "one" >"two" : "two" >key : string diff --git a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.types b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.types index f19255cd724eb..fc9d840911d52 100644 --- a/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.types +++ b/tests/baselines/reference/emitAccessExpressionOfCastedObjectLiteralExpressionInArrowFunctionES6.types @@ -5,7 +5,7 @@ >({ "1": "one", "2": "two" } as { [key: string]: string })[x] : string >({ "1": "one", "2": "two" } as { [key: string]: string }) : { [key: string]: string; } >{ "1": "one", "2": "two" } as { [key: string]: string } : { [key: string]: string; } ->{ "1": "one", "2": "two" } : { "1": string; "2": string; } +>{ "1": "one", "2": "two" } : { "1": "one"; "2": "two"; } >"one" : "one" >"two" : "two" >key : string @@ -17,7 +17,7 @@ >({ "1": "one", "2": "two" } as { [key: string]: string }).x : string >({ "1": "one", "2": "two" } as { [key: string]: string }) : { [key: string]: string; } >{ "1": "one", "2": "two" } as { [key: string]: string } : { [key: string]: string; } ->{ "1": "one", "2": "two" } : { "1": string; "2": string; } +>{ "1": "one", "2": "two" } : { "1": "one"; "2": "two"; } >"one" : "one" >"two" : "two" >key : string diff --git a/tests/baselines/reference/emitArrowFunctionES6.types b/tests/baselines/reference/emitArrowFunctionES6.types index 314d5e464b780..0de200385e76b 100644 --- a/tests/baselines/reference/emitArrowFunctionES6.types +++ b/tests/baselines/reference/emitArrowFunctionES6.types @@ -87,12 +87,12 @@ var p8 = ({ a = 1 }) => { }; >1 : 1 var p9 = ({ a: { b = 1 } = { b: 1 } }) => { }; ->p9 : ({ a: { b } }: { a?: { b?: number; }; }) => void ->({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b } }: { a?: { b?: number; }; }) => void +>p9 : ({ a: { b } }: { a?: { b?: 1; }; }) => void +>({ a: { b = 1 } = { b: 1 } }) => { } : ({ a: { b } }: { a?: { b?: 1; }; }) => void >a : any >b : number >1 : 1 ->{ b: 1 } : { b?: number; } +>{ b: 1 } : { b?: 1; } >b : number >1 : 1 diff --git a/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.types b/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.types index b27c5ea05bd8f..18e726de1c3f2 100644 --- a/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.types +++ b/tests/baselines/reference/emitCapturingThisInTupleDestructuring2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/emitCapturingThisInTupleDestructuring2.ts === var array1: [number, number] = [1, 2]; >array1 : [number, number] ->[1, 2] : [number, number] +>[1, 2] : [1, 2] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/errorMessagesIntersectionTypes01.types b/tests/baselines/reference/errorMessagesIntersectionTypes01.types index fae285f3c1321..adb7bf4e0b7a9 100644 --- a/tests/baselines/reference/errorMessagesIntersectionTypes01.types +++ b/tests/baselines/reference/errorMessagesIntersectionTypes01.types @@ -32,7 +32,7 @@ let fooBar: FooBar = mixBar({ >FooBar : FooBar >mixBar({ fooProp: "frizzlebizzle"}) : { fooProp: string; } & Bar >mixBar : (obj: T) => T & Bar ->{ fooProp: "frizzlebizzle"} : { fooProp: string; } +>{ fooProp: "frizzlebizzle"} : { fooProp: "frizzlebizzle"; } fooProp: "frizzlebizzle" >fooProp : string diff --git a/tests/baselines/reference/errorMessagesIntersectionTypes02.types b/tests/baselines/reference/errorMessagesIntersectionTypes02.types index 6c77fd51bdc06..87ebaccf9e5bd 100644 --- a/tests/baselines/reference/errorMessagesIntersectionTypes02.types +++ b/tests/baselines/reference/errorMessagesIntersectionTypes02.types @@ -32,7 +32,7 @@ let fooBar: FooBar = mixBar({ >FooBar : FooBar >mixBar({ fooProp: "frizzlebizzle"}) : { fooProp: string; } & Bar >mixBar : (obj: T) => T & Bar ->{ fooProp: "frizzlebizzle"} : { fooProp: string; } +>{ fooProp: "frizzlebizzle"} : { fooProp: "frizzlebizzle"; } fooProp: "frizzlebizzle" >fooProp : string diff --git a/tests/baselines/reference/escapedIdentifiers.types b/tests/baselines/reference/escapedIdentifiers.types index ef6c0983d3985..3029b068ca7d0 100644 --- a/tests/baselines/reference/escapedIdentifiers.types +++ b/tests/baselines/reference/escapedIdentifiers.types @@ -158,7 +158,7 @@ var interfaceType1Object1 = { bar1: 0 }; >interfaceType1Object1 : interfaceType1 >{ bar1: 0 } : interfaceType1 >interfaceType1 : interfaceType1 ->{ bar1: 0 } : { bar1: number; } +>{ bar1: 0 } : { bar1: 0; } >bar1 : number >0 : 0 @@ -173,7 +173,7 @@ var interfaceType1Object2 = { bar1: 0 }; >interfaceType1Object2 : interfaceType1 >{ bar1: 0 } : interfaceType1 >interfaceType\u0031 : interfaceType1 ->{ bar1: 0 } : { bar1: number; } +>{ bar1: 0 } : { bar1: 0; } >bar1 : number >0 : 0 @@ -188,7 +188,7 @@ var interfaceType2Object1 = { bar2: 0 }; >interfaceType2Object1 : interfaceType\u0032 >{ bar2: 0 } : interfaceType\u0032 >interfaceType2 : interfaceType\u0032 ->{ bar2: 0 } : { bar2: number; } +>{ bar2: 0 } : { bar2: 0; } >bar2 : number >0 : 0 @@ -203,7 +203,7 @@ var interfaceType2Object2 = { bar2: 0 }; >interfaceType2Object2 : interfaceType\u0032 >{ bar2: 0 } : interfaceType\u0032 >interfaceType\u0032 : interfaceType\u0032 ->{ bar2: 0 } : { bar2: number; } +>{ bar2: 0 } : { bar2: 0; } >bar2 : number >0 : 0 diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types index d1843aebb1ab0..b5a868e45c4a2 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types @@ -112,7 +112,7 @@ var aGenericClass: D = new D(); var anObjectLiteral: I = { id: 12 }; >anObjectLiteral : I >I : I ->{ id: 12 } : { id: number; } +>{ id: 12 } : { id: 12; } >id : number >12 : 12 @@ -135,7 +135,7 @@ var anOtherFunction: (x: string) => number = F; var aLambda: typeof F = (x) => 2; >aLambda : (x: string) => number >F : (x: string) => number ->(x) => 2 : (x: string) => number +>(x) => 2 : (x: string) => 2 >x : string >2 : 2 @@ -158,7 +158,7 @@ var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; >M.F2 : (x: number) => string >M : typeof M >F2 : (x: number) => string ->(x) => 'this is a string' : (x: number) => string +>(x) => 'this is a string' : (x: number) => "this is a string" >x : number >'this is a string' : "this is a string" diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt index d802733354e57..eb4a0db668618 100644 --- a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt @@ -5,9 +5,9 @@ tests/cases/compiler/excessPropertyCheckWithUnions.ts(11,21): error TS2322: Type tests/cases/compiler/excessPropertyCheckWithUnions.ts(12,1): error TS2322: Type '{ tag: "D"; }' is not assignable to type 'ADT'. Type '{ tag: "D"; }' is not assignable to type '{ tag: "D"; d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20; }'. Property 'd20' is missing in type '{ tag: "D"; }'. -tests/cases/compiler/excessPropertyCheckWithUnions.ts(33,28): error TS2322: Type '{ tag: "A"; x: string; extra: number; }' is not assignable to type 'Ambiguous'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(33,28): error TS2322: Type '{ tag: "A"; x: "hi"; extra: number; }' is not assignable to type 'Ambiguous'. Object literal may only specify known properties, and 'extra' does not exist in type 'Ambiguous'. -tests/cases/compiler/excessPropertyCheckWithUnions.ts(34,26): error TS2322: Type '{ tag: "A"; y: number; extra: number; }' is not assignable to type 'Ambiguous'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(34,26): error TS2322: Type '{ tag: "A"; y: 12; extra: number; }' is not assignable to type 'Ambiguous'. Object literal may only specify known properties, and 'extra' does not exist in type 'Ambiguous'. tests/cases/compiler/excessPropertyCheckWithUnions.ts(39,1): error TS2322: Type '{ tag: "A"; }' is not assignable to type 'Ambiguous'. Type '{ tag: "A"; }' is not assignable to type '{ tag: "C"; }'. @@ -17,9 +17,9 @@ tests/cases/compiler/excessPropertyCheckWithUnions.ts(40,1): error TS2322: Type Type '{ tag: "A"; z: true; }' is not assignable to type '{ tag: "C"; }'. Types of property 'tag' are incompatible. Type '"A"' is not assignable to type '"C"'. -tests/cases/compiler/excessPropertyCheckWithUnions.ts(49,35): error TS2322: Type '{ a: 1; b: 1; first: string; second: string; }' is not assignable to type 'Overlapping'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(49,35): error TS2322: Type '{ a: 1; b: 1; first: "ok"; second: string; }' is not assignable to type 'Overlapping'. Object literal may only specify known properties, and 'second' does not exist in type '{ a: 1; b: 1; first: string; }'. -tests/cases/compiler/excessPropertyCheckWithUnions.ts(50,35): error TS2322: Type '{ a: 1; b: 1; first: string; third: string; }' is not assignable to type 'Overlapping'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(50,35): error TS2322: Type '{ a: 1; b: 1; first: "ok"; third: string; }' is not assignable to type 'Overlapping'. Object literal may only specify known properties, and 'third' does not exist in type '{ a: 1; b: 1; first: string; }'. @@ -68,11 +68,11 @@ tests/cases/compiler/excessPropertyCheckWithUnions.ts(50,35): error TS2322: Type // correctly error on excess property 'extra', even when ambiguous amb = { tag: "A", x: "hi", extra: 12 } ~~~~~~~~~ -!!! error TS2322: Type '{ tag: "A"; x: string; extra: number; }' is not assignable to type 'Ambiguous'. +!!! error TS2322: Type '{ tag: "A"; x: "hi"; extra: number; }' is not assignable to type 'Ambiguous'. !!! error TS2322: Object literal may only specify known properties, and 'extra' does not exist in type 'Ambiguous'. amb = { tag: "A", y: 12, extra: 12 } ~~~~~~~~~ -!!! error TS2322: Type '{ tag: "A"; y: number; extra: number; }' is not assignable to type 'Ambiguous'. +!!! error TS2322: Type '{ tag: "A"; y: 12; extra: number; }' is not assignable to type 'Ambiguous'. !!! error TS2322: Object literal may only specify known properties, and 'extra' does not exist in type 'Ambiguous'. // assignability errors still work. @@ -100,11 +100,11 @@ tests/cases/compiler/excessPropertyCheckWithUnions.ts(50,35): error TS2322: Type // these two are still errors despite their doubled up discriminants over = { a: 1, b: 1, first: "ok", second: "error" } ~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ a: 1; b: 1; first: string; second: string; }' is not assignable to type 'Overlapping'. +!!! error TS2322: Type '{ a: 1; b: 1; first: "ok"; second: string; }' is not assignable to type 'Overlapping'. !!! error TS2322: Object literal may only specify known properties, and 'second' does not exist in type '{ a: 1; b: 1; first: string; }'. over = { a: 1, b: 1, first: "ok", third: "error" } ~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ a: 1; b: 1; first: string; third: string; }' is not assignable to type 'Overlapping'. +!!! error TS2322: Type '{ a: 1; b: 1; first: "ok"; third: string; }' is not assignable to type 'Overlapping'. !!! error TS2322: Object literal may only specify known properties, and 'third' does not exist in type '{ a: 1; b: 1; first: string; }'. // Freshness disappears after spreading a union diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.types b/tests/baselines/reference/excessPropertyCheckWithUnions.types index 212eccbe2ff3b..c1dc08f9774ad 100644 --- a/tests/baselines/reference/excessPropertyCheckWithUnions.types +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.types @@ -77,27 +77,27 @@ let amb: Ambiguous // no error for ambiguous tag, even when it could satisfy both constituents at once amb = { tag: "A", x: "hi" } ->amb = { tag: "A", x: "hi" } : { tag: "A"; x: string; } +>amb = { tag: "A", x: "hi" } : { tag: "A"; x: "hi"; } >amb : Ambiguous ->{ tag: "A", x: "hi" } : { tag: "A"; x: string; } +>{ tag: "A", x: "hi" } : { tag: "A"; x: "hi"; } >tag : string >"A" : "A" >x : string >"hi" : "hi" amb = { tag: "A", y: 12 } ->amb = { tag: "A", y: 12 } : { tag: "A"; y: number; } +>amb = { tag: "A", y: 12 } : { tag: "A"; y: 12; } >amb : Ambiguous ->{ tag: "A", y: 12 } : { tag: "A"; y: number; } +>{ tag: "A", y: 12 } : { tag: "A"; y: 12; } >tag : string >"A" : "A" >y : number >12 : 12 amb = { tag: "A", x: "hi", y: 12 } ->amb = { tag: "A", x: "hi", y: 12 } : { tag: "A"; x: string; y: number; } +>amb = { tag: "A", x: "hi", y: 12 } : { tag: "A"; x: "hi"; y: 12; } >amb : Ambiguous ->{ tag: "A", x: "hi", y: 12 } : { tag: "A"; x: string; y: number; } +>{ tag: "A", x: "hi", y: 12 } : { tag: "A"; x: "hi"; y: 12; } >tag : string >"A" : "A" >x : string @@ -107,9 +107,9 @@ amb = { tag: "A", x: "hi", y: 12 } // correctly error on excess property 'extra', even when ambiguous amb = { tag: "A", x: "hi", extra: 12 } ->amb = { tag: "A", x: "hi", extra: 12 } : { tag: "A"; x: string; extra: number; } +>amb = { tag: "A", x: "hi", extra: 12 } : { tag: "A"; x: "hi"; extra: number; } >amb : Ambiguous ->{ tag: "A", x: "hi", extra: 12 } : { tag: "A"; x: string; extra: number; } +>{ tag: "A", x: "hi", extra: 12 } : { tag: "A"; x: "hi"; extra: number; } >tag : string >"A" : "A" >x : string @@ -118,9 +118,9 @@ amb = { tag: "A", x: "hi", extra: 12 } >12 : 12 amb = { tag: "A", y: 12, extra: 12 } ->amb = { tag: "A", y: 12, extra: 12 } : { tag: "A"; y: number; extra: number; } +>amb = { tag: "A", y: 12, extra: 12 } : { tag: "A"; y: 12; extra: number; } >amb : Ambiguous ->{ tag: "A", y: 12, extra: 12 } : { tag: "A"; y: number; extra: number; } +>{ tag: "A", y: 12, extra: 12 } : { tag: "A"; y: 12; extra: number; } >tag : string >"A" : "A" >y : number @@ -169,9 +169,9 @@ let over: Overlapping // these two are still errors despite their doubled up discriminants over = { a: 1, b: 1, first: "ok", second: "error" } ->over = { a: 1, b: 1, first: "ok", second: "error" } : { a: 1; b: 1; first: string; second: string; } +>over = { a: 1, b: 1, first: "ok", second: "error" } : { a: 1; b: 1; first: "ok"; second: string; } >over : Overlapping ->{ a: 1, b: 1, first: "ok", second: "error" } : { a: 1; b: 1; first: string; second: string; } +>{ a: 1, b: 1, first: "ok", second: "error" } : { a: 1; b: 1; first: "ok"; second: string; } >a : number >1 : 1 >b : number @@ -182,9 +182,9 @@ over = { a: 1, b: 1, first: "ok", second: "error" } >"error" : "error" over = { a: 1, b: 1, first: "ok", third: "error" } ->over = { a: 1, b: 1, first: "ok", third: "error" } : { a: 1; b: 1; first: string; third: string; } +>over = { a: 1, b: 1, first: "ok", third: "error" } : { a: 1; b: 1; first: "ok"; third: string; } >over : Overlapping ->{ a: 1, b: 1, first: "ok", third: "error" } : { a: 1; b: 1; first: string; third: string; } +>{ a: 1, b: 1, first: "ok", third: "error" } : { a: 1; b: 1; first: "ok"; third: string; } >a : number >1 : 1 >b : number diff --git a/tests/baselines/reference/excessPropertyErrorForFunctionTypes.errors.txt b/tests/baselines/reference/excessPropertyErrorForFunctionTypes.errors.txt index 961308059bac7..d88bd3e58615a 100644 --- a/tests/baselines/reference/excessPropertyErrorForFunctionTypes.errors.txt +++ b/tests/baselines/reference/excessPropertyErrorForFunctionTypes.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/excessPropertyErrorForFunctionTypes.ts(4,44): error TS2322: Type '{ a: number; c: number; d: number; }' is not assignable to type 'DoesntWork'. +tests/cases/compiler/excessPropertyErrorForFunctionTypes.ts(4,44): error TS2322: Type '{ a: 1; c: 2; d: number; }' is not assignable to type 'DoesntWork'. Object literal may only specify known properties, and 'd' does not exist in type 'DoesntWork'. @@ -8,5 +8,5 @@ tests/cases/compiler/excessPropertyErrorForFunctionTypes.ts(4,44): error TS2322: let doesntWork: DoesntWork = { a: 1, c: 2, d: 3 } ~~~~ -!!! error TS2322: Type '{ a: number; c: number; d: number; }' is not assignable to type 'DoesntWork'. +!!! error TS2322: Type '{ a: 1; c: 2; d: number; }' is not assignable to type 'DoesntWork'. !!! error TS2322: Object literal may only specify known properties, and 'd' does not exist in type 'DoesntWork'. \ No newline at end of file diff --git a/tests/baselines/reference/excessPropertyErrorForFunctionTypes.types b/tests/baselines/reference/excessPropertyErrorForFunctionTypes.types index e17b0e2ec4c9c..7b665900375ac 100644 --- a/tests/baselines/reference/excessPropertyErrorForFunctionTypes.types +++ b/tests/baselines/reference/excessPropertyErrorForFunctionTypes.types @@ -11,7 +11,7 @@ type DoesntWork = { a: number, c: number } | FunctionType; let doesntWork: DoesntWork = { a: 1, c: 2, d: 3 } >doesntWork : DoesntWork >DoesntWork : DoesntWork ->{ a: 1, c: 2, d: 3 } : { a: number; c: number; d: number; } +>{ a: 1, c: 2, d: 3 } : { a: 1; c: 2; d: number; } >a : number >1 : 1 >c : number diff --git a/tests/baselines/reference/excessPropertyErrorsSuppressed.types b/tests/baselines/reference/excessPropertyErrorsSuppressed.types index e1288e969c109..153390f428995 100644 --- a/tests/baselines/reference/excessPropertyErrorsSuppressed.types +++ b/tests/baselines/reference/excessPropertyErrorsSuppressed.types @@ -2,7 +2,7 @@ var x: { a: string } = { a: "hello", b: 42 }; // No error >x : { a: string; } >a : string ->{ a: "hello", b: 42 } : { a: string; b: number; } +>{ a: "hello", b: 42 } : { a: "hello"; b: number; } >a : string >"hello" : "hello" >b : number diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.types b/tests/baselines/reference/exportAssignmentConstrainedGenericType.types index a8710711e6489..27caf80b0724f 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.types +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.types @@ -9,10 +9,10 @@ var x = new foo(true); // Should error >true : true var y = new foo({a: "test", b: 42}); // Should be OK ->y : foo<{ a: string; b: number; }> ->new foo({a: "test", b: 42}) : foo<{ a: string; b: number; }> +>y : foo<{ a: "test"; b: 42; }> +>new foo({a: "test", b: 42}) : foo<{ a: "test"; b: 42; }> >foo : typeof foo ->{a: "test", b: 42} : { a: string; b: number; } +>{a: "test", b: 42} : { a: "test"; b: 42; } >a : string >"test" : "test" >b : number @@ -20,11 +20,11 @@ var y = new foo({a: "test", b: 42}); // Should be OK var z: number = y.test.b; >z : number ->y.test.b : number ->y.test : { a: string; b: number; } ->y : foo<{ a: string; b: number; }> ->test : { a: string; b: number; } ->b : number +>y.test.b : 42 +>y.test : { a: "test"; b: 42; } +>y : foo<{ a: "test"; b: 42; }> +>test : { a: "test"; b: 42; } +>b : 42 === tests/cases/conformance/externalModules/foo_0.ts === class Foo{ diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule.types b/tests/baselines/reference/exportImportNonInstantiatedModule.types index d43cd69dac703..ae6e873bdbe73 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule.types @@ -21,7 +21,7 @@ var x: B.A1.I = { x: 1 }; >B : any >A1 : any >I : A.I ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.types b/tests/baselines/reference/exportImportNonInstantiatedModule2.types index 9c01926526fde..882ef49bdffb9 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule2.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.types @@ -8,7 +8,7 @@ export function w(): e.w { // Should be OK >w : e.w return {name: 'value' }; ->{name: 'value' } : { name: string; } +>{name: 'value' } : { name: "value"; } >name : string >'value' : "value" } diff --git a/tests/baselines/reference/exportNonVisibleType.types b/tests/baselines/reference/exportNonVisibleType.types index 2bb65cf05f06f..edee13a66bf7c 100644 --- a/tests/baselines/reference/exportNonVisibleType.types +++ b/tests/baselines/reference/exportNonVisibleType.types @@ -12,7 +12,7 @@ interface I1 { var x: I1 = {a: "test", b: 42}; >x : I1 >I1 : I1 ->{a: "test", b: 42} : { a: string; b: number; } +>{a: "test", b: 42} : { a: "test"; b: 42; } >a : string >"test" : "test" >b : number diff --git a/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types b/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types index 161870de77c16..221a8fe3b04e9 100644 --- a/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types +++ b/tests/baselines/reference/fallbackToBindingPatternForTypeInference.types @@ -16,7 +16,7 @@ trans(({a}) => a); trans(([b,c]) => 'foo'); >trans(([b,c]) => 'foo') : number >trans : (f: (x: T) => string) => number ->([b,c]) => 'foo' : ([b, c]: [any, any]) => string +>([b,c]) => 'foo' : ([b, c]: [any, any]) => "foo" >b : any >c : any >'foo' : "foo" @@ -24,7 +24,7 @@ trans(([b,c]) => 'foo'); trans(({d: [e,f]}) => 'foo'); >trans(({d: [e,f]}) => 'foo') : number >trans : (f: (x: T) => string) => number ->({d: [e,f]}) => 'foo' : ({ d: [e, f] }: { d: [any, any]; }) => string +>({d: [e,f]}) => 'foo' : ({ d: [e, f] }: { d: [any, any]; }) => "foo" >d : any >e : any >f : any @@ -33,7 +33,7 @@ trans(({d: [e,f]}) => 'foo'); trans(([{g},{h}]) => 'foo'); >trans(([{g},{h}]) => 'foo') : number >trans : (f: (x: T) => string) => number ->([{g},{h}]) => 'foo' : ([{ g }, { h }]: [{ g: any; }, { h: any; }]) => string +>([{g},{h}]) => 'foo' : ([{ g }, { h }]: [{ g: any; }, { h: any; }]) => "foo" >g : any >h : any >'foo' : "foo" diff --git a/tests/baselines/reference/for-of36.types b/tests/baselines/reference/for-of36.types index 1448c212371c5..7a2ec9d413ccc 100644 --- a/tests/baselines/reference/for-of36.types +++ b/tests/baselines/reference/for-of36.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of36.ts === var tuple: [string, boolean] = ["", true]; >tuple : [string, boolean] ->["", true] : [string, true] +>["", true] : ["", true] >"" : "" >true : true diff --git a/tests/baselines/reference/for-of37.types b/tests/baselines/reference/for-of37.types index 1168921596e11..bd3262d85db77 100644 --- a/tests/baselines/reference/for-of37.types +++ b/tests/baselines/reference/for-of37.types @@ -3,8 +3,8 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, true][] ->["", true] : [string, true] +>[["", true]] : ["", true][] +>["", true] : ["", true] >"" : "" >true : true diff --git a/tests/baselines/reference/for-of38.types b/tests/baselines/reference/for-of38.types index e2201d24394f1..84e83c271a842 100644 --- a/tests/baselines/reference/for-of38.types +++ b/tests/baselines/reference/for-of38.types @@ -3,8 +3,8 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, true][] ->["", true] : [string, true] +>[["", true]] : ["", true][] +>["", true] : ["", true] >"" : "" >true : true diff --git a/tests/baselines/reference/for-of39.errors.txt b/tests/baselines/reference/for-of39.errors.txt index 73802daf5a54e..e98bdd58a2f01 100644 --- a/tests/baselines/reference/for-of39.errors.txt +++ b/tests/baselines/reference/for-of39.errors.txt @@ -1,28 +1,28 @@ -tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,19): error TS2345: Argument of type '([string, true] | [string, 0])[]' is not assignable to parameter of type 'Iterable<[string, boolean]>'. +tests/cases/conformance/es6/for-ofStatements/for-of39.ts(1,19): error TS2345: Argument of type '(["", true] | ["", number])[]' is not assignable to parameter of type 'Iterable<[string, boolean]>'. Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator<[string, true] | [string, 0]>' is not assignable to type '() => Iterator<[string, boolean]>'. - Type 'IterableIterator<[string, true] | [string, 0]>' is not assignable to type 'Iterator<[string, boolean]>'. + Type '() => IterableIterator<["", true] | ["", number]>' is not assignable to type '() => Iterator<[string, boolean]>'. + Type 'IterableIterator<["", true] | ["", number]>' is not assignable to type 'Iterator<[string, boolean]>'. Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult<[string, true] | [string, 0]>' is not assignable to type '(value?: any) => IteratorResult<[string, boolean]>'. - Type 'IteratorResult<[string, true] | [string, 0]>' is not assignable to type 'IteratorResult<[string, boolean]>'. - Type '[string, true] | [string, 0]' is not assignable to type '[string, boolean]'. - Type '[string, 0]' is not assignable to type '[string, boolean]'. - Type '0' is not assignable to type 'boolean'. + Type '(value?: any) => IteratorResult<["", true] | ["", number]>' is not assignable to type '(value?: any) => IteratorResult<[string, boolean]>'. + Type 'IteratorResult<["", true] | ["", number]>' is not assignable to type 'IteratorResult<[string, boolean]>'. + Type '["", true] | ["", number]' is not assignable to type '[string, boolean]'. + Type '["", number]' is not assignable to type '[string, boolean]'. + Type 'number' is not assignable to type 'boolean'. ==== tests/cases/conformance/es6/for-ofStatements/for-of39.ts (1 errors) ==== var map = new Map([["", true], ["", 0]]); ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '([string, true] | [string, 0])[]' is not assignable to parameter of type 'Iterable<[string, boolean]>'. +!!! error TS2345: Argument of type '(["", true] | ["", number])[]' is not assignable to parameter of type 'Iterable<[string, boolean]>'. !!! error TS2345: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2345: Type '() => IterableIterator<[string, true] | [string, 0]>' is not assignable to type '() => Iterator<[string, boolean]>'. -!!! error TS2345: Type 'IterableIterator<[string, true] | [string, 0]>' is not assignable to type 'Iterator<[string, boolean]>'. +!!! error TS2345: Type '() => IterableIterator<["", true] | ["", number]>' is not assignable to type '() => Iterator<[string, boolean]>'. +!!! error TS2345: Type 'IterableIterator<["", true] | ["", number]>' is not assignable to type 'Iterator<[string, boolean]>'. !!! error TS2345: Types of property 'next' are incompatible. -!!! error TS2345: Type '(value?: any) => IteratorResult<[string, true] | [string, 0]>' is not assignable to type '(value?: any) => IteratorResult<[string, boolean]>'. -!!! error TS2345: Type 'IteratorResult<[string, true] | [string, 0]>' is not assignable to type 'IteratorResult<[string, boolean]>'. -!!! error TS2345: Type '[string, true] | [string, 0]' is not assignable to type '[string, boolean]'. -!!! error TS2345: Type '[string, 0]' is not assignable to type '[string, boolean]'. -!!! error TS2345: Type '0' is not assignable to type 'boolean'. +!!! error TS2345: Type '(value?: any) => IteratorResult<["", true] | ["", number]>' is not assignable to type '(value?: any) => IteratorResult<[string, boolean]>'. +!!! error TS2345: Type 'IteratorResult<["", true] | ["", number]>' is not assignable to type 'IteratorResult<[string, boolean]>'. +!!! error TS2345: Type '["", true] | ["", number]' is not assignable to type '[string, boolean]'. +!!! error TS2345: Type '["", number]' is not assignable to type '[string, boolean]'. +!!! error TS2345: Type 'number' is not assignable to type 'boolean'. for (var [k, v] of map) { k; v; diff --git a/tests/baselines/reference/for-of40.types b/tests/baselines/reference/for-of40.types index 4c690ed9ce748..8eb60a652aa71 100644 --- a/tests/baselines/reference/for-of40.types +++ b/tests/baselines/reference/for-of40.types @@ -3,8 +3,8 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, true][] ->["", true] : [string, true] +>[["", true]] : ["", true][] +>["", true] : ["", true] >"" : "" >true : true diff --git a/tests/baselines/reference/for-of43.types b/tests/baselines/reference/for-of43.types index 2327f1bafedde..48466611d20b6 100644 --- a/tests/baselines/reference/for-of43.types +++ b/tests/baselines/reference/for-of43.types @@ -13,7 +13,7 @@ for (var {x: a = "", y: b = true} of array) { >a : string >"" : "" >y : any ->b : number | true +>b : number | boolean >true : true >array : { x: string; y: number; }[] diff --git a/tests/baselines/reference/for-of44.types b/tests/baselines/reference/for-of44.types index 42da734edb97e..5e0f9d76eca03 100644 --- a/tests/baselines/reference/for-of44.types +++ b/tests/baselines/reference/for-of44.types @@ -1,14 +1,14 @@ === tests/cases/conformance/es6/for-ofStatements/for-of44.ts === var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symbol()]] >array : [number, string | boolean | symbol][] ->[[0, ""], [0, true], [1, Symbol()]] : ([number, ""] | [number, true] | [number, symbol])[] ->[0, ""] : [number, ""] +>[[0, ""], [0, true], [1, Symbol()]] : ([0, ""] | [0, true] | [1, symbol])[] +>[0, ""] : [0, ""] >0 : 0 >"" : "" ->[0, true] : [number, true] +>[0, true] : [0, true] >0 : 0 >true : true ->[1, Symbol()] : [number, symbol] +>[1, Symbol()] : [1, symbol] >1 : 1 >Symbol() : symbol >Symbol : SymbolConstructor diff --git a/tests/baselines/reference/for-of45.types b/tests/baselines/reference/for-of45.types index 6e6a0a11bf425..286ae29a6226e 100644 --- a/tests/baselines/reference/for-of45.types +++ b/tests/baselines/reference/for-of45.types @@ -7,8 +7,8 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, true][] ->["", true] : [string, true] +>[["", true]] : ["", true][] +>["", true] : ["", true] >"" : "" >true : true diff --git a/tests/baselines/reference/for-of46.types b/tests/baselines/reference/for-of46.types index 73a91f63b66da..089ade8403e75 100644 --- a/tests/baselines/reference/for-of46.types +++ b/tests/baselines/reference/for-of46.types @@ -7,8 +7,8 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, true][] ->["", true] : [string, true] +>[["", true]] : ["", true][] +>["", true] : ["", true] >"" : "" >true : true diff --git a/tests/baselines/reference/for-of49.types b/tests/baselines/reference/for-of49.types index bed54d205ea36..739c274a594a1 100644 --- a/tests/baselines/reference/for-of49.types +++ b/tests/baselines/reference/for-of49.types @@ -7,8 +7,8 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, true][] ->["", true] : [string, true] +>[["", true]] : ["", true][] +>["", true] : ["", true] >"" : "" >true : true diff --git a/tests/baselines/reference/for-of50.types b/tests/baselines/reference/for-of50.types index 8da0666571106..ad44388923761 100644 --- a/tests/baselines/reference/for-of50.types +++ b/tests/baselines/reference/for-of50.types @@ -3,8 +3,8 @@ var map = new Map([["", true]]); >map : Map >new Map([["", true]]) : Map >Map : MapConstructor ->[["", true]] : [string, true][] ->["", true] : [string, true] +>[["", true]] : ["", true][] +>["", true] : ["", true] >"" : "" >true : true diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types index 7c467d31847e7..e3bcbb4e5e4b3 100644 --- a/tests/baselines/reference/forStatements.types +++ b/tests/baselines/reference/forStatements.types @@ -112,7 +112,7 @@ for(var aGenericClass: D = new D();;){} for(var anObjectLiteral: I = { id: 12 };;){} >anObjectLiteral : I >I : I ->{ id: 12 } : { id: number; } +>{ id: 12 } : { id: 12; } >id : number >12 : 12 @@ -135,7 +135,7 @@ for(var anOtherFunction: (x: string) => number = F;;){} for(var aLambda: typeof F = (x) => 2;;){} >aLambda : (x: string) => number >F : (x: string) => number ->(x) => 2 : (x: string) => number +>(x) => 2 : (x: string) => 2 >x : string >2 : 2 @@ -158,7 +158,7 @@ for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} >M.F2 : (x: number) => string >M : typeof M >F2 : (x: number) => string ->(x) => 'this is a string' : (x: number) => string +>(x) => 'this is a string' : (x: number) => "this is a string" >x : number >'this is a string' : "this is a string" diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.types b/tests/baselines/reference/forStatementsMultipleValidDecl.types index d0950d67924f1..405c2ed309e0b 100644 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.types +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.types @@ -41,7 +41,7 @@ for (var p = { x: 1, y: 2 }; ;) { } for (var p: Point = { x: 0, y: undefined }; ;) { } >p : Point >Point : Point ->{ x: 0, y: undefined } : { x: number; y: undefined; } +>{ x: 0, y: undefined } : { x: 0; y: undefined; } >x : number >0 : 0 >y : undefined @@ -60,7 +60,7 @@ for (var p: { x: number; y: number; } = { x: 1, y: 2 }; ;) { } >p : Point >x : number >y : number ->{ x: 1, y: 2 } : { x: number; y: number; } +>{ x: 1, y: 2 } : { x: 1; y: 2; } >x : number >1 : 1 >y : number @@ -71,7 +71,7 @@ for (var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ;) { } ><{ x: number; y: number; }>{ x: 0, y: undefined } : { x: number; y: number; } >x : number >y : number ->{ x: 0, y: undefined } : { x: number; y: undefined; } +>{ x: 0, y: undefined } : { x: 0; y: undefined; } >x : number >0 : 0 >y : undefined diff --git a/tests/baselines/reference/functionAssignment.types b/tests/baselines/reference/functionAssignment.types index ff2f0a3583a98..4a9abe8e897af 100644 --- a/tests/baselines/reference/functionAssignment.types +++ b/tests/baselines/reference/functionAssignment.types @@ -82,7 +82,7 @@ function f3(a: { a: number; b: number; }) { } f3({ a: 0, b: 0 }); >f3({ a: 0, b: 0 }) : void >f3 : (a: { a: number; b: number; }) => void ->{ a: 0, b: 0 } : { a: number; b: number; } +>{ a: 0, b: 0 } : { a: 0; b: 0; } >a : number >0 : 0 >b : number diff --git a/tests/baselines/reference/functionAssignmentError.types b/tests/baselines/reference/functionAssignmentError.types index 3223a7b40f84e..189b6eddf2df2 100644 --- a/tests/baselines/reference/functionAssignmentError.types +++ b/tests/baselines/reference/functionAssignmentError.types @@ -5,8 +5,8 @@ var func = function (){return "ONE";}; >"ONE" : "ONE" func = function (){return "ONE";}; ->func = function (){return "ONE";} : () => string +>func = function (){return "ONE";} : () => "ONE" >func : () => string ->function (){return "ONE";} : () => string +>function (){return "ONE";} : () => "ONE" >"ONE" : "ONE" diff --git a/tests/baselines/reference/functionExpressionContextualTyping1.types b/tests/baselines/reference/functionExpressionContextualTyping1.types index 58265c74aa29e..e9e6ad66a6d77 100644 --- a/tests/baselines/reference/functionExpressionContextualTyping1.types +++ b/tests/baselines/reference/functionExpressionContextualTyping1.types @@ -14,7 +14,7 @@ var a0: (n: number, s: string) => number = (num, str) => { >a0 : (n: number, s: string) => number >n : number >s : string ->(num, str) => { num.toExponential(); return 0;} : (num: number, str: string) => number +>(num, str) => { num.toExponential(); return 0;} : (num: number, str: string) => 0 >num : number >str : string @@ -41,7 +41,7 @@ var a1: (c: Class) => number = (a1) => { >c : Class >Class : Class >Number : Number ->(a1) => { a1.foo(); return 1;} : (a1: Class) => number +>(a1) => { a1.foo(); return 1;} : (a1: Class) => 1 >a1 : Class a1.foo(); @@ -90,9 +90,9 @@ b2 = (foo, bar) => { return foo + 1; } >1 : 1 b2 = (foo, bar) => { return "hello"; } ->b2 = (foo, bar) => { return "hello"; } : (foo: number, bar: string) => string +>b2 = (foo, bar) => { return "hello"; } : (foo: number, bar: string) => "hello" >b2 : ((n: number, s: string) => number) | ((n: number, s: string) => string) ->(foo, bar) => { return "hello"; } : (foo: number, bar: string) => string +>(foo, bar) => { return "hello"; } : (foo: number, bar: string) => "hello" >foo : number >bar : string >"hello" : "hello" @@ -114,7 +114,7 @@ var b4: (n: E) => string = (number = 1) => { return "hello"; }; >b4 : (n: E) => string >n : E >E : E ->(number = 1) => { return "hello"; } : (number?: E) => string +>(number = 1) => { return "hello"; } : (number?: E) => "hello" >number : E >1 : 1 >"hello" : "hello" @@ -122,7 +122,7 @@ var b4: (n: E) => string = (number = 1) => { return "hello"; }; var b5: (n: {}) => string = (number = "string") => { return "hello"; }; >b5 : (n: {}) => string >n : {} ->(number = "string") => { return "hello"; } : (number?: {}) => string +>(number = "string") => { return "hello"; } : (number?: {}) => "hello" >number : {} >"string" : "string" >"hello" : "hello" diff --git a/tests/baselines/reference/functionOverloads17.types b/tests/baselines/reference/functionOverloads17.types index a93973cf3acaa..4b65a6a2a37d1 100644 --- a/tests/baselines/reference/functionOverloads17.types +++ b/tests/baselines/reference/functionOverloads17.types @@ -6,7 +6,7 @@ function foo():{a:number;} function foo():{a:string;} { return {a:""} } >foo : () => { a: number; } >a : string ->{a:""} : { a: string; } +>{a:""} : { a: ""; } >a : string >"" : "" diff --git a/tests/baselines/reference/functionOverloads35.types b/tests/baselines/reference/functionOverloads35.types index 8686bc2fdf895..b7059575747d9 100644 --- a/tests/baselines/reference/functionOverloads35.types +++ b/tests/baselines/reference/functionOverloads35.types @@ -19,7 +19,7 @@ var x = foo({a:1}); >x : number >foo({a:1}) : number >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } ->{a:1} : { a: number; } +>{a:1} : { a: 1; } >a : number >1 : 1 diff --git a/tests/baselines/reference/functionOverloads36.types b/tests/baselines/reference/functionOverloads36.types index 8a78f466d349a..c948f792a8705 100644 --- a/tests/baselines/reference/functionOverloads36.types +++ b/tests/baselines/reference/functionOverloads36.types @@ -19,7 +19,7 @@ var x = foo({a:'foo'}); >x : string >foo({a:'foo'}) : string >foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } ->{a:'foo'} : { a: string; } +>{a:'foo'} : { a: "foo"; } >a : string >'foo' : "foo" diff --git a/tests/baselines/reference/functionOverloads38.types b/tests/baselines/reference/functionOverloads38.types index e8b32f78e7c3a..ca6a731c3d480 100644 --- a/tests/baselines/reference/functionOverloads38.types +++ b/tests/baselines/reference/functionOverloads38.types @@ -19,8 +19,8 @@ var x = foo([{a:1}]); >x : string >foo([{a:1}]) : string >foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } ->[{a:1}] : { a: number; }[] ->{a:1} : { a: number; } +>[{a:1}] : { a: 1; }[] +>{a:1} : { a: 1; } >a : number >1 : 1 diff --git a/tests/baselines/reference/functionOverloads40.errors.txt b/tests/baselines/reference/functionOverloads40.errors.txt index d871946cde246..f965a4eb9e129 100644 --- a/tests/baselines/reference/functionOverloads40.errors.txt +++ b/tests/baselines/reference/functionOverloads40.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of type '{ a: "bar"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: "bar"; }' is not assignable to type '{ a: boolean; }'. +tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. + Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. Types of property 'a' are incompatible. - Type '"bar"' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. ==== tests/cases/compiler/functionOverloads40.ts (1 errors) ==== @@ -10,8 +10,8 @@ tests/cases/compiler/functionOverloads40.ts(4,13): error TS2345: Argument of typ function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'bar'}]); ~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ a: "bar"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: "bar"; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. !!! error TS2345: Types of property 'a' are incompatible. -!!! error TS2345: Type '"bar"' is not assignable to type 'boolean'. +!!! error TS2345: Type 'string' is not assignable to type 'boolean'. \ No newline at end of file diff --git a/tests/baselines/reference/functionOverloads43.types b/tests/baselines/reference/functionOverloads43.types index 41a29fd0fe3a1..32a890ac1090f 100644 --- a/tests/baselines/reference/functionOverloads43.types +++ b/tests/baselines/reference/functionOverloads43.types @@ -31,8 +31,8 @@ var x = foo([{a: "str"}]); >x : string >foo([{a: "str"}]) : string >foo : { (bar: { a: number; }[]): number; (bar: { a: string; }[]): string; } ->[{a: "str"}] : { a: string; }[] ->{a: "str"} : { a: string; } +>[{a: "str"}] : { a: "str"; }[] +>{a: "str"} : { a: "str"; } >a : string >"str" : "str" @@ -40,8 +40,8 @@ var y = foo([{a: 100}]); >y : number >foo([{a: 100}]) : number >foo : { (bar: { a: number; }[]): number; (bar: { a: string; }[]): string; } ->[{a: 100}] : { a: number; }[] ->{a: 100} : { a: number; } +>[{a: 100}] : { a: 100; }[] +>{a: 100} : { a: 100; } >a : number >100 : 100 diff --git a/tests/baselines/reference/functionOverloads44.types b/tests/baselines/reference/functionOverloads44.types index af046ba72067d..278ae79df3d62 100644 --- a/tests/baselines/reference/functionOverloads44.types +++ b/tests/baselines/reference/functionOverloads44.types @@ -63,8 +63,8 @@ var x1 = foo1([{a: "str"}]); >x1 : Animal >foo1([{a: "str"}]) : Animal >foo1 : { (bar: { a: number; }[]): Dog; (bar: { a: string; }[]): Animal; } ->[{a: "str"}] : { a: string; }[] ->{a: "str"} : { a: string; } +>[{a: "str"}] : { a: "str"; }[] +>{a: "str"} : { a: "str"; } >a : string >"str" : "str" @@ -72,8 +72,8 @@ var y1 = foo1([{a: 100}]); >y1 : Dog >foo1([{a: 100}]) : Dog >foo1 : { (bar: { a: number; }[]): Dog; (bar: { a: string; }[]): Animal; } ->[{a: 100}] : { a: number; }[] ->{a: 100} : { a: number; } +>[{a: 100}] : { a: 100; }[] +>{a: 100} : { a: 100; } >a : number >100 : 100 @@ -81,8 +81,8 @@ var x2 = foo2([{a: "str"}]); >x2 : Dog | Cat >foo2([{a: "str"}]) : Dog | Cat >foo2 : { (bar: { a: number; }[]): Cat; (bar: { a: string; }[]): Dog | Cat; } ->[{a: "str"}] : { a: string; }[] ->{a: "str"} : { a: string; } +>[{a: "str"}] : { a: "str"; }[] +>{a: "str"} : { a: "str"; } >a : string >"str" : "str" @@ -90,8 +90,8 @@ var y2 = foo2([{a: 100}]); >y2 : Cat >foo2([{a: 100}]) : Cat >foo2 : { (bar: { a: number; }[]): Cat; (bar: { a: string; }[]): Dog | Cat; } ->[{a: 100}] : { a: number; }[] ->{a: 100} : { a: number; } +>[{a: 100}] : { a: 100; }[] +>{a: 100} : { a: 100; } >a : number >100 : 100 diff --git a/tests/baselines/reference/functionOverloads45.types b/tests/baselines/reference/functionOverloads45.types index ca778e68056b1..8340f81e3d552 100644 --- a/tests/baselines/reference/functionOverloads45.types +++ b/tests/baselines/reference/functionOverloads45.types @@ -63,8 +63,8 @@ var x1 = foo1([{a: "str"}]); >x1 : Dog >foo1([{a: "str"}]) : Dog >foo1 : { (bar: { a: number; }[]): Cat; (bar: { a: string; }[]): Dog; } ->[{a: "str"}] : { a: string; }[] ->{a: "str"} : { a: string; } +>[{a: "str"}] : { a: "str"; }[] +>{a: "str"} : { a: "str"; } >a : string >"str" : "str" @@ -72,8 +72,8 @@ var y1 = foo1([{a: 100}]); >y1 : Cat >foo1([{a: 100}]) : Cat >foo1 : { (bar: { a: number; }[]): Cat; (bar: { a: string; }[]): Dog; } ->[{a: 100}] : { a: number; }[] ->{a: 100} : { a: number; } +>[{a: 100}] : { a: 100; }[] +>{a: 100} : { a: 100; } >a : number >100 : 100 @@ -81,8 +81,8 @@ var x2 = foo2([{a: "str"}]); >x2 : Dog >foo2([{a: "str"}]) : Dog >foo2 : { (bar: { a: number; }[]): Cat; (bar: { a: string; }[]): Dog; } ->[{a: "str"}] : { a: string; }[] ->{a: "str"} : { a: string; } +>[{a: "str"}] : { a: "str"; }[] +>{a: "str"} : { a: "str"; } >a : string >"str" : "str" @@ -90,8 +90,8 @@ var y2 = foo2([{a: 100}]); >y2 : Cat >foo2([{a: 100}]) : Cat >foo2 : { (bar: { a: number; }[]): Cat; (bar: { a: string; }[]): Dog; } ->[{a: 100}] : { a: number; }[] ->{a: 100} : { a: number; } +>[{a: 100}] : { a: 100; }[] +>{a: 100} : { a: 100; } >a : number >100 : 100 diff --git a/tests/baselines/reference/fuzzy.errors.txt b/tests/baselines/reference/fuzzy.errors.txt index b32f225a33e31..d59497b5facfb 100644 --- a/tests/baselines/reference/fuzzy.errors.txt +++ b/tests/baselines/reference/fuzzy.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/fuzzy.ts(13,18): error TS2420: Class 'C' incorrectly implements interface 'I'. Property 'alsoWorks' is missing in type 'C'. -tests/cases/compiler/fuzzy.ts(21,13): error TS2322: Type '{ anything: number; oneI: this; }' is not assignable to type 'R'. +tests/cases/compiler/fuzzy.ts(21,13): error TS2322: Type '{ anything: 1; oneI: this; }' is not assignable to type 'R'. Types of property 'oneI' are incompatible. Type 'this' is not assignable to type 'I'. Type 'C' is not assignable to type 'I'. @@ -35,7 +35,7 @@ tests/cases/compiler/fuzzy.ts(25,20): error TS2352: Type '{ oneI: this; }' canno doesntWork():R { return { anything:1, oneI:this }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ anything: number; oneI: this; }' is not assignable to type 'R'. +!!! error TS2322: Type '{ anything: 1; oneI: this; }' is not assignable to type 'R'. !!! error TS2322: Types of property 'oneI' are incompatible. !!! error TS2322: Type 'this' is not assignable to type 'I'. !!! error TS2322: Type 'C' is not assignable to type 'I'. diff --git a/tests/baselines/reference/fuzzy.types b/tests/baselines/reference/fuzzy.types index c23b5f839c850..5332b0f47319f 100644 --- a/tests/baselines/reference/fuzzy.types +++ b/tests/baselines/reference/fuzzy.types @@ -43,8 +43,8 @@ module M { return ({ anything: 1 }); >({ anything: 1 }) : R >R : R ->({ anything: 1 }) : { anything: number; } ->{ anything: 1 } : { anything: number; } +>({ anything: 1 }) : { anything: 1; } +>{ anything: 1 } : { anything: 1; } >anything : number >1 : 1 } @@ -54,7 +54,7 @@ module M { >R : R return { anything:1, oneI:this }; ->{ anything:1, oneI:this } : { anything: number; oneI: this; } +>{ anything:1, oneI:this } : { anything: 1; oneI: this; } >anything : number >1 : 1 >oneI : this diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types index 2727f0c1eced7..d16224fa0510b 100644 --- a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types @@ -13,7 +13,7 @@ var r = foo([1, 2]); // number[] >r : number[] >foo([1, 2]) : number[] >foo : (t: T) => T ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 @@ -21,7 +21,7 @@ var r = foo([1, 2]); // number[] >r : number[] >foo([1, 2]) : number[] >foo : (t: T) => T ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 @@ -49,7 +49,7 @@ var r4 = foo([1, '']); // {}[] >r4 : (string | number)[] >foo([1, '']) : (string | number)[] >foo : (t: T) => T ->[1, ''] : (string | number)[] +>[1, ''] : (1 | "")[] >1 : 1 >'' : "" diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments.types index ee5dea94cb034..c2d8379fd497f 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.types @@ -30,7 +30,7 @@ var r2 = foo((x: U) => ''); // string >r2 : string >foo((x: U) => '') : string >foo : (x: (a: T) => T) => T ->(x: U) => '' : (x: U) => string +>(x: U) => '' : (x: U) => "" >U : U >x : U >U : U @@ -86,7 +86,7 @@ var r6 = foo2('', (a: Z) => 1); >foo2('', (a: Z) => 1) : number >foo2 : (x: T, cb: (a: T) => U) => U >'' : "" ->(a: Z) => 1 : (a: Z) => number +>(a: Z) => 1 : (a: Z) => 1 >Z : Z >a : Z >Z : Z @@ -138,7 +138,7 @@ var r9 = foo3(1, (a) => '', ''); // string >foo3(1, (a) => '', '') : string >foo3 : (x: T, cb: (a: T) => U, y: U) => U >1 : 1 ->(a) => '' : (a: number) => string +>(a) => '' : (a: number) => "" >a : number >'' : "" >'' : "" diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt index c1724a8f6989f..07838ae880a7f 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts(5,13): error TS2345: Argument of type '{ bar: number; baz: string; }' is not assignable to parameter of type '{ bar: number; baz: number; }'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts(5,13): error TS2345: Argument of type '{ bar: 1; baz: string; }' is not assignable to parameter of type '{ bar: number; baz: number; }'. Types of property 'baz' are incompatible. Type 'string' is not assignable to type 'number'. @@ -10,7 +10,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObj var r = foo({ bar: 1, baz: '' }); // error ~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ bar: number; baz: string; }' is not assignable to parameter of type '{ bar: number; baz: number; }'. +!!! error TS2345: Argument of type '{ bar: 1; baz: string; }' is not assignable to parameter of type '{ bar: number; baz: number; }'. !!! error TS2345: Types of property 'baz' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var r2 = foo({ bar: 1, baz: 1 }); // T = number diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.types b/tests/baselines/reference/genericCallWithObjectLiteralArgs.types index 3065a22569af9..b4d1f4dd72d6d 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.types @@ -26,7 +26,7 @@ var r2 = foo({ bar: 1, baz: 1 }); // T = number >r2 : { bar: number; baz: number; } >foo({ bar: 1, baz: 1 }) : { bar: number; baz: number; } >foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->{ bar: 1, baz: 1 } : { bar: number; baz: number; } +>{ bar: 1, baz: 1 } : { bar: 1; baz: 1; } >bar : number >1 : 1 >baz : number diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt index cbc573641556d..bf9048e339248 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(3,13): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(3,13): error TS2345: Argument of type '{ x: 3; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. Types of property 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(4,22): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(4,22): error TS2345: Argument of type '{ x: 3; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. Types of property 'y' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(5,22): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(5,22): error TS2345: Argument of type '{ x: number; y: ""; }' is not assignable to parameter of type '{ x: string; y: string; }'. Types of property 'x' are incompatible. Type 'number' is not assignable to type 'string'. -tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(6,22): error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(6,22): error TS2345: Argument of type '{ x: string; y: 4; }' is not assignable to parameter of type '{ x: number; y: number; }'. Types of property 'x' are incompatible. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(7,22): error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. +tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(7,22): error TS2345: Argument of type '{ x: ""; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. Types of property 'y' are incompatible. Type 'number' is not assignable to type 'string'. @@ -20,26 +20,26 @@ tests/cases/compiler/genericCallWithObjectLiteralArguments1.ts(7,22): error TS23 // these are all errors var x = foo({ x: 3, y: "" }, 4); ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. +!!! error TS2345: Argument of type '{ x: 3; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. !!! error TS2345: Types of property 'y' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var x2 = foo({ x: 3, y: "" }, 4); ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. +!!! error TS2345: Argument of type '{ x: 3; y: string; }' is not assignable to parameter of type '{ x: number; y: number; }'. !!! error TS2345: Types of property 'y' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var x3 = foo({ x: 3, y: "" }, 4); ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type '{ x: string; y: string; }'. +!!! error TS2345: Argument of type '{ x: number; y: ""; }' is not assignable to parameter of type '{ x: string; y: string; }'. !!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. var x4 = foo({ x: "", y: 4 }, ""); ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'. +!!! error TS2345: Argument of type '{ x: string; y: 4; }' is not assignable to parameter of type '{ x: number; y: number; }'. !!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'string' is not assignable to type 'number'. var x5 = foo({ x: "", y: 4 }, ""); ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. +!!! error TS2345: Argument of type '{ x: ""; y: number; }' is not assignable to parameter of type '{ x: string; y: string; }'. !!! error TS2345: Types of property 'y' are incompatible. !!! error TS2345: Type 'number' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types index 69bb70bc64f8f..39694ae026f3d 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.types @@ -62,7 +62,7 @@ var r3 = foo(c, { x: '', foo: c }); >foo(c, { x: '', foo: c }) : (x: C) => { x: string; foo: C; } >foo : (t: T, t2: U) => (x: T) => U >c : C ->{ x: '', foo: c } : { x: string; foo: C; } +>{ x: '', foo: c } : { x: ""; foo: C; } >x : string >'' : "" >foo : C diff --git a/tests/baselines/reference/genericCallWithTupleType.errors.txt b/tests/baselines/reference/genericCallWithTupleType.errors.txt index 65920596c456b..d051d10fbc938 100644 --- a/tests/baselines/reference/genericCallWithTupleType.errors.txt +++ b/tests/baselines/reference/genericCallWithTupleType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. +tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(12,1): error TS2322: Type '["foo", 5, boolean, boolean]' is not assignable to type '[string, number]'. Types of property 'length' are incompatible. Type '4' is not assignable to type '2'. tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'. @@ -25,7 +25,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup var e2 = i1.tuple1[1]; // number i1.tuple1 = ["foo", 5, false, true]; ~~~~~~~~~ -!!! error TS2322: Type '[string, number, boolean, boolean]' is not assignable to type '[string, number]'. +!!! error TS2322: Type '["foo", 5, boolean, boolean]' is not assignable to type '[string, number]'. !!! error TS2322: Types of property 'length' are incompatible. !!! error TS2322: Type '4' is not assignable to type '2'. var e3 = i1.tuple1[2]; // {} diff --git a/tests/baselines/reference/genericCallWithTupleType.types b/tests/baselines/reference/genericCallWithTupleType.types index 8a843b551122b..a7ebd9a24eb9d 100644 --- a/tests/baselines/reference/genericCallWithTupleType.types +++ b/tests/baselines/reference/genericCallWithTupleType.types @@ -20,11 +20,11 @@ var i2: I<{}, {}>; // no error i1.tuple1 = ["foo", 5]; ->i1.tuple1 = ["foo", 5] : [string, number] +>i1.tuple1 = ["foo", 5] : ["foo", 5] >i1.tuple1 : [string, number] >i1 : I >tuple1 : [string, number] ->["foo", 5] : [string, number] +>["foo", 5] : ["foo", 5] >"foo" : "foo" >5 : 5 @@ -45,11 +45,11 @@ var e2 = i1.tuple1[1]; // number >1 : 1 i1.tuple1 = ["foo", 5, false, true]; ->i1.tuple1 = ["foo", 5, false, true] : [string, number, boolean, boolean] +>i1.tuple1 = ["foo", 5, false, true] : ["foo", 5, boolean, boolean] >i1.tuple1 : [string, number] >i1 : I >tuple1 : [string, number] ->["foo", 5, false, true] : [string, number, boolean, boolean] +>["foo", 5, false, true] : ["foo", 5, boolean, boolean] >"foo" : "foo" >5 : 5 >false : false diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types index 17672958b21a2..40d15f939d045 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types @@ -47,7 +47,7 @@ module ImmediatelyFix { >c.foo : (x: (a: T) => T) => T >c : C >foo : (x: (a: T) => T) => T ->(x: U) => '' : (x: U) => string +>(x: U) => '' : (x: U) => "" >U : U >x : U >U : U @@ -92,7 +92,7 @@ module ImmediatelyFix { >c2.foo : (x: (a: number) => number) => number >c2 : C2 >foo : (x: (a: number) => number) => number ->(x: U) => 1 : (x: U) => number +>(x: U) => 1 : (x: U) => 1 >U : U >x : U >U : U @@ -104,7 +104,7 @@ module ImmediatelyFix { >c2.foo : (x: (a: number) => number) => number >c2 : C2 >foo : (x: (a: number) => number) => number ->x => 1 : (x: number) => number +>x => 1 : (x: number) => 1 >x : number >1 : 1 } @@ -169,7 +169,7 @@ module WithCandidates { >c : C >foo2 : (x: T, cb: (a: T) => U) => U >'' : "" ->(a: Z) => 1 : (a: Z) => number +>(a: Z) => 1 : (a: Z) => 1 >Z : Z >a : Z >Z : Z @@ -209,7 +209,7 @@ module WithCandidates { >c2 : C2 >foo3 : (x: number, cb: (a: number) => string, y: string) => string >1 : 1 ->(a: Z) => '' : (a: Z) => string +>(a: Z) => '' : (a: Z) => "" >Z : Z >a : Z >Z : Z @@ -223,7 +223,7 @@ module WithCandidates { >c2 : C2 >foo3 : (x: number, cb: (a: number) => string, y: string) => string >1 : 1 ->function (a) { return '' } : (a: number) => string +>function (a) { return '' } : (a: number) => "" >a : number >'' : "" >'' : "" diff --git a/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.types b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.types index dc61c28ea1bea..06f0a221cf9c0 100644 --- a/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.types +++ b/tests/baselines/reference/genericFunctionTypedArgumentsAreFixed.types @@ -19,6 +19,6 @@ map((a) => a.length, [1]); >a.length : any >a : number >length : any ->[1] : number[] +>[1] : 1[] >1 : 1 diff --git a/tests/baselines/reference/genericTypeAliases.types b/tests/baselines/reference/genericTypeAliases.types index 722347b0f72b3..6bd018eb5ac18 100644 --- a/tests/baselines/reference/genericTypeAliases.types +++ b/tests/baselines/reference/genericTypeAliases.types @@ -13,19 +13,19 @@ type Tree = T | { left: Tree, right: Tree }; var tree: Tree = { >tree : Tree >Tree : Tree ->{ left: { left: 0, right: { left: 1, right: 2 }, }, right: 3} : { left: { left: number; right: { left: number; right: number; }; }; right: number; } +>{ left: { left: 0, right: { left: 1, right: 2 }, }, right: 3} : { left: { left: 0; right: { left: 1; right: 2; }; }; right: 3; } left: { ->left : { left: number; right: { left: number; right: number; }; } ->{ left: 0, right: { left: 1, right: 2 }, } : { left: number; right: { left: number; right: number; }; } +>left : { left: 0; right: { left: 1; right: 2; }; } +>{ left: 0, right: { left: 1, right: 2 }, } : { left: 0; right: { left: 1; right: 2; }; } left: 0, >left : number >0 : 0 right: { ->right : { left: number; right: number; } ->{ left: 1, right: 2 } : { left: number; right: number; } +>right : { left: 1; right: 2; } +>{ left: 1, right: 2 } : { left: 1; right: 2; } left: 1, >left : number @@ -59,9 +59,9 @@ ls = "eager"; >"eager" : "eager" ls = () => "lazy"; ->ls = () => "lazy" : () => string +>ls = () => "lazy" : () => "lazy" >ls : Lazy ->() => "lazy" : () => string +>() => "lazy" : () => "lazy" >"lazy" : "lazy" type Foo = T | { x: Foo }; @@ -105,18 +105,18 @@ x = "string"; >"string" : "string" x = { x: "hello" }; ->x = { x: "hello" } : { x: string; } +>x = { x: "hello" } : { x: "hello"; } >x : Foo ->{ x: "hello" } : { x: string; } +>{ x: "hello" } : { x: "hello"; } >x : string >"hello" : "hello" x = { x: { x: "world" } }; ->x = { x: { x: "world" } } : { x: { x: string; }; } +>x = { x: { x: "world" } } : { x: { x: "world"; }; } >x : Foo ->{ x: { x: "world" } } : { x: { x: string; }; } ->x : { x: string; } ->{ x: "world" } : { x: string; } +>{ x: { x: "world" } } : { x: { x: "world"; }; } +>x : { x: "world"; } +>{ x: "world" } : { x: "world"; } >x : string >"world" : "world" @@ -130,18 +130,18 @@ z = 42; >42 : 42 z = { x: 42 }; ->z = { x: 42 } : { x: number; } +>z = { x: 42 } : { x: 42; } >z : Foo ->{ x: 42 } : { x: number; } +>{ x: 42 } : { x: 42; } >x : number >42 : 42 z = { x: { x: 42 } }; ->z = { x: { x: 42 } } : { x: { x: number; }; } +>z = { x: { x: 42 } } : { x: { x: 42; }; } >z : Foo ->{ x: { x: 42 } } : { x: { x: number; }; } ->x : { x: number; } ->{ x: 42 } : { x: number; } +>{ x: { x: 42 } } : { x: { x: 42; }; } +>x : { x: 42; } +>{ x: 42 } : { x: 42; } >x : number >42 : 42 diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt index e5c2be7a598a1..1f79e21d3a026 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'. - Type 'string | number' is not assignable to type 'string'. +tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argument of type '(number | "hi")[]' is not assignable to parameter of type 'string[]'. + Type 'number | "hi"' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -14,8 +14,8 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argu this.test([]); this.test([1, 2, "hi", 5]); // Error ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'string'. +!!! error TS2345: Argument of type '(number | "hi")[]' is not assignable to parameter of type 'string[]'. +!!! error TS2345: Type 'number | "hi"' is not assignable to type 'string'. !!! error TS2345: Type 'number' is not assignable to type 'string'. } } \ No newline at end of file diff --git a/tests/baselines/reference/heterogeneousArrayAndOverloads.types b/tests/baselines/reference/heterogeneousArrayAndOverloads.types index beb59c9eab8a0..7ae275806bc43 100644 --- a/tests/baselines/reference/heterogeneousArrayAndOverloads.types +++ b/tests/baselines/reference/heterogeneousArrayAndOverloads.types @@ -22,7 +22,7 @@ class arrTest { >this.test : { (arg1: number[]): any; (arg1: string[]): any; } >this : this >test : { (arg1: number[]): any; (arg1: string[]): any; } ->[1, 2, 3, 5] : number[] +>[1, 2, 3, 5] : (1 | 2 | 3 | 5)[] >1 : 1 >2 : 2 >3 : 3 @@ -33,7 +33,7 @@ class arrTest { >this.test : { (arg1: number[]): any; (arg1: string[]): any; } >this : this >test : { (arg1: number[]): any; (arg1: string[]): any; } ->["hi"] : string[] +>["hi"] : "hi"[] >"hi" : "hi" this.test([]); diff --git a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.types b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.types index 50b339492baaa..cb4ca46dc5fe5 100644 --- a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.types +++ b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.types @@ -50,7 +50,7 @@ function testFuncLiteral(funcLit: (y2) => number) { }; testFunctionExprC2((v1, v2) => 1); >testFunctionExprC2((v1, v2) => 1) : void >testFunctionExprC2 : (eq: (v1: any, v2: any) => number) => void ->(v1, v2) => 1 : (v1: any, v2: any) => number +>(v1, v2) => 1 : (v1: any, v2: any) => 1 >v1 : any >v2 : any >1 : 1 diff --git a/tests/baselines/reference/implicitIndexSignatures.types b/tests/baselines/reference/implicitIndexSignatures.types index 0b68f136e2e5f..04acdadb16de9 100644 --- a/tests/baselines/reference/implicitIndexSignatures.types +++ b/tests/baselines/reference/implicitIndexSignatures.types @@ -28,9 +28,9 @@ let map: StringMap; >StringMap : StringMap map = { x: "xxx", y: "yyy" }; ->map = { x: "xxx", y: "yyy" } : { x: string; y: string; } +>map = { x: "xxx", y: "yyy" } : { x: "xxx"; y: "yyy"; } >map : StringMap ->{ x: "xxx", y: "yyy" } : { x: string; y: string; } +>{ x: "xxx", y: "yyy" } : { x: "xxx"; y: "yyy"; } >x : string >"xxx" : "xxx" >y : string diff --git a/tests/baselines/reference/importAliasIdentifiers.types b/tests/baselines/reference/importAliasIdentifiers.types index 4c9701ded100f..9c1609b663194 100644 --- a/tests/baselines/reference/importAliasIdentifiers.types +++ b/tests/baselines/reference/importAliasIdentifiers.types @@ -50,7 +50,7 @@ module clodule { var Point: Point = { x: 0, y: 0 }; >Point : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -101,7 +101,7 @@ module fundule { var Point: Point = { x: 0, y: 0 }; >Point : Point >Point : Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/incrementOperatorWithNumberType.types b/tests/baselines/reference/incrementOperatorWithNumberType.types index 03030289a77c7..e4677378d4c56 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberType.types +++ b/tests/baselines/reference/incrementOperatorWithNumberType.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.types b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.types index b9ce83dfe6777..f5497de4d3a29 100644 --- a/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.types +++ b/tests/baselines/reference/incrementOperatorWithNumberTypeInvalidOperations.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.types b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.types index 9f6a00060369d..2d7c23354ed18 100644 --- a/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.types +++ b/tests/baselines/reference/incrementOperatorWithUnsupportedStringType.types @@ -5,7 +5,7 @@ var STRING: string; var STRING1: string[] = ["", ""]; >STRING1 : string[] ->["", ""] : string[] +>["", ""] : ""[] >"" : "" >"" : "" diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.types b/tests/baselines/reference/indexSignaturesInferentialTyping.types index 202e14898184d..c15bab1ef32fc 100644 --- a/tests/baselines/reference/indexSignaturesInferentialTyping.types +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.types @@ -21,7 +21,7 @@ var x1 = foo({ 0: 0, 1: 1 }); // type should be number >x1 : number >foo({ 0: 0, 1: 1 }) : number >foo : (items: { [index: number]: T; }) => T ->{ 0: 0, 1: 1 } : { 0: number; 1: number; } +>{ 0: 0, 1: 1 } : { 0: 0; 1: 1; } >0 : 0 >1 : 1 @@ -29,7 +29,7 @@ var x2 = bar({ 0: 0, 1: 1 }); >x2 : number >bar({ 0: 0, 1: 1 }) : number >bar : (items: { [index: string]: T; }) => T ->{ 0: 0, 1: 1 } : { 0: number; 1: number; } +>{ 0: 0, 1: 1 } : { 0: 0; 1: 1; } >0 : 0 >1 : 1 @@ -37,7 +37,7 @@ var x3 = bar({ zero: 0, one: 1 }); // type should be number >x3 : number >bar({ zero: 0, one: 1 }) : number >bar : (items: { [index: string]: T; }) => T ->{ zero: 0, one: 1 } : { zero: number; one: number; } +>{ zero: 0, one: 1 } : { zero: 0; one: 1; } >zero : number >0 : 0 >one : number diff --git a/tests/baselines/reference/indexer.types b/tests/baselines/reference/indexer.types index 6f648d8d2321b..df595dac9ed54 100644 --- a/tests/baselines/reference/indexer.types +++ b/tests/baselines/reference/indexer.types @@ -17,11 +17,11 @@ interface JQuery { var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >jq : JQuery >JQuery : JQuery ->{ 0: { id : "a" }, 1: { id : "b" } } : { 0: { id: string; }; 1: { id: string; }; } ->{ id : "a" } : { id: string; } +>{ 0: { id : "a" }, 1: { id : "b" } } : { 0: { id: "a"; }; 1: { id: "b"; }; } +>{ id : "a" } : { id: "a"; } >id : string >"a" : "a" ->{ id : "b" } : { id: string; } +>{ id : "b" } : { id: "b"; } >id : string >"b" : "b" diff --git a/tests/baselines/reference/indexerA.types b/tests/baselines/reference/indexerA.types index e0eadbc06b4d1..eca1d4a3fed76 100644 --- a/tests/baselines/reference/indexerA.types +++ b/tests/baselines/reference/indexerA.types @@ -17,11 +17,11 @@ class JQuery { var jq:JQuery={ 0: { id : "a" }, 1: { id : "b" } }; >jq : JQuery >JQuery : JQuery ->{ 0: { id : "a" }, 1: { id : "b" } } : { 0: { id: string; }; 1: { id: string; }; } ->{ id : "a" } : { id: string; } +>{ 0: { id : "a" }, 1: { id : "b" } } : { 0: { id: "a"; }; 1: { id: "b"; }; } +>{ id : "a" } : { id: "a"; } >id : string >"a" : "a" ->{ id : "b" } : { id: string; } +>{ id : "b" } : { id: "b"; } >id : string >"b" : "b" diff --git a/tests/baselines/reference/indexerWithTuple.types b/tests/baselines/reference/indexerWithTuple.types index 8a14fa9816e44..d95b803425914 100644 --- a/tests/baselines/reference/indexerWithTuple.types +++ b/tests/baselines/reference/indexerWithTuple.types @@ -1,27 +1,27 @@ === tests/cases/conformance/types/tuple/indexerWithTuple.ts === var strNumTuple: [string, number] = ["foo", 10]; >strNumTuple : [string, number] ->["foo", 10] : [string, number] +>["foo", 10] : ["foo", 10] >"foo" : "foo" >10 : 10 var numTupleTuple: [number, [string, number]] = [10, ["bar", 20]]; >numTupleTuple : [number, [string, number]] ->[10, ["bar", 20]] : [number, [string, number]] +>[10, ["bar", 20]] : [10, ["bar", 20]] >10 : 10 ->["bar", 20] : [string, number] +>["bar", 20] : ["bar", 20] >"bar" : "bar" >20 : 20 var unionTuple1: [number, string| number] = [10, "foo"]; >unionTuple1 : [number, string | number] ->[10, "foo"] : [number, string] +>[10, "foo"] : [10, "foo"] >10 : 10 >"foo" : "foo" var unionTuple2: [boolean, string| number] = [true, "foo"]; >unionTuple2 : [boolean, string | number] ->[true, "foo"] : [true, string] +>[true, "foo"] : [true, "foo"] >true : true >"foo" : "foo" diff --git a/tests/baselines/reference/indirectTypeParameterReferences.types b/tests/baselines/reference/indirectTypeParameterReferences.types index e38f5dd2577aa..ac4950f70121e 100644 --- a/tests/baselines/reference/indirectTypeParameterReferences.types +++ b/tests/baselines/reference/indirectTypeParameterReferences.types @@ -46,7 +46,7 @@ const {combined, literal} = flowtypes<{a: string}>({b: 'b-value'}) >flowtypes<{a: string}>({b: 'b-value'}) : { combined: (fn: (combined: { a: string; } & B) => void) => any; literal: (fn: (aPlusB: { a: string; } & B) => void) => any; } >flowtypes : (b: B) => { combined: (fn: (combined: A & B) => void) => any; literal: (fn: (aPlusB: A & B) => void) => any; } >a : string ->{b: 'b-value'} : { b: string; } +>{b: 'b-value'} : { b: "b-value"; } >b : string >'b-value' : "b-value" diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types index 58d51e48987f4..9f972547d84f6 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.types @@ -33,7 +33,7 @@ var result = zipWith([1, 2], ['a', 'b'], pair); >result : { x: number; y: {}; }[] >zipWith([1, 2], ['a', 'b'], pair) : { x: number; y: {}; }[] >zipWith : (a: T[], b: S[], f: (x: T) => (y: S) => U) => U[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 >['a', 'b'] : string[] diff --git a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.types b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.types index 80b3253cba20b..0c038a89b8035 100644 --- a/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.types +++ b/tests/baselines/reference/inferentialTypingWithObjectLiteralProperties.types @@ -21,9 +21,9 @@ f({ x: [null] }, { x: [1] }).x[0] = "" // ok >x : null[] >[null] : null[] >null : null ->{ x: [1] } : { x: number[]; } ->x : number[] ->[1] : number[] +>{ x: [1] } : { x: 1[]; } +>x : 1[] +>[1] : 1[] >1 : 1 >x : number[] >0 : 0 @@ -35,9 +35,9 @@ f({ x: [1] }, { x: [null] }).x[0] = "" // was error TS2011: Cannot convert 'stri >f({ x: [1] }, { x: [null] }).x : number[] >f({ x: [1] }, { x: [null] }) : { x: number[]; } >f : (x: T, y: T) => T ->{ x: [1] } : { x: number[]; } ->x : number[] ->[1] : number[] +>{ x: [1] } : { x: 1[]; } +>x : 1[] +>[1] : 1[] >1 : 1 >{ x: [null] } : { x: null[]; } >x : null[] diff --git a/tests/baselines/reference/inheritance.types b/tests/baselines/reference/inheritance.types index a71b56a6b695e..c1a78ae34e2ae 100644 --- a/tests/baselines/reference/inheritance.types +++ b/tests/baselines/reference/inheritance.types @@ -45,7 +45,7 @@ class Good { public f: () => number = function () { return 0; } >f : () => number ->function () { return 0; } : () => number +>function () { return 0; } : () => 0 >0 : 0 public g() { return 0; } diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.types b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.types index 86312372e320d..02991d5fc7726 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.types +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.types @@ -40,13 +40,13 @@ class C { >x : number C.prototype.bar = (x: number) => 1; // ok ->C.prototype.bar = (x: number) => 1 : (x: number) => number +>C.prototype.bar = (x: number) => 1 : (x: number) => 1 >C.prototype.bar : (x: number) => number >C.prototype : C >C : typeof C >prototype : C >bar : (x: number) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 diff --git a/tests/baselines/reference/instantiatedModule.types b/tests/baselines/reference/instantiatedModule.types index b7072d6bb7385..2b7bc5a6ba6ac 100644 --- a/tests/baselines/reference/instantiatedModule.types +++ b/tests/baselines/reference/instantiatedModule.types @@ -67,7 +67,7 @@ module M2 { >Point : Point return { x: 0, y: 0 }; ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/interface0.types b/tests/baselines/reference/interface0.types index 9a70cf066b177..7363d18e5d1d3 100644 --- a/tests/baselines/reference/interface0.types +++ b/tests/baselines/reference/interface0.types @@ -11,7 +11,7 @@ interface Generic { var y: Generic = { x: 3 }; >y : Generic >Generic : Generic ->{ x: 3 } : { x: number; } +>{ x: 3 } : { x: 3; } >x : number >3 : 3 diff --git a/tests/baselines/reference/interfaceAssignmentCompat.types b/tests/baselines/reference/interfaceAssignmentCompat.types index 0a9ee4394a3aa..a9643e3fab362 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.types +++ b/tests/baselines/reference/interfaceAssignmentCompat.types @@ -76,33 +76,33 @@ module M { >"" : "" x[0]={ color:Color.Brown }; ->x[0]={ color:Color.Brown } : { color: Color; } +>x[0]={ color:Color.Brown } : { color: Color.Brown; } >x[0] : IEye >x : IEye[] >0 : 0 ->{ color:Color.Brown } : { color: Color; } +>{ color:Color.Brown } : { color: Color.Brown; } >color : Color >Color.Brown : Color.Brown >Color : typeof Color >Brown : Color.Brown x[1]={ color:Color.Blue }; ->x[1]={ color:Color.Blue } : { color: Color; } +>x[1]={ color:Color.Blue } : { color: Color.Blue; } >x[1] : IEye >x : IEye[] >1 : 1 ->{ color:Color.Blue } : { color: Color; } +>{ color:Color.Blue } : { color: Color.Blue; } >color : Color >Color.Blue : Color.Blue >Color : typeof Color >Blue : Color.Blue x[2]={ color:Color.Green }; ->x[2]={ color:Color.Green } : { color: Color; } +>x[2]={ color:Color.Green } : { color: Color.Green; } >x[2] : IEye >x : IEye[] >2 : 2 ->{ color:Color.Green } : { color: Color; } +>{ color:Color.Green } : { color: Color.Green; } >color : Color >Color.Green : Color.Green >Color : typeof Color diff --git a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types index eae55bc09d1ed..fbd13c58027a2 100644 --- a/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types +++ b/tests/baselines/reference/interfaceDoesNotDependOnBaseTypes.types @@ -21,7 +21,7 @@ if (typeof x !== "string") { >x.push : (...items: StringTree[]) => number >x : StringTreeArray >push : (...items: StringTree[]) => number ->[""] : string[] +>[""] : ""[] >"" : "" } diff --git a/tests/baselines/reference/interfaceImplementation6.types b/tests/baselines/reference/interfaceImplementation6.types index e83a2e1273a5b..77b5e477521e9 100644 --- a/tests/baselines/reference/interfaceImplementation6.types +++ b/tests/baselines/reference/interfaceImplementation6.types @@ -38,7 +38,7 @@ export class Test { private pt: I1 = { item: 1 }; >pt : I1 >I1 : I1 ->{ item: 1 } : { item: number; } +>{ item: 1 } : { item: 1; } >item : number >1 : 1 } diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index 07832f23fc343..a7e7bc3a27e48 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -80,7 +80,7 @@ interface Foo { var a: Foo = { >a : Foo >Foo : Foo ->{ a: 1, b: '', c: true, d: {}, e: null , f: [1], g: {}, h: (x: number) => 1, i: (x: T) => x, j: null, k: new C(), l: f1, m: M, n: {}, o: E.A} : { a: number; b: string; c: true; d: {}; e: null; f: number[]; g: {}; h: (x: number) => number; i: (x: T) => T; j: Foo; k: C; l: () => void; m: typeof M; n: {}; o: E; } +>{ a: 1, b: '', c: true, d: {}, e: null , f: [1], g: {}, h: (x: number) => 1, i: (x: T) => x, j: null, k: new C(), l: f1, m: M, n: {}, o: E.A} : { a: 1; b: ""; c: true; d: {}; e: null; f: 1[]; g: {}; h: (x: number) => 1; i: (x: T) => T; j: Foo; k: C; l: () => void; m: typeof M; n: {}; o: E; } a: 1, >a : number @@ -103,8 +103,8 @@ var a: Foo = { >null : null f: [1], ->f : number[] ->[1] : number[] +>f : 1[] +>[1] : 1[] >1 : 1 g: {}, @@ -112,8 +112,8 @@ var a: Foo = { >{} : {} h: (x: number) => 1, ->h : (x: number) => number ->(x: number) => 1 : (x: number) => number +>h : (x: number) => 1 +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 diff --git a/tests/baselines/reference/intersectionThisTypes.types b/tests/baselines/reference/intersectionThisTypes.types index 285609cdfdc21..d15f44bab1461 100644 --- a/tests/baselines/reference/intersectionThisTypes.types +++ b/tests/baselines/reference/intersectionThisTypes.types @@ -124,11 +124,11 @@ function test(label: Label) { >label.extend : (props: T) => Label & T >label : Label >extend : (props: T) => Label & T ->{ id: 67 } : { id: number; } +>{ id: 67 } : { id: 67; } >id : number >67 : 67 >extend : (props: T) => Label & { id: number; } & T ->{ tag: "hello" } : { tag: string; } +>{ tag: "hello" } : { tag: "hello"; } >tag : string >"hello" : "hello" diff --git a/tests/baselines/reference/intersectionTypeInference.types b/tests/baselines/reference/intersectionTypeInference.types index 0b1fa1c937c9b..c5a46ff0e81b0 100644 --- a/tests/baselines/reference/intersectionTypeInference.types +++ b/tests/baselines/reference/intersectionTypeInference.types @@ -43,10 +43,10 @@ var x = extend({ a: "hello" }, { b: 42 }); >x : { a: string; } & { b: number; } >extend({ a: "hello" }, { b: 42 }) : { a: string; } & { b: number; } >extend : (obj1: T, obj2: U) => T & U ->{ a: "hello" } : { a: string; } +>{ a: "hello" } : { a: "hello"; } >a : string >"hello" : "hello" ->{ b: 42 } : { b: number; } +>{ b: 42 } : { b: 42; } >b : number >42 : 42 @@ -100,7 +100,7 @@ var z = foo({ a: "hello", b: 42 }); >z : string | number >foo({ a: "hello", b: 42 }) : string | number >foo : (obj: A & B) => T | U ->{ a: "hello", b: 42 } : { a: string; b: number; } +>{ a: "hello", b: 42 } : { a: "hello"; b: 42; } >a : string >"hello" : "hello" >b : number diff --git a/tests/baselines/reference/intersectionTypeInference1.types b/tests/baselines/reference/intersectionTypeInference1.types index 9417f63336115..13cce26d24c9c 100644 --- a/tests/baselines/reference/intersectionTypeInference1.types +++ b/tests/baselines/reference/intersectionTypeInference1.types @@ -35,7 +35,7 @@ export const Form3 = brokenFunction(parameterFn)({store: "hello"}) >brokenFunction(parameterFn) : (o: { store: string; }) => { store: string; } >brokenFunction : (f: (p: { dispatch: number; } & OwnProps) => void) => (o: OwnProps) => OwnProps >parameterFn : (props: { store: string; }) => void ->{store: "hello"} : { store: string; } +>{store: "hello"} : { store: "hello"; } >store : string >"hello" : "hello" diff --git a/tests/baselines/reference/intersectionTypeMembers.types b/tests/baselines/reference/intersectionTypeMembers.types index 4d1da7eab73d8..262ceb1b301a8 100644 --- a/tests/baselines/reference/intersectionTypeMembers.types +++ b/tests/baselines/reference/intersectionTypeMembers.types @@ -138,15 +138,15 @@ const de: D & E = { >de : D & E >D : D >E : E ->{ nested: { doublyNested: { d: 'yes', f: 'no' }, different: { e: 12 }, other: { g: 101 } }} : { nested: { doublyNested: { d: string; f: string; }; different: { e: number; }; other: { g: number; }; }; } +>{ nested: { doublyNested: { d: 'yes', f: 'no' }, different: { e: 12 }, other: { g: 101 } }} : { nested: { doublyNested: { d: "yes"; f: "no"; }; different: { e: 12; }; other: { g: 101; }; }; } nested: { ->nested : { doublyNested: { d: string; f: string; }; different: { e: number; }; other: { g: number; }; } ->{ doublyNested: { d: 'yes', f: 'no' }, different: { e: 12 }, other: { g: 101 } } : { doublyNested: { d: string; f: string; }; different: { e: number; }; other: { g: number; }; } +>nested : { doublyNested: { d: "yes"; f: "no"; }; different: { e: 12; }; other: { g: 101; }; } +>{ doublyNested: { d: 'yes', f: 'no' }, different: { e: 12 }, other: { g: 101 } } : { doublyNested: { d: "yes"; f: "no"; }; different: { e: 12; }; other: { g: 101; }; } doublyNested: { ->doublyNested : { d: string; f: string; } ->{ d: 'yes', f: 'no' } : { d: string; f: string; } +>doublyNested : { d: "yes"; f: "no"; } +>{ d: 'yes', f: 'no' } : { d: "yes"; f: "no"; } d: 'yes', >d : string @@ -158,14 +158,14 @@ const de: D & E = { }, different: { e: 12 }, ->different : { e: number; } ->{ e: 12 } : { e: number; } +>different : { e: 12; } +>{ e: 12 } : { e: 12; } >e : number >12 : 12 other: { g: 101 } ->other : { g: number; } ->{ g: 101 } : { g: number; } +>other : { g: 101; } +>{ g: 101 } : { g: 101; } >g : number >101 : 101 } diff --git a/tests/baselines/reference/invalidReturnStatements.errors.txt b/tests/baselines/reference/invalidReturnStatements.errors.txt index 0f51e75a47d23..6b21ffb6de048 100644 --- a/tests/baselines/reference/invalidReturnStatements.errors.txt +++ b/tests/baselines/reference/invalidReturnStatements.errors.txt @@ -2,8 +2,8 @@ tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(2 tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(4,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(5,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. -tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(16,22): error TS2322: Type '{ id: number; }' is not assignable to type 'D'. - Property 'name' is missing in type '{ id: number; }'. +tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(16,22): error TS2322: Type '{ id: 12; }' is not assignable to type 'D'. + Property 'name' is missing in type '{ id: 12; }'. tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(18,22): error TS2322: Type 'C' is not assignable to type 'D'. Property 'name' is missing in type 'C'. @@ -34,8 +34,8 @@ tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts(1 } function fn10(): D { return { id: 12 }; } ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ id: number; }' is not assignable to type 'D'. -!!! error TS2322: Property 'name' is missing in type '{ id: number; }'. +!!! error TS2322: Type '{ id: 12; }' is not assignable to type 'D'. +!!! error TS2322: Property 'name' is missing in type '{ id: 12; }'. function fn11(): D { return new C(); } ~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/invalidReturnStatements.types b/tests/baselines/reference/invalidReturnStatements.types index 6ce341f90dad3..ddad80fd6f892 100644 --- a/tests/baselines/reference/invalidReturnStatements.types +++ b/tests/baselines/reference/invalidReturnStatements.types @@ -40,7 +40,7 @@ class D extends C { function fn10(): D { return { id: 12 }; } >fn10 : () => D >D : D ->{ id: 12 } : { id: number; } +>{ id: 12 } : { id: 12; } >id : number >12 : 12 diff --git a/tests/baselines/reference/isomorphicMappedTypeInference.types b/tests/baselines/reference/isomorphicMappedTypeInference.types index 2e13f69c5eb39..531ba957ada0c 100644 --- a/tests/baselines/reference/isomorphicMappedTypeInference.types +++ b/tests/baselines/reference/isomorphicMappedTypeInference.types @@ -570,7 +570,7 @@ foo(o, {b: 9}); >foo(o, {b: 9}) : { a: number; b: number; } >foo : (object: T, partial: Partial) => T >o : { a: number; b: number; } ->{b: 9} : { b: number; } +>{b: 9} : { b: 9; } >b : number >9 : 9 @@ -580,7 +580,7 @@ o = foo(o, {b: 9}); >foo(o, {b: 9}) : { a: number; b: number; } >foo : (object: T, partial: Partial) => T >o : { a: number; b: number; } ->{b: 9} : { b: number; } +>{b: 9} : { b: 9; } >b : number >9 : 9 diff --git a/tests/baselines/reference/iterableArrayPattern23.types b/tests/baselines/reference/iterableArrayPattern23.types index 83345816b9180..34cb8409b2602 100644 --- a/tests/baselines/reference/iterableArrayPattern23.types +++ b/tests/baselines/reference/iterableArrayPattern23.types @@ -4,11 +4,11 @@ var a: string, b: boolean; >b : boolean [a, b] = { 0: "", 1: true }; ->[a, b] = { 0: "", 1: true } : { 0: string; 1: true; } +>[a, b] = { 0: "", 1: true } : { 0: ""; 1: true; } >[a, b] : [string, boolean] >a : string >b : boolean ->{ 0: "", 1: true } : { 0: string; 1: true; } +>{ 0: "", 1: true } : { 0: ""; 1: true; } >"" : "" >true : true diff --git a/tests/baselines/reference/iterableArrayPattern25.types b/tests/baselines/reference/iterableArrayPattern25.types index c9d94679603ff..2cd95ab512d90 100644 --- a/tests/baselines/reference/iterableArrayPattern25.types +++ b/tests/baselines/reference/iterableArrayPattern25.types @@ -11,11 +11,11 @@ takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); >takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [[any, any], [any, any]]) => void >new Map([["", 0], ["hello", 1]]) : Map >Map : MapConstructor ->[["", 0], ["hello", 1]] : [string, number][] ->["", 0] : [string, number] +>[["", 0], ["hello", 1]] : (["", 0] | ["hello", 1])[] +>["", 0] : ["", 0] >"" : "" >0 : 0 ->["hello", 1] : [string, number] +>["hello", 1] : ["hello", 1] >"hello" : "hello" >1 : 1 diff --git a/tests/baselines/reference/iterableArrayPattern26.types b/tests/baselines/reference/iterableArrayPattern26.types index da73bb7c8e9af..43fb803e2fa7a 100644 --- a/tests/baselines/reference/iterableArrayPattern26.types +++ b/tests/baselines/reference/iterableArrayPattern26.types @@ -11,11 +11,11 @@ takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); >takeFirstTwoEntries : (...[[k1, v1], [k2, v2]]: [string, number][]) => void >new Map([["", 0], ["hello", 1]]) : Map >Map : MapConstructor ->[["", 0], ["hello", 1]] : [string, number][] ->["", 0] : [string, number] +>[["", 0], ["hello", 1]] : (["", 0] | ["hello", 1])[] +>["", 0] : ["", 0] >"" : "" >0 : 0 ->["hello", 1] : [string, number] +>["hello", 1] : ["hello", 1] >"hello" : "hello" >1 : 1 diff --git a/tests/baselines/reference/iterableArrayPattern27.types b/tests/baselines/reference/iterableArrayPattern27.types index 3d1b08b5bf324..278df5c65316d 100644 --- a/tests/baselines/reference/iterableArrayPattern27.types +++ b/tests/baselines/reference/iterableArrayPattern27.types @@ -12,11 +12,11 @@ takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); >...new Map([["", 0], ["hello", 1]]) : [string, number] >new Map([["", 0], ["hello", 1]]) : Map >Map : MapConstructor ->[["", 0], ["hello", 1]] : [string, number][] ->["", 0] : [string, number] +>[["", 0], ["hello", 1]] : (["", 0] | ["hello", 1])[] +>["", 0] : ["", 0] >"" : "" >0 : 0 ->["hello", 1] : [string, number] +>["hello", 1] : ["hello", 1] >"hello" : "hello" >1 : 1 diff --git a/tests/baselines/reference/iterableArrayPattern28.errors.txt b/tests/baselines/reference/iterableArrayPattern28.errors.txt index ac744111b45a9..56b3b756d80d6 100644 --- a/tests/baselines/reference/iterableArrayPattern28.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern28.errors.txt @@ -1,13 +1,13 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(1,33): error TS2501: A rest element cannot contain a binding pattern. -tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,32): error TS2345: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable<[string, number]>'. +tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,32): error TS2345: Argument of type '(["", 0] | ["hello", boolean])[]' is not assignable to parameter of type 'Iterable<[string, number]>'. Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator<[string, number]>'. - Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator<[string, number]>'. + Type '() => IterableIterator<["", 0] | ["hello", boolean]>' is not assignable to type '() => Iterator<[string, number]>'. + Type 'IterableIterator<["", 0] | ["hello", boolean]>' is not assignable to type 'Iterator<[string, number]>'. Types of property 'next' are incompatible. - Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult<[string, number]>'. - Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult<[string, number]>'. - Type '[string, number] | [string, boolean]' is not assignable to type '[string, number]'. - Type '[string, boolean]' is not assignable to type '[string, number]'. + Type '(value?: any) => IteratorResult<["", 0] | ["hello", boolean]>' is not assignable to type '(value?: any) => IteratorResult<[string, number]>'. + Type 'IteratorResult<["", 0] | ["hello", boolean]>' is not assignable to type 'IteratorResult<[string, number]>'. + Type '["", 0] | ["hello", boolean]' is not assignable to type '[string, number]'. + Type '["hello", boolean]' is not assignable to type '[string, number]'. Type 'boolean' is not assignable to type 'number'. @@ -17,13 +17,13 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts(2,32): error !!! error TS2501: A rest element cannot contain a binding pattern. takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '([string, number] | [string, boolean])[]' is not assignable to parameter of type 'Iterable<[string, number]>'. +!!! error TS2345: Argument of type '(["", 0] | ["hello", boolean])[]' is not assignable to parameter of type 'Iterable<[string, number]>'. !!! error TS2345: Types of property '[Symbol.iterator]' are incompatible. -!!! error TS2345: Type '() => IterableIterator<[string, number] | [string, boolean]>' is not assignable to type '() => Iterator<[string, number]>'. -!!! error TS2345: Type 'IterableIterator<[string, number] | [string, boolean]>' is not assignable to type 'Iterator<[string, number]>'. +!!! error TS2345: Type '() => IterableIterator<["", 0] | ["hello", boolean]>' is not assignable to type '() => Iterator<[string, number]>'. +!!! error TS2345: Type 'IterableIterator<["", 0] | ["hello", boolean]>' is not assignable to type 'Iterator<[string, number]>'. !!! error TS2345: Types of property 'next' are incompatible. -!!! error TS2345: Type '(value?: any) => IteratorResult<[string, number] | [string, boolean]>' is not assignable to type '(value?: any) => IteratorResult<[string, number]>'. -!!! error TS2345: Type 'IteratorResult<[string, number] | [string, boolean]>' is not assignable to type 'IteratorResult<[string, number]>'. -!!! error TS2345: Type '[string, number] | [string, boolean]' is not assignable to type '[string, number]'. -!!! error TS2345: Type '[string, boolean]' is not assignable to type '[string, number]'. +!!! error TS2345: Type '(value?: any) => IteratorResult<["", 0] | ["hello", boolean]>' is not assignable to type '(value?: any) => IteratorResult<[string, number]>'. +!!! error TS2345: Type 'IteratorResult<["", 0] | ["hello", boolean]>' is not assignable to type 'IteratorResult<[string, number]>'. +!!! error TS2345: Type '["", 0] | ["hello", boolean]' is not assignable to type '[string, number]'. +!!! error TS2345: Type '["hello", boolean]' is not assignable to type '[string, number]'. !!! error TS2345: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iterableArrayPattern29.types b/tests/baselines/reference/iterableArrayPattern29.types index faa7527290470..157d5bf8e7060 100644 --- a/tests/baselines/reference/iterableArrayPattern29.types +++ b/tests/baselines/reference/iterableArrayPattern29.types @@ -12,11 +12,11 @@ takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); >...new Map([["", true], ["hello", true]]) : [string, boolean] >new Map([["", true], ["hello", true]]) : Map >Map : MapConstructor ->[["", true], ["hello", true]] : [string, true][] ->["", true] : [string, true] +>[["", true], ["hello", true]] : (["", true] | ["hello", true])[] +>["", true] : ["", true] >"" : "" >true : true ->["hello", true] : [string, true] +>["hello", true] : ["hello", true] >"hello" : "hello" >true : true diff --git a/tests/baselines/reference/iterableArrayPattern30.types b/tests/baselines/reference/iterableArrayPattern30.types index 1abdba039ed98..f6556f8297209 100644 --- a/tests/baselines/reference/iterableArrayPattern30.types +++ b/tests/baselines/reference/iterableArrayPattern30.types @@ -6,11 +6,11 @@ const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) >v2 : boolean >new Map([["", true], ["hello", true]]) : Map >Map : MapConstructor ->[["", true], ["hello", true]] : [string, true][] ->["", true] : [string, true] +>[["", true], ["hello", true]] : (["", true] | ["hello", true])[] +>["", true] : ["", true] >"" : "" >true : true ->["hello", true] : [string, true] +>["hello", true] : ["hello", true] >"hello" : "hello" >true : true diff --git a/tests/baselines/reference/iteratorSpreadInArray5.errors.txt b/tests/baselines/reference/iteratorSpreadInArray5.errors.txt index 02049824c4fdd..1fe95f44c66e2 100644 --- a/tests/baselines/reference/iteratorSpreadInArray5.errors.txt +++ b/tests/baselines/reference/iteratorSpreadInArray5.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts(14,5): error TS2322: Type '(number | symbol)[]' is not assignable to type 'number[]'. - Type 'number | symbol' is not assignable to type 'number'. +tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts(14,5): error TS2322: Type '(symbol | 0 | 1)[]' is not assignable to type 'number[]'. + Type 'symbol | 0 | 1' is not assignable to type 'number'. Type 'symbol' is not assignable to type 'number'. @@ -19,6 +19,6 @@ tests/cases/conformance/es6/spread/iteratorSpreadInArray5.ts(14,5): error TS2322 var array: number[] = [0, 1, ...new SymbolIterator]; ~~~~~ -!!! error TS2322: Type '(number | symbol)[]' is not assignable to type 'number[]'. -!!! error TS2322: Type 'number | symbol' is not assignable to type 'number'. +!!! error TS2322: Type '(symbol | 0 | 1)[]' is not assignable to type 'number[]'. +!!! error TS2322: Type 'symbol | 0 | 1' is not assignable to type 'number'. !!! error TS2322: Type 'symbol' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/iteratorSpreadInArray5.types b/tests/baselines/reference/iteratorSpreadInArray5.types index 3c67000dae409..ce3966d59f71a 100644 --- a/tests/baselines/reference/iteratorSpreadInArray5.types +++ b/tests/baselines/reference/iteratorSpreadInArray5.types @@ -32,7 +32,7 @@ class SymbolIterator { var array: number[] = [0, 1, ...new SymbolIterator]; >array : number[] ->[0, 1, ...new SymbolIterator] : (number | symbol)[] +>[0, 1, ...new SymbolIterator] : (symbol | 0 | 1)[] >0 : 0 >1 : 1 >...new SymbolIterator : symbol diff --git a/tests/baselines/reference/iteratorSpreadInArray6.types b/tests/baselines/reference/iteratorSpreadInArray6.types index 5ed866d78694c..c7f4faf8525cc 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.types +++ b/tests/baselines/reference/iteratorSpreadInArray6.types @@ -32,7 +32,7 @@ class SymbolIterator { var array: number[] = [0, 1]; >array : number[] ->[0, 1] : number[] +>[0, 1] : (0 | 1)[] >0 : 0 >1 : 1 diff --git a/tests/baselines/reference/jsdocDisallowedInTypescript.types b/tests/baselines/reference/jsdocDisallowedInTypescript.types index 8fe4a032f206b..6ea3299aa3529 100644 --- a/tests/baselines/reference/jsdocDisallowedInTypescript.types +++ b/tests/baselines/reference/jsdocDisallowedInTypescript.types @@ -3,7 +3,7 @@ var ara: Array. = [1,2,3]; >ara : number[] >Array : T[] ->[1,2,3] : number[] +>[1,2,3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/jsdocParamTagTypeLiteral.types b/tests/baselines/reference/jsdocParamTagTypeLiteral.types index 95adecafc8364..fbb2615c56b5a 100644 --- a/tests/baselines/reference/jsdocParamTagTypeLiteral.types +++ b/tests/baselines/reference/jsdocParamTagTypeLiteral.types @@ -35,7 +35,7 @@ function foo1(opts1) { foo1({x: 'abc'}); >foo1({x: 'abc'}) : void >foo1 : (opts1: { x: string; y?: string; z?: string; w?: string; }) => void ->{x: 'abc'} : { x: string; } +>{x: 'abc'} : { x: "abc"; } >x : string >'abc' : "abc" @@ -59,8 +59,8 @@ function foo2(/** @param opts2 bad idea theatre! */opts2) { foo2([{anotherX: "world"}]); >foo2([{anotherX: "world"}]) : void >foo2 : (opts2: { anotherX: string; anotherY?: string; }[]) => void ->[{anotherX: "world"}] : { anotherX: string; }[] ->{anotherX: "world"} : { anotherX: string; } +>[{anotherX: "world"}] : { anotherX: "world"; }[] +>{anotherX: "world"} : { anotherX: "world"; } >anotherX : string >"world" : "world" @@ -80,7 +80,7 @@ function foo3(opts3) { foo3({x: 'abc'}); >foo3({x: 'abc'}) : void >foo3 : (opts3: { x: string; }) => void ->{x: 'abc'} : { x: string; } +>{x: 'abc'} : { x: "abc"; } >x : string >'abc' : "abc" @@ -106,8 +106,8 @@ function foo4(opts4) { foo4([{ x: 'hi' }]); >foo4([{ x: 'hi' }]) : void >foo4 : (opts4: { x: string; y?: string; z?: string; w?: string; }[]) => void ->[{ x: 'hi' }] : { x: string; }[] ->{ x: 'hi' } : { x: string; } +>[{ x: 'hi' }] : { x: "hi"; }[] +>{ x: 'hi' } : { x: "hi"; } >x : string >'hi' : "hi" @@ -149,17 +149,17 @@ function foo5(opts5) { foo5([{ help: "help", what: { a: 'a', bad: [{ idea: 'idea', oh: false }] }, unnest: 1 }]); >foo5([{ help: "help", what: { a: 'a', bad: [{ idea: 'idea', oh: false }] }, unnest: 1 }]) : void >foo5 : (opts5: { help: string; what: { a: string; bad: { idea: string; oh: boolean; }[]; }; unnest: number; }[]) => void ->[{ help: "help", what: { a: 'a', bad: [{ idea: 'idea', oh: false }] }, unnest: 1 }] : { help: string; what: { a: string; bad: { idea: string; oh: false; }[]; }; unnest: number; }[] ->{ help: "help", what: { a: 'a', bad: [{ idea: 'idea', oh: false }] }, unnest: 1 } : { help: string; what: { a: string; bad: { idea: string; oh: false; }[]; }; unnest: number; } +>[{ help: "help", what: { a: 'a', bad: [{ idea: 'idea', oh: false }] }, unnest: 1 }] : { help: "help"; what: { a: "a"; bad: { idea: "idea"; oh: false; }[]; }; unnest: 1; }[] +>{ help: "help", what: { a: 'a', bad: [{ idea: 'idea', oh: false }] }, unnest: 1 } : { help: "help"; what: { a: "a"; bad: { idea: "idea"; oh: false; }[]; }; unnest: 1; } >help : string >"help" : "help" ->what : { a: string; bad: { idea: string; oh: false; }[]; } ->{ a: 'a', bad: [{ idea: 'idea', oh: false }] } : { a: string; bad: { idea: string; oh: false; }[]; } +>what : { a: "a"; bad: { idea: "idea"; oh: false; }[]; } +>{ a: 'a', bad: [{ idea: 'idea', oh: false }] } : { a: "a"; bad: { idea: "idea"; oh: false; }[]; } >a : string >'a' : "a" ->bad : { idea: string; oh: false; }[] ->[{ idea: 'idea', oh: false }] : { idea: string; oh: false; }[] ->{ idea: 'idea', oh: false } : { idea: string; oh: false; } +>bad : { idea: "idea"; oh: false; }[] +>[{ idea: 'idea', oh: false }] : { idea: "idea"; oh: false; }[] +>{ idea: 'idea', oh: false } : { idea: "idea"; oh: false; } >idea : string >'idea' : "idea" >oh : boolean diff --git a/tests/baselines/reference/json.stringify.types b/tests/baselines/reference/json.stringify.types index a25eac5aaf7ad..9f7bfd059658f 100644 --- a/tests/baselines/reference/json.stringify.types +++ b/tests/baselines/reference/json.stringify.types @@ -27,7 +27,7 @@ JSON.stringify(value, ["a", 1], 2); >JSON : JSON >stringify : { (value: any, replacer?: ((key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } >value : null ->["a", 1] : (string | number)[] +>["a", 1] : ("a" | 1)[] >"a" : "a" >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 302cefabf90b5..7499b932e337f 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -572,7 +572,7 @@ function f31(key: K) { const shape: Shape = { name: "foo", width: 5, height: 10, visible: true }; >shape : Shape >Shape : Shape ->{ name: "foo", width: 5, height: 10, visible: true } : { name: string; width: number; height: number; visible: true; } +>{ name: "foo", width: 5, height: 10, visible: true } : { name: "foo"; width: 5; height: 10; visible: true; } >name : string >"foo" : "foo" >width : number @@ -597,7 +597,7 @@ function f32(key: K) { const shape: Shape = { name: "foo", width: 5, height: 10, visible: true }; >shape : Shape >Shape : Shape ->{ name: "foo", width: 5, height: 10, visible: true } : { name: string; width: number; height: number; visible: true; } +>{ name: "foo", width: 5, height: 10, visible: true } : { name: "foo"; width: 5; height: 10; visible: true; } >name : string >"foo" : "foo" >width : number @@ -947,7 +947,7 @@ function f71(func: (x: T, y: U) => Partial) { >x : Partial<{ a: number; b: string; } & { c: boolean; }> >func({ a: 1, b: "hello" }, { c: true }) : Partial<{ a: number; b: string; } & { c: boolean; }> >func : (x: T, y: U) => Partial ->{ a: 1, b: "hello" } : { a: number; b: string; } +>{ a: 1, b: "hello" } : { a: 1; b: "hello"; } >a : number >1 : 1 >b : string @@ -994,7 +994,7 @@ function f72(func: (x: T, y: U, k: K) => (T & >a : number >func({ a: 1, b: "hello" }, { c: true }, 'a') : number >func : (x: T, y: U, k: K) => (T & U)[K] ->{ a: 1, b: "hello" } : { a: number; b: string; } +>{ a: 1, b: "hello" } : { a: 1; b: "hello"; } >a : number >1 : 1 >b : string @@ -1008,7 +1008,7 @@ function f72(func: (x: T, y: U, k: K) => (T & >b : string >func({ a: 1, b: "hello" }, { c: true }, 'b') : string >func : (x: T, y: U, k: K) => (T & U)[K] ->{ a: 1, b: "hello" } : { a: number; b: string; } +>{ a: 1, b: "hello" } : { a: 1; b: "hello"; } >a : number >1 : 1 >b : string @@ -1022,7 +1022,7 @@ function f72(func: (x: T, y: U, k: K) => (T & >c : boolean >func({ a: 1, b: "hello" }, { c: true }, 'c') : boolean >func : (x: T, y: U, k: K) => (T & U)[K] ->{ a: 1, b: "hello" } : { a: number; b: string; } +>{ a: 1, b: "hello" } : { a: 1; b: "hello"; } >a : number >1 : 1 >b : string @@ -1055,7 +1055,7 @@ function f73(func: (x: T, y: U, k: K) => (T & U)[ >a : number >func({ a: 1, b: "hello" }, { c: true }, 'a') : number >func : (x: T, y: U, k: K) => (T & U)[K] ->{ a: 1, b: "hello" } : { a: number; b: string; } +>{ a: 1, b: "hello" } : { a: 1; b: "hello"; } >a : number >1 : 1 >b : string @@ -1069,7 +1069,7 @@ function f73(func: (x: T, y: U, k: K) => (T & U)[ >b : string >func({ a: 1, b: "hello" }, { c: true }, 'b') : string >func : (x: T, y: U, k: K) => (T & U)[K] ->{ a: 1, b: "hello" } : { a: number; b: string; } +>{ a: 1, b: "hello" } : { a: 1; b: "hello"; } >a : number >1 : 1 >b : string @@ -1083,7 +1083,7 @@ function f73(func: (x: T, y: U, k: K) => (T & U)[ >c : boolean >func({ a: 1, b: "hello" }, { c: true }, 'c') : boolean >func : (x: T, y: U, k: K) => (T & U)[K] ->{ a: 1, b: "hello" } : { a: number; b: string; } +>{ a: 1, b: "hello" } : { a: 1; b: "hello"; } >a : number >1 : 1 >b : string @@ -1116,12 +1116,12 @@ function f74(func: (x: T, y: U, k: K) => (T | U)[ >a : number >func({ a: 1, b: "hello" }, { a: 2, b: true }, 'a') : number >func : (x: T, y: U, k: K) => (T | U)[K] ->{ a: 1, b: "hello" } : { a: number; b: string; } +>{ a: 1, b: "hello" } : { a: 1; b: "hello"; } >a : number >1 : 1 >b : string >"hello" : "hello" ->{ a: 2, b: true } : { a: number; b: true; } +>{ a: 2, b: true } : { a: 2; b: true; } >a : number >2 : 2 >b : boolean @@ -1132,12 +1132,12 @@ function f74(func: (x: T, y: U, k: K) => (T | U)[ >b : string | boolean >func({ a: 1, b: "hello" }, { a: 2, b: true }, 'b') : string | boolean >func : (x: T, y: U, k: K) => (T | U)[K] ->{ a: 1, b: "hello" } : { a: number; b: string; } +>{ a: 1, b: "hello" } : { a: 1; b: "hello"; } >a : number >1 : 1 >b : string >"hello" : "hello" ->{ a: 2, b: true } : { a: number; b: true; } +>{ a: 2, b: true } : { a: 2; b: true; } >a : number >2 : 2 >b : boolean @@ -1225,9 +1225,9 @@ function f82() { >x1 : string >f81({ a: { x: "hello" } }) : string >f81 : (obj: T) => T["a"]["x"] ->{ a: { x: "hello" } } : { a: { x: string; }; } ->a : { x: string; } ->{ x: "hello" } : { x: string; } +>{ a: { x: "hello" } } : { a: { x: "hello"; }; } +>a : { x: "hello"; } +>{ x: "hello" } : { x: "hello"; } >x : string >"hello" : "hello" @@ -1235,9 +1235,9 @@ function f82() { >x2 : number >f81({ a: { x: 42 } }) : number >f81 : (obj: T) => T["a"]["x"] ->{ a: { x: 42 } } : { a: { x: number; }; } ->a : { x: number; } ->{ x: 42 } : { x: number; } +>{ a: { x: 42 } } : { a: { x: 42; }; } +>a : { x: 42; } +>{ x: 42 } : { x: 42; } >x : number >42 : 42 } @@ -1272,9 +1272,9 @@ function f84() { >x1 : string >f83({ foo: { x: "hello" } }, "foo") : string >f83 : (obj: T, key: K) => T[K]["x"] ->{ foo: { x: "hello" } } : { foo: { x: string; }; } ->foo : { x: string; } ->{ x: "hello" } : { x: string; } +>{ foo: { x: "hello" } } : { foo: { x: "hello"; }; } +>foo : { x: "hello"; } +>{ x: "hello" } : { x: "hello"; } >x : string >"hello" : "hello" >"foo" : "foo" @@ -1283,9 +1283,9 @@ function f84() { >x2 : number >f83({ bar: { x: 42 } }, "bar") : number >f83 : (obj: T, key: K) => T[K]["x"] ->{ bar: { x: 42 } } : { bar: { x: number; }; } ->bar : { x: number; } ->{ x: 42 } : { x: number; } +>{ bar: { x: 42 } } : { bar: { x: 42; }; } +>bar : { x: 42; } +>{ x: 42 } : { x: 42; } >x : number >42 : 42 >"bar" : "bar" @@ -1852,11 +1852,11 @@ let c1 = new Component1({ >c1 : Component1<{ hello: string; }, {}> >new Component1({ data: { hello: "" }}) : Component1<{ hello: string; }, {}> >Component1 : typeof Component1 ->{ data: { hello: "" }} : { data: { hello: string; }; } +>{ data: { hello: "" }} : { data: { hello: ""; }; } data: { ->data : { hello: string; } ->{ hello: "" } : { hello: string; } +>data : { hello: ""; } +>{ hello: "" } : { hello: ""; } hello: "" >hello : string @@ -1981,7 +1981,7 @@ let result = dispatchMethod("someMethod", ["hello", 35]); >dispatchMethod : (name: M["name"], args: M["args"]) => M["returnValue"] >SomeMethodDescriptor : SomeMethodDescriptor >"someMethod" : "someMethod" ->["hello", 35] : [string, number] +>["hello", 35] : ["hello", 35] >"hello" : "hello" >35 : 35 @@ -2263,7 +2263,7 @@ class AnotherSampleClass extends SampleClass { const foo: Foo = { foo: "bar" }; >foo : Foo >Foo : Foo ->{ foo: "bar" } : { foo: string; } +>{ foo: "bar" } : { foo: "bar"; } >foo : string >"bar" : "bar" diff --git a/tests/baselines/reference/keyofIsLiteralContexualType.types b/tests/baselines/reference/keyofIsLiteralContexualType.types index c93057b38b4cb..1d8cc50b1714a 100644 --- a/tests/baselines/reference/keyofIsLiteralContexualType.types +++ b/tests/baselines/reference/keyofIsLiteralContexualType.types @@ -42,7 +42,7 @@ let x = pick({ a: 10, b: 20, c: 30 }, ["a", "c"]); >x : Pick<{ a: number; b: number; c: number; }, "a" | "c"> >pick({ a: 10, b: 20, c: 30 }, ["a", "c"]) : Pick<{ a: number; b: number; c: number; }, "a" | "c"> >pick : (obj: T, propNames: K[]) => Pick ->{ a: 10, b: 20, c: 30 } : { a: number; b: number; c: number; } +>{ a: 10, b: 20, c: 30 } : { a: 10; b: 20; c: 30; } >a : number >10 : 10 >b : number diff --git a/tests/baselines/reference/lambdaParamTypes.types b/tests/baselines/reference/lambdaParamTypes.types index 3eb05ea693840..e64fcc6239603 100644 --- a/tests/baselines/reference/lambdaParamTypes.types +++ b/tests/baselines/reference/lambdaParamTypes.types @@ -29,13 +29,13 @@ var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]); >thing : MyArrayWrapper<{ name: string; id: number; }> >create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]) : MyArrayWrapper<{ name: string; id: number; }> >create : (initialValues?: T[]) => MyArrayWrapper ->[{ name: "bob", id: 24 }, { name: "doug", id: 32 }] : { name: string; id: number; }[] ->{ name: "bob", id: 24 } : { name: string; id: number; } +>[{ name: "bob", id: 24 }, { name: "doug", id: 32 }] : ({ name: "bob"; id: 24; } | { name: "doug"; id: 32; })[] +>{ name: "bob", id: 24 } : { name: "bob"; id: 24; } >name : string >"bob" : "bob" >id : number >24 : 24 ->{ name: "doug", id: 32 } : { name: string; id: number; } +>{ name: "doug", id: 32 } : { name: "doug"; id: 32; } >name : string >"doug" : "doug" >id : number diff --git a/tests/baselines/reference/literalTypes2.types b/tests/baselines/reference/literalTypes2.types index ab1d3e199d2b2..db4881fa6056a 100644 --- a/tests/baselines/reference/literalTypes2.types +++ b/tests/baselines/reference/literalTypes2.types @@ -501,7 +501,7 @@ function f6() { >0 : 0 >x3 : string >"foo" : "foo" ->{ x1: false, x2: 1, x3: "bar" } : { x1?: false; x2?: number; x3?: string; } +>{ x1: false, x2: 1, x3: "bar" } : { x1?: false; x2?: 1; x3?: "bar"; } >x1 : boolean >false : false >x2 : number @@ -721,7 +721,7 @@ const x7 = g6([1, 2]); // Type number >x7 : number >g6([1, 2]) : number >g6 : (x: T[]) => T ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/literalTypesAndTypeAssertions.types b/tests/baselines/reference/literalTypesAndTypeAssertions.types index 4c38f74fd723c..6e3865f8549d3 100644 --- a/tests/baselines/reference/literalTypesAndTypeAssertions.types +++ b/tests/baselines/reference/literalTypesAndTypeAssertions.types @@ -31,7 +31,7 @@ let x2 = 1; let { a = "foo" } = { a: "foo" }; >a : string >"foo" : "foo" ->{ a: "foo" } : { a?: string; } +>{ a: "foo" } : { a?: "foo"; } >a : string >"foo" : "foo" @@ -44,7 +44,7 @@ let { b = "foo" as "foo" } = { b: "bar" }; >"bar" : "bar" let { c = "foo" } = { c: "bar" as "bar" }; ->c : "foo" | "bar" +>c : string >"foo" : "foo" >{ c: "bar" as "bar" } : { c?: "bar"; } >c : "bar" diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.types b/tests/baselines/reference/logicalNotOperatorWithNumberType.types index f66f878c3bee7..4b84af2ca6eda 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.types +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.types b/tests/baselines/reference/logicalNotOperatorWithStringType.types index 0d3c1e88fd1d3..255d5944bd5c3 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.types +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.types @@ -5,7 +5,7 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] ->["", "abc"] : string[] +>["", "abc"] : ("" | "abc")[] >"" : "" >"abc" : "abc" diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.errors.txt b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.errors.txt index 484c8f63b462e..2b8ba83f5622c 100644 --- a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.errors.txt +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrExpressionIsContextuallyTyped.ts(6,33): error TS2322: Type '{ a: string; b: number; } | { a: string; b: boolean; }' is not assignable to type '{ a: string; }'. - Type '{ a: string; b: number; }' is not assignable to type '{ a: string; }'. +tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrExpressionIsContextuallyTyped.ts(6,33): error TS2322: Type '{ a: ""; b: number; } | { a: ""; b: boolean; }' is not assignable to type '{ a: string; }'. + Type '{ a: ""; b: number; }' is not assignable to type '{ a: string; }'. Object literal may only specify known properties, and 'b' does not exist in type '{ a: string; }'. @@ -11,6 +11,6 @@ tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrE var r: { a: string } = { a: '', b: 123 } || { a: '', b: true }; ~~~~~~ -!!! error TS2322: Type '{ a: string; b: number; } | { a: string; b: boolean; }' is not assignable to type '{ a: string; }'. -!!! error TS2322: Type '{ a: string; b: number; }' is not assignable to type '{ a: string; }'. +!!! error TS2322: Type '{ a: ""; b: number; } | { a: ""; b: boolean; }' is not assignable to type '{ a: string; }'. +!!! error TS2322: Type '{ a: ""; b: number; }' is not assignable to type '{ a: string; }'. !!! error TS2322: Object literal may only specify known properties, and 'b' does not exist in type '{ a: string; }'. \ No newline at end of file diff --git a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types index 916a375568837..024eabaf9a314 100644 --- a/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types +++ b/tests/baselines/reference/logicalOrExpressionIsContextuallyTyped.types @@ -7,13 +7,13 @@ var r: { a: string } = { a: '', b: 123 } || { a: '', b: true }; >r : { a: string; } >a : string ->{ a: '', b: 123 } || { a: '', b: true } : { a: string; b: number; } | { a: string; b: boolean; } ->{ a: '', b: 123 } : { a: string; b: number; } +>{ a: '', b: 123 } || { a: '', b: true } : { a: ""; b: number; } | { a: ""; b: boolean; } +>{ a: '', b: 123 } : { a: ""; b: number; } >a : string >'' : "" >b : number >123 : 123 ->{ a: '', b: true } : { a: string; b: boolean; } +>{ a: '', b: true } : { a: ""; b: boolean; } >a : string >'' : "" >b : boolean diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types index bc7bcbf4c2e16..d04d7bc9cb114 100644 --- a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types @@ -107,10 +107,10 @@ function fn3u : U var r3 = t || { a: '' }; ->r3 : T | { a: string; } ->t || { a: '' } : T | { a: string; } +>r3 : T | { a: ""; } +>t || { a: '' } : T | { a: ""; } >t : T ->{ a: '' } : { a: string; } +>{ a: '' } : { a: ""; } >a : string >'' : "" diff --git a/tests/baselines/reference/looseThisTypeInFunctions.types b/tests/baselines/reference/looseThisTypeInFunctions.types index 114b5407a1f93..bafa78a3d3812 100644 --- a/tests/baselines/reference/looseThisTypeInFunctions.types +++ b/tests/baselines/reference/looseThisTypeInFunctions.types @@ -109,7 +109,7 @@ let i: I = o; let o2: I = { >o2 : I >I : I ->{ n: 1001, explicitThis: function (m) { return m + this.n.length; // error, this.n: number, no member 'length' },} : { n: number; explicitThis: (this: I, m: number) => any; } +>{ n: 1001, explicitThis: function (m) { return m + this.n.length; // error, this.n: number, no member 'length' },} : { n: 1001; explicitThis: (this: I, m: number) => any; } n: 1001, >n : number diff --git a/tests/baselines/reference/mapOnTupleTypes01.types b/tests/baselines/reference/mapOnTupleTypes01.types index adb8a2e191c26..f897f50600db8 100644 --- a/tests/baselines/reference/mapOnTupleTypes01.types +++ b/tests/baselines/reference/mapOnTupleTypes01.types @@ -19,7 +19,7 @@ export let mapOnLooseArrayLiteral = [1, 2, 3, 4].map(n => n * n); let numTuple: [number] = [1]; >numTuple : [number] ->[1] : [number] +>[1] : [1] >1 : 1 export let a = numTuple.map(x => x * x); @@ -38,19 +38,19 @@ export let a = numTuple.map(x => x * x); let numNum: [number, number] = [ 100, 100]; >numNum : [number, number] ->[ 100, 100] : [number, number] +>[ 100, 100] : [100, 100] >100 : 100 >100 : 100 let strStr: [string, string] = ["hello", "hello"]; >strStr : [string, string] ->["hello", "hello"] : [string, string] +>["hello", "hello"] : ["hello", "hello"] >"hello" : "hello" >"hello" : "hello" let numStr: [number, string] = [ 100, "hello"]; >numStr : [number, string] ->[ 100, "hello"] : [number, string] +>[ 100, "hello"] : [100, "hello"] >100 : 100 >"hello" : "hello" @@ -94,7 +94,7 @@ export let d = numStr.map(x => x); let numNumNum: [number, number, number] = [1, 2, 3]; >numNumNum : [number, number, number] ->[1, 2, 3] : [number, number, number] +>[1, 2, 3] : [1, 2, 3] >1 : 1 >2 : 2 >3 : 3 @@ -115,7 +115,7 @@ export let e = numNumNum.map(n => n * n); let numNumNumNum: [number, number, number, number] = [1, 2, 3, 4]; >numNumNumNum : [number, number, number, number] ->[1, 2, 3, 4] : [number, number, number, number] +>[1, 2, 3, 4] : [1, 2, 3, 4] >1 : 1 >2 : 2 >3 : 3 @@ -137,7 +137,7 @@ export let f = numNumNumNum.map(n => n * n); let numNumNumNumNum: [number, number, number, number, number] = [1, 2, 3, 4, 5]; >numNumNumNumNum : [number, number, number, number, number] ->[1, 2, 3, 4, 5] : [number, number, number, number, number] +>[1, 2, 3, 4, 5] : [1, 2, 3, 4, 5] >1 : 1 >2 : 2 >3 : 3 @@ -161,7 +161,7 @@ export let g = numNumNumNumNum.map(n => n * n); let numNumNumNumNumNum: [number, number, number, number, number, number] = [1, 2, 3, 4, 5, 6]; >numNumNumNumNumNum : [number, number, number, number, number, number] ->[1, 2, 3, 4, 5, 6] : [number, number, number, number, number, number] +>[1, 2, 3, 4, 5, 6] : [1, 2, 3, 4, 5, 6] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index 396adaadf342c..137f5fa7beacb 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -20,11 +20,11 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(59,9): error TS2403: Su tests/cases/conformance/types/mapped/mappedTypeErrors.ts(60,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]: T[P]; }'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(61,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(66,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 64:8, but here has type '{ [P in keyof T]: T[P][]; }'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(75,45): error TS2345: Argument of type '{ x: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. - Property 'y' is missing in type '{ x: number; }'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(77,59): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(75,45): error TS2345: Argument of type '{ x: 1; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. + Property 'y' is missing in type '{ x: 1; }'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(77,59): error TS2345: Argument of type '{ x: 1; y: 1; z: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. Object literal may only specify known properties, and 'z' does not exist in type 'Readonly<{ x: number; y: number; }>'. -tests/cases/conformance/types/mapped/mappedTypeErrors.ts(83,58): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Partial<{ x: number; y: number; }>'. +tests/cases/conformance/types/mapped/mappedTypeErrors.ts(83,58): error TS2345: Argument of type '{ x: 1; y: 1; z: number; }' is not assignable to parameter of type 'Partial<{ x: number; y: number; }>'. Object literal may only specify known properties, and 'z' does not exist in type 'Partial<{ x: number; y: number; }>'. tests/cases/conformance/types/mapped/mappedTypeErrors.ts(105,15): error TS2345: Argument of type '{ a: undefined; }' is not assignable to parameter of type 'Pick'. Types of property 'a' are incompatible. @@ -162,12 +162,12 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: function f20() { let x1 = objAndReadonly({ x: 0, y: 0 }, { x: 1 }); // Error ~~~~~~~~ -!!! error TS2345: Argument of type '{ x: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. -!!! error TS2345: Property 'y' is missing in type '{ x: number; }'. +!!! error TS2345: Argument of type '{ x: 1; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. +!!! error TS2345: Property 'y' is missing in type '{ x: 1; }'. let x2 = objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1 }); let x3 = objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }); // Error ~~~~ -!!! error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. +!!! error TS2345: Argument of type '{ x: 1; y: 1; z: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'. !!! error TS2345: Object literal may only specify known properties, and 'z' does not exist in type 'Readonly<{ x: number; y: number; }>'. } @@ -176,7 +176,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536: let x2 = objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1 }); let x3 = objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1, z: 1 }); // Error ~~~~ -!!! error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Partial<{ x: number; y: number; }>'. +!!! error TS2345: Argument of type '{ x: 1; y: 1; z: number; }' is not assignable to parameter of type 'Partial<{ x: number; y: number; }>'. !!! error TS2345: Object literal may only specify known properties, and 'z' does not exist in type 'Partial<{ x: number; y: number; }>'. } diff --git a/tests/baselines/reference/mappedTypeErrors.types b/tests/baselines/reference/mappedTypeErrors.types index e830f9ce65dee..eb97183dd5663 100644 --- a/tests/baselines/reference/mappedTypeErrors.types +++ b/tests/baselines/reference/mappedTypeErrors.types @@ -270,12 +270,12 @@ function f20() { >x2 : { x: number; y: number; } >objAndReadonly({ x: 0, y: 0 }, { x: 1, y: 1 }) : { x: number; y: number; } >objAndReadonly : (primary: T, secondary: Readonly) => T ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number >0 : 0 ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ x: 1, y: 1 } : { x: 1; y: 1; } >x : number >1 : 1 >y : number @@ -306,12 +306,12 @@ function f21() { >x1 : { x: number; y: number; } >objAndPartial({ x: 0, y: 0 }, { x: 1 }) : { x: number; y: number; } >objAndPartial : (primary: T, secondary: Partial) => T ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number >0 : 0 ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 @@ -319,12 +319,12 @@ function f21() { >x2 : { x: number; y: number; } >objAndPartial({ x: 0, y: 0 }, { x: 1, y: 1 }) : { x: number; y: number; } >objAndPartial : (primary: T, secondary: Partial) => T ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number >0 : 0 ->{ x: 1, y: 1 } : { x: number; y: number; } +>{ x: 1, y: 1 } : { x: 1; y: 1; } >x : number >1 : 1 >y : number @@ -390,7 +390,7 @@ function setState(obj: T, props: Pick) { let foo: Foo = { a: "hello", b: 42 }; >foo : Foo >Foo : Foo ->{ a: "hello", b: 42 } : { a: string; b: number; } +>{ a: "hello", b: 42 } : { a: "hello"; b: 42; } >a : string >"hello" : "hello" >b : number @@ -400,7 +400,7 @@ setState(foo, { a: "test", b: 43 }) >setState(foo, { a: "test", b: 43 }) : void >setState : (obj: T, props: Pick) => void >foo : Foo ->{ a: "test", b: 43 } : { a: string; b: number; } +>{ a: "test", b: 43 } : { a: "test"; b: 43; } >a : string >"test" : "test" >b : number @@ -410,7 +410,7 @@ setState(foo, { a: "hi" }); >setState(foo, { a: "hi" }) : void >setState : (obj: T, props: Pick) => void >foo : Foo ->{ a: "hi" } : { a: string; } +>{ a: "hi" } : { a: "hi"; } >a : string >"hi" : "hi" @@ -496,7 +496,7 @@ c.setState({ a: "test", b: 43 }); >c.setState : (props: Pick) => void >c : C >setState : (props: Pick) => void ->{ a: "test", b: 43 } : { a: string; b: number; } +>{ a: "test", b: 43 } : { a: "test"; b: 43; } >a : string >"test" : "test" >b : number @@ -507,7 +507,7 @@ c.setState({ a: "hi" }); >c.setState : (props: Pick) => void >c : C >setState : (props: Pick) => void ->{ a: "hi" } : { a: string; } +>{ a: "hi" } : { a: "hi"; } >a : string >"hi" : "hi" @@ -613,7 +613,7 @@ type O = {x: number, y: boolean}; let o: O = {x: 5, y: false}; >o : O >O : O ->{x: 5, y: false} : { x: number; y: false; } +>{x: 5, y: false} : { x: 5; y: false; } >x : number >5 : 5 >y : boolean @@ -623,11 +623,11 @@ let f: Foo2 = { >f : Foo2 >Foo2 : Foo2 >O : O ->{ pf: {x: 7}, pt: {x: 7, y: false},} : { pf: { x: number; }; pt: { x: number; y: boolean; }; } +>{ pf: {x: 7}, pt: {x: 7, y: false},} : { pf: { x: 7; }; pt: { x: number; y: boolean; }; } pf: {x: 7}, ->pf : { x: number; } ->{x: 7} : { x: number; } +>pf : { x: 7; } +>{x: 7} : { x: 7; } >x : number >7 : 7 diff --git a/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt b/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt index 28bc188f7b64d..5a6c4008dfec4 100644 --- a/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeInferenceErrors.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts(9,5): error TS2345: Argument of type '{ props: { x: number; y: number; }; computed: { bar(): number; baz: number; }; }' is not assignable to parameter of type '{ props: { x: number; y: number; }; computed: ComputedOf<{ bar: number; baz: {}; }>; } & ThisType<{ x: number; y: number; } & { bar: number; baz: {}; }>'. - Type '{ props: { x: number; y: number; }; computed: { bar(): number; baz: number; }; }' is not assignable to type '{ props: { x: number; y: number; }; computed: ComputedOf<{ bar: number; baz: {}; }>; }'. +tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts(9,5): error TS2345: Argument of type '{ props: { x: 10; y: 20; }; computed: { bar(): number; baz: number; }; }' is not assignable to parameter of type '{ props: { x: number; y: number; }; computed: ComputedOf<{ bar: number; baz: {}; }>; } & ThisType<{ x: number; y: number; } & { bar: number; baz: {}; }>'. + Type '{ props: { x: 10; y: 20; }; computed: { bar(): number; baz: number; }; }' is not assignable to type '{ props: { x: number; y: number; }; computed: ComputedOf<{ bar: number; baz: {}; }>; }'. Types of property 'computed' are incompatible. Type '{ bar(): number; baz: number; }' is not assignable to type 'ComputedOf<{ bar: number; baz: {}; }>'. Types of property 'baz' are incompatible. @@ -35,8 +35,8 @@ tests/cases/conformance/types/mapped/mappedTypeInferenceErrors.ts(9,5): error TS ~~~~~ }); ~ -!!! error TS2345: Argument of type '{ props: { x: number; y: number; }; computed: { bar(): number; baz: number; }; }' is not assignable to parameter of type '{ props: { x: number; y: number; }; computed: ComputedOf<{ bar: number; baz: {}; }>; } & ThisType<{ x: number; y: number; } & { bar: number; baz: {}; }>'. -!!! error TS2345: Type '{ props: { x: number; y: number; }; computed: { bar(): number; baz: number; }; }' is not assignable to type '{ props: { x: number; y: number; }; computed: ComputedOf<{ bar: number; baz: {}; }>; }'. +!!! error TS2345: Argument of type '{ props: { x: 10; y: 20; }; computed: { bar(): number; baz: number; }; }' is not assignable to parameter of type '{ props: { x: number; y: number; }; computed: ComputedOf<{ bar: number; baz: {}; }>; } & ThisType<{ x: number; y: number; } & { bar: number; baz: {}; }>'. +!!! error TS2345: Type '{ props: { x: 10; y: 20; }; computed: { bar(): number; baz: number; }; }' is not assignable to type '{ props: { x: number; y: number; }; computed: ComputedOf<{ bar: number; baz: {}; }>; }'. !!! error TS2345: Types of property 'computed' are incompatible. !!! error TS2345: Type '{ bar(): number; baz: number; }' is not assignable to type 'ComputedOf<{ bar: number; baz: {}; }>'. !!! error TS2345: Types of property 'baz' are incompatible. diff --git a/tests/baselines/reference/mappedTypeNestedGenericInstantiation.types b/tests/baselines/reference/mappedTypeNestedGenericInstantiation.types index 7501bdb19e87d..b12cca2d42449 100644 --- a/tests/baselines/reference/mappedTypeNestedGenericInstantiation.types +++ b/tests/baselines/reference/mappedTypeNestedGenericInstantiation.types @@ -47,7 +47,7 @@ const v = chain({a: 1, b: 2}).mapValues(square).value(); >chain({a: 1, b: 2}).mapValues : (func: (v: number) => U) => Chainable<{ a: U; b: U; }> >chain({a: 1, b: 2}) : Chainable<{ a: number; b: number; }> >chain : (t: T) => Chainable ->{a: 1, b: 2} : { a: number; b: number; } +>{a: 1, b: 2} : { a: 1; b: 2; } >a : number >1 : 1 >b : number diff --git a/tests/baselines/reference/mappedTypes2.types b/tests/baselines/reference/mappedTypes2.types index 7c54fffcb08d0..370fecf7d7f11 100644 --- a/tests/baselines/reference/mappedTypes2.types +++ b/tests/baselines/reference/mappedTypes2.types @@ -222,7 +222,7 @@ function f0(s1: Shape, s2: Shape) { >assign(s1, { name: "circle" }) : void >assign : (obj: T, props: Partial) => void >s1 : Shape ->{ name: "circle" } : { name: string; } +>{ name: "circle" } : { name: "circle"; } >name : string >"circle" : "circle" @@ -230,7 +230,7 @@ function f0(s1: Shape, s2: Shape) { >assign(s2, { width: 10, height: 20 }) : void >assign : (obj: T, props: Partial) => void >s2 : Shape ->{ width: 10, height: 20 } : { width: number; height: number; } +>{ width: 10, height: 20 } : { width: 10; height: 20; } >width : number >10 : 10 >height : number diff --git a/tests/baselines/reference/matchingOfObjectLiteralConstraints.types b/tests/baselines/reference/matchingOfObjectLiteralConstraints.types index 76f61c978a83a..a9bef83d92517 100644 --- a/tests/baselines/reference/matchingOfObjectLiteralConstraints.types +++ b/tests/baselines/reference/matchingOfObjectLiteralConstraints.types @@ -13,7 +13,7 @@ function foo2(x: U, z: T) { } foo2({ y: "foo" }, "foo"); >foo2({ y: "foo" }, "foo") : void >foo2 : (x: U, z: T) => void ->{ y: "foo" } : { y: string; } +>{ y: "foo" } : { y: "foo"; } >y : string >"foo" : "foo" >"foo" : "foo" diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt index 9b95b143d648b..6fb966e18775a 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(10,30): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number'. +tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(10,30): error TS2345: Argument of type '(string | 1)[]' is not assignable to parameter of type 'number[]'. + Type 'string | 1' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,11): error TS2558: Expected 2 type arguments, but got 1. @@ -16,8 +16,8 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,11): e var r6 = map([1, ""], (x) => x.toString()); var r7 = map([1, ""], (x) => x.toString()); // error ~~~~~~~ -!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number'. +!!! error TS2345: Argument of type '(string | 1)[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: Type 'string | 1' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. var r7b = map([1, ""], (x) => x.toString()); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.types b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.types index 8e5a4cf25de8e..649c5fa10fab2 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.types +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.types @@ -38,7 +38,7 @@ var r0 = map([1, ""], (x) => x.toString()); >r0 : string[] >map([1, ""], (x) => x.toString()) : string[] >map : (xs: T[], f: (x: T) => U) => U[] ->[1, ""] : (string | number)[] +>[1, ""] : (1 | "")[] >1 : 1 >"" : "" >(x) => x.toString() : (x: string | number) => string diff --git a/tests/baselines/reference/missingAndExcessProperties.types b/tests/baselines/reference/missingAndExcessProperties.types index 4a8f598725bbf..0fe5833d7e349 100644 --- a/tests/baselines/reference/missingAndExcessProperties.types +++ b/tests/baselines/reference/missingAndExcessProperties.types @@ -137,34 +137,34 @@ function f4() { >0 : 0 ({ x } = { x: 0, y: 0 }); ->({ x } = { x: 0, y: 0 }) : { x: number; y: number; } ->{ x } = { x: 0, y: 0 } : { x: number; y: number; } +>({ x } = { x: 0, y: 0 }) : { x: 0; y: number; } +>{ x } = { x: 0, y: 0 } : { x: 0; y: number; } >{ x } : { x: number; } >x : number ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: number; } >x : number >0 : 0 >y : number >0 : 0 ({ y } = { x: 0, y: 0 }); ->({ y } = { x: 0, y: 0 }) : { x: number; y: number; } ->{ y } = { x: 0, y: 0 } : { x: number; y: number; } +>({ y } = { x: 0, y: 0 }) : { x: number; y: 0; } +>{ y } = { x: 0, y: 0 } : { x: number; y: 0; } >{ y } : { y: number; } >y : number ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: number; y: 0; } >x : number >0 : 0 >y : number >0 : 0 ({ x, y } = { x: 0, y: 0 }); ->({ x, y } = { x: 0, y: 0 }) : { x: number; y: number; } ->{ x, y } = { x: 0, y: 0 } : { x: number; y: number; } +>({ x, y } = { x: 0, y: 0 }) : { x: 0; y: 0; } +>{ x, y } = { x: 0, y: 0 } : { x: 0; y: 0; } >{ x, y } : { x: number; y: number; } >x : number >y : number ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/multipleInheritance.types b/tests/baselines/reference/multipleInheritance.types index dedde8a154e4e..5e6f8d54294ac 100644 --- a/tests/baselines/reference/multipleInheritance.types +++ b/tests/baselines/reference/multipleInheritance.types @@ -55,7 +55,7 @@ class Good { public f:() => number = function() { return 0; } >f : () => number ->function() { return 0; } : () => number +>function() { return 0; } : () => 0 >0 : 0 public g() { return 0; } diff --git a/tests/baselines/reference/multipleNumericIndexers.types b/tests/baselines/reference/multipleNumericIndexers.types index a9da566aae772..bc68d40eae64d 100644 --- a/tests/baselines/reference/multipleNumericIndexers.types +++ b/tests/baselines/reference/multipleNumericIndexers.types @@ -41,7 +41,7 @@ var b: { >x : number } = { 1: '', "2": '' } ->{ 1: '', "2": '' } : { 1: string; "2": string; } +>{ 1: '', "2": '' } : { 1: ""; "2": ""; } >'' : "" >'' : "" diff --git a/tests/baselines/reference/multipleStringIndexers.types b/tests/baselines/reference/multipleStringIndexers.types index 96d7b4e0e7029..5a5eaee5ccd3d 100644 --- a/tests/baselines/reference/multipleStringIndexers.types +++ b/tests/baselines/reference/multipleStringIndexers.types @@ -41,7 +41,7 @@ var b: { >x : string } = { y: '' } ->{ y: '' } : { y: string; } +>{ y: '' } : { y: ""; } >y : string >'' : "" diff --git a/tests/baselines/reference/negateOperatorWithNumberType.types b/tests/baselines/reference/negateOperatorWithNumberType.types index d3d9b47463794..084f3c1e55170 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.types +++ b/tests/baselines/reference/negateOperatorWithNumberType.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/negateOperatorWithStringType.types b/tests/baselines/reference/negateOperatorWithStringType.types index 053fd1138018c..99b1447a581f9 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.types +++ b/tests/baselines/reference/negateOperatorWithStringType.types @@ -5,7 +5,7 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] ->["", "abc"] : string[] +>["", "abc"] : ("" | "abc")[] >"" : "" >"abc" : "abc" diff --git a/tests/baselines/reference/nestedLoops.types b/tests/baselines/reference/nestedLoops.types index f4a743f4aaf84..659ce0ea453cc 100644 --- a/tests/baselines/reference/nestedLoops.types +++ b/tests/baselines/reference/nestedLoops.types @@ -7,7 +7,7 @@ export class Test { let outerArray: Array = [1, 2, 3]; >outerArray : number[] >Array : T[] ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 @@ -15,7 +15,7 @@ export class Test { let innerArray: Array = [1, 2, 3]; >innerArray : number[] >Array : T[] ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/nestedModules.types b/tests/baselines/reference/nestedModules.types index 95f6ae406696f..6ab4dd2afbbe4 100644 --- a/tests/baselines/reference/nestedModules.types +++ b/tests/baselines/reference/nestedModules.types @@ -25,7 +25,7 @@ module A { >Point : C.Point >C : any >Point : C.Point ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/nestedTypeVariableInfersLiteral.js b/tests/baselines/reference/nestedTypeVariableInfersLiteral.js new file mode 100644 index 0000000000000..119dde5fa76b4 --- /dev/null +++ b/tests/baselines/reference/nestedTypeVariableInfersLiteral.js @@ -0,0 +1,31 @@ +//// [nestedTypeVariableInfersLiteral.ts] +// https://github.com/Microsoft/TypeScript/issues/19632 +declare function direct(a: A | A[]): Record +declare function nested(a: { fields: A }): Record +declare function nestedUnion(a: { fields: A | A[] }): Record + +const directUnionSingle = direct("z") +const directUnionArray = direct(["z", "y"]) +const nestedSingle = nested({fields: "z"}) +const nestedUnionSingle = nestedUnion({fields: "z"}) +const nestedUnionArray = nestedUnion({fields: ["z", "y"]}) + +declare function hasZField(arg: { z: string }): void + +hasZField(directUnionSingle) // ok +hasZField(directUnionArray) // ok +hasZField(nestedSingle) // ok +hasZField(nestedUnionSingle) // ok +hasZField(nestedUnionArray) // ok + +//// [nestedTypeVariableInfersLiteral.js] +var directUnionSingle = direct("z"); +var directUnionArray = direct(["z", "y"]); +var nestedSingle = nested({ fields: "z" }); +var nestedUnionSingle = nestedUnion({ fields: "z" }); +var nestedUnionArray = nestedUnion({ fields: ["z", "y"] }); +hasZField(directUnionSingle); // ok +hasZField(directUnionArray); // ok +hasZField(nestedSingle); // ok +hasZField(nestedUnionSingle); // ok +hasZField(nestedUnionArray); // ok diff --git a/tests/baselines/reference/nestedTypeVariableInfersLiteral.symbols b/tests/baselines/reference/nestedTypeVariableInfersLiteral.symbols new file mode 100644 index 0000000000000..ce9e4915e3f06 --- /dev/null +++ b/tests/baselines/reference/nestedTypeVariableInfersLiteral.symbols @@ -0,0 +1,78 @@ +=== tests/cases/compiler/nestedTypeVariableInfersLiteral.ts === +// https://github.com/Microsoft/TypeScript/issues/19632 +declare function direct(a: A | A[]): Record +>direct : Symbol(direct, Decl(nestedTypeVariableInfersLiteral.ts, 0, 0)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 1, 24)) +>a : Symbol(a, Decl(nestedTypeVariableInfersLiteral.ts, 1, 42)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 1, 24)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 1, 24)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 1, 24)) + +declare function nested(a: { fields: A }): Record +>nested : Symbol(nested, Decl(nestedTypeVariableInfersLiteral.ts, 1, 72)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 2, 24)) +>a : Symbol(a, Decl(nestedTypeVariableInfersLiteral.ts, 2, 42)) +>fields : Symbol(fields, Decl(nestedTypeVariableInfersLiteral.ts, 2, 46)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 2, 24)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 2, 24)) + +declare function nestedUnion(a: { fields: A | A[] }): Record +>nestedUnion : Symbol(nestedUnion, Decl(nestedTypeVariableInfersLiteral.ts, 2, 78)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 3, 29)) +>a : Symbol(a, Decl(nestedTypeVariableInfersLiteral.ts, 3, 47)) +>fields : Symbol(fields, Decl(nestedTypeVariableInfersLiteral.ts, 3, 51)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 3, 29)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 3, 29)) +>Record : Symbol(Record, Decl(lib.d.ts, --, --)) +>A : Symbol(A, Decl(nestedTypeVariableInfersLiteral.ts, 3, 29)) + +const directUnionSingle = direct("z") +>directUnionSingle : Symbol(directUnionSingle, Decl(nestedTypeVariableInfersLiteral.ts, 5, 5)) +>direct : Symbol(direct, Decl(nestedTypeVariableInfersLiteral.ts, 0, 0)) + +const directUnionArray = direct(["z", "y"]) +>directUnionArray : Symbol(directUnionArray, Decl(nestedTypeVariableInfersLiteral.ts, 6, 5)) +>direct : Symbol(direct, Decl(nestedTypeVariableInfersLiteral.ts, 0, 0)) + +const nestedSingle = nested({fields: "z"}) +>nestedSingle : Symbol(nestedSingle, Decl(nestedTypeVariableInfersLiteral.ts, 7, 5)) +>nested : Symbol(nested, Decl(nestedTypeVariableInfersLiteral.ts, 1, 72)) +>fields : Symbol(fields, Decl(nestedTypeVariableInfersLiteral.ts, 7, 29)) + +const nestedUnionSingle = nestedUnion({fields: "z"}) +>nestedUnionSingle : Symbol(nestedUnionSingle, Decl(nestedTypeVariableInfersLiteral.ts, 8, 5)) +>nestedUnion : Symbol(nestedUnion, Decl(nestedTypeVariableInfersLiteral.ts, 2, 78)) +>fields : Symbol(fields, Decl(nestedTypeVariableInfersLiteral.ts, 8, 39)) + +const nestedUnionArray = nestedUnion({fields: ["z", "y"]}) +>nestedUnionArray : Symbol(nestedUnionArray, Decl(nestedTypeVariableInfersLiteral.ts, 9, 5)) +>nestedUnion : Symbol(nestedUnion, Decl(nestedTypeVariableInfersLiteral.ts, 2, 78)) +>fields : Symbol(fields, Decl(nestedTypeVariableInfersLiteral.ts, 9, 38)) + +declare function hasZField(arg: { z: string }): void +>hasZField : Symbol(hasZField, Decl(nestedTypeVariableInfersLiteral.ts, 9, 58)) +>arg : Symbol(arg, Decl(nestedTypeVariableInfersLiteral.ts, 11, 27)) +>z : Symbol(z, Decl(nestedTypeVariableInfersLiteral.ts, 11, 33)) + +hasZField(directUnionSingle) // ok +>hasZField : Symbol(hasZField, Decl(nestedTypeVariableInfersLiteral.ts, 9, 58)) +>directUnionSingle : Symbol(directUnionSingle, Decl(nestedTypeVariableInfersLiteral.ts, 5, 5)) + +hasZField(directUnionArray) // ok +>hasZField : Symbol(hasZField, Decl(nestedTypeVariableInfersLiteral.ts, 9, 58)) +>directUnionArray : Symbol(directUnionArray, Decl(nestedTypeVariableInfersLiteral.ts, 6, 5)) + +hasZField(nestedSingle) // ok +>hasZField : Symbol(hasZField, Decl(nestedTypeVariableInfersLiteral.ts, 9, 58)) +>nestedSingle : Symbol(nestedSingle, Decl(nestedTypeVariableInfersLiteral.ts, 7, 5)) + +hasZField(nestedUnionSingle) // ok +>hasZField : Symbol(hasZField, Decl(nestedTypeVariableInfersLiteral.ts, 9, 58)) +>nestedUnionSingle : Symbol(nestedUnionSingle, Decl(nestedTypeVariableInfersLiteral.ts, 8, 5)) + +hasZField(nestedUnionArray) // ok +>hasZField : Symbol(hasZField, Decl(nestedTypeVariableInfersLiteral.ts, 9, 58)) +>nestedUnionArray : Symbol(nestedUnionArray, Decl(nestedTypeVariableInfersLiteral.ts, 9, 5)) + diff --git a/tests/baselines/reference/nestedTypeVariableInfersLiteral.types b/tests/baselines/reference/nestedTypeVariableInfersLiteral.types new file mode 100644 index 0000000000000..ed52dbb41b5b3 --- /dev/null +++ b/tests/baselines/reference/nestedTypeVariableInfersLiteral.types @@ -0,0 +1,100 @@ +=== tests/cases/compiler/nestedTypeVariableInfersLiteral.ts === +// https://github.com/Microsoft/TypeScript/issues/19632 +declare function direct(a: A | A[]): Record +>direct : (a: A | A[]) => Record +>A : A +>a : A | A[] +>A : A +>A : A +>Record : Record +>A : A + +declare function nested(a: { fields: A }): Record +>nested : (a: { fields: A; }) => Record +>A : A +>a : { fields: A; } +>fields : A +>A : A +>Record : Record +>A : A + +declare function nestedUnion(a: { fields: A | A[] }): Record +>nestedUnion : (a: { fields: A | A[]; }) => Record +>A : A +>a : { fields: A | A[]; } +>fields : A | A[] +>A : A +>A : A +>Record : Record +>A : A + +const directUnionSingle = direct("z") +>directUnionSingle : Record<"z", string> +>direct("z") : Record<"z", string> +>direct : (a: A | A[]) => Record +>"z" : "z" + +const directUnionArray = direct(["z", "y"]) +>directUnionArray : Record<"z" | "y", string> +>direct(["z", "y"]) : Record<"z" | "y", string> +>direct : (a: A | A[]) => Record +>["z", "y"] : ("z" | "y")[] +>"z" : "z" +>"y" : "y" + +const nestedSingle = nested({fields: "z"}) +>nestedSingle : Record<"z", string> +>nested({fields: "z"}) : Record<"z", string> +>nested : (a: { fields: A; }) => Record +>{fields: "z"} : { fields: "z"; } +>fields : string +>"z" : "z" + +const nestedUnionSingle = nestedUnion({fields: "z"}) +>nestedUnionSingle : Record<"z", string> +>nestedUnion({fields: "z"}) : Record<"z", string> +>nestedUnion : (a: { fields: A | A[]; }) => Record +>{fields: "z"} : { fields: "z"; } +>fields : string +>"z" : "z" + +const nestedUnionArray = nestedUnion({fields: ["z", "y"]}) +>nestedUnionArray : Record<"z" | "y", string> +>nestedUnion({fields: ["z", "y"]}) : Record<"z" | "y", string> +>nestedUnion : (a: { fields: A | A[]; }) => Record +>{fields: ["z", "y"]} : { fields: ("z" | "y")[]; } +>fields : ("z" | "y")[] +>["z", "y"] : ("z" | "y")[] +>"z" : "z" +>"y" : "y" + +declare function hasZField(arg: { z: string }): void +>hasZField : (arg: { z: string; }) => void +>arg : { z: string; } +>z : string + +hasZField(directUnionSingle) // ok +>hasZField(directUnionSingle) : void +>hasZField : (arg: { z: string; }) => void +>directUnionSingle : Record<"z", string> + +hasZField(directUnionArray) // ok +>hasZField(directUnionArray) : void +>hasZField : (arg: { z: string; }) => void +>directUnionArray : Record<"z" | "y", string> + +hasZField(nestedSingle) // ok +>hasZField(nestedSingle) : void +>hasZField : (arg: { z: string; }) => void +>nestedSingle : Record<"z", string> + +hasZField(nestedUnionSingle) // ok +>hasZField(nestedUnionSingle) : void +>hasZField : (arg: { z: string; }) => void +>nestedUnionSingle : Record<"z", string> + +hasZField(nestedUnionArray) // ok +>hasZField(nestedUnionArray) : void +>hasZField : (arg: { z: string; }) => void +>nestedUnionArray : Record<"z" | "y", string> + diff --git a/tests/baselines/reference/neverInference.types b/tests/baselines/reference/neverInference.types index 2f4b9e0cc1e23..372e837ecc1f0 100644 --- a/tests/baselines/reference/neverInference.types +++ b/tests/baselines/reference/neverInference.types @@ -103,7 +103,7 @@ f2(Array.from([0]), [], (a1, a2) => a1 - a2); >Array.from : { (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor >from : { (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } ->[0] : number[] +>[0] : 0[] >0 : 0 >[] : never[] >(a1, a2) => a1 - a2 : (a1: number, a2: number) => number @@ -121,7 +121,7 @@ f2(Array.from([]), [0], (a1, a2) => a1 - a2); >Array : ArrayConstructor >from : { (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >[] : never[] ->[0] : number[] +>[0] : 0[] >0 : 0 >(a1, a2) => a1 - a2 : (a1: number, a2: number) => number >a1 : number diff --git a/tests/baselines/reference/neverType.types b/tests/baselines/reference/neverType.types index efedf4629ac7e..0af3e391dcbd9 100644 --- a/tests/baselines/reference/neverType.types +++ b/tests/baselines/reference/neverType.types @@ -213,7 +213,7 @@ let errorCallback = () => error("Error callback"); test(() => "hello"); >test(() => "hello") : string >test : (cb: () => string) => string ->() => "hello" : () => string +>() => "hello" : () => "hello" >"hello" : "hello" test(() => fail()); diff --git a/tests/baselines/reference/noCrashOnImportShadowing.types b/tests/baselines/reference/noCrashOnImportShadowing.types index 6a09ba44e491b..df35e567ebdf2 100644 --- a/tests/baselines/reference/noCrashOnImportShadowing.types +++ b/tests/baselines/reference/noCrashOnImportShadowing.types @@ -17,7 +17,7 @@ interface B { const x: B = { x: "" }; >x : B >B : B ->{ x: "" } : { x: string; } +>{ x: "" } : { x: ""; } >x : string >"" : "" @@ -36,7 +36,7 @@ import { B } from "./a"; const x: B = { x: "" }; >x : B >B : B ->{ x: "" } : { x: string; } +>{ x: "" } : { x: ""; } >x : string >"" : "" diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types index c494d0795dd55..6b4e4e3c59776 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration2.types @@ -15,7 +15,7 @@ let [a1 = 10, b1 = 10, c1 = 10] = [1, 2, 3]; // no error >10 : 10 >c1 : number >10 : 10 ->[1, 2, 3] : [number, number, number] +>[1, 2, 3] : [1, 2, 3] >1 : 1 >2 : 2 >3 : 3 @@ -82,7 +82,7 @@ let {x1 = 10, y1 = 10, z1 = 10} = { x1: 1, y1: 2, z1: 3 }; // no error >10 : 10 >z1 : number >10 : 10 ->{ x1: 1, y1: 2, z1: 3 } : { x1?: number; y1?: number; z1?: number; } +>{ x1: 1, y1: 2, z1: 3 } : { x1?: 1; y1?: 2; z1?: 3; } >x1 : number >1 : 1 >y1 : number diff --git a/tests/baselines/reference/noImplicitAnyInCastExpression.types b/tests/baselines/reference/noImplicitAnyInCastExpression.types index 12faca069f0d8..cd29e0e65f461 100644 --- a/tests/baselines/reference/noImplicitAnyInCastExpression.types +++ b/tests/baselines/reference/noImplicitAnyInCastExpression.types @@ -25,7 +25,7 @@ interface IFoo { >({ a: 2, b: undefined }) : IFoo >{ a: 2, b: undefined } : IFoo >IFoo : IFoo ->{ a: 2, b: undefined } : { a: number; b: undefined; } +>{ a: 2, b: undefined } : { a: 2; b: undefined; } >a : number >2 : 2 >b : undefined diff --git a/tests/baselines/reference/noImplicitAnyIndexing.types b/tests/baselines/reference/noImplicitAnyIndexing.types index 06aa1a4a2e08d..ea200c1a2807f 100644 --- a/tests/baselines/reference/noImplicitAnyIndexing.types +++ b/tests/baselines/reference/noImplicitAnyIndexing.types @@ -87,7 +87,7 @@ interface MyMap { var m: MyMap = { >m : MyMap >MyMap : MyMap ->{ "0": 0, "1": 1, "2": 2, "Okay that's enough for today.": NaN} : { "0": number; "1": number; "2": number; "Okay that's enough for today.": number; } +>{ "0": 0, "1": 1, "2": 2, "Okay that's enough for today.": NaN} : { "0": 0; "1": 1; "2": 2; "Okay that's enough for today.": number; } "0": 0, >0 : 0 diff --git a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types index 18c10871cf039..28d38778cf0e9 100644 --- a/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types +++ b/tests/baselines/reference/noImplicitAnyIndexingSuppressed.types @@ -86,7 +86,7 @@ interface MyMap { var m: MyMap = { >m : MyMap >MyMap : MyMap ->{ "0": 0, "1": 1, "2": 2, "Okay that's enough for today.": NaN} : { "0": number; "1": number; "2": number; "Okay that's enough for today.": number; } +>{ "0": 0, "1": 1, "2": 2, "Okay that's enough for today.": NaN} : { "0": 0; "1": 1; "2": 2; "Okay that's enough for today.": number; } "0": 0, >0 : 0 diff --git a/tests/baselines/reference/nonInstantiatedModule.types b/tests/baselines/reference/nonInstantiatedModule.types index 97231a5e2c60c..b3e2f6b061ed5 100644 --- a/tests/baselines/reference/nonInstantiatedModule.types +++ b/tests/baselines/reference/nonInstantiatedModule.types @@ -50,7 +50,7 @@ module M2 { >Point : Point return { x: 0, y: 0 }; ->{ x: 0, y: 0 } : { x: number; y: number; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number diff --git a/tests/baselines/reference/null.types b/tests/baselines/reference/null.types index 0e8bf9e799bc0..26a7f21188676 100644 --- a/tests/baselines/reference/null.types +++ b/tests/baselines/reference/null.types @@ -49,7 +49,7 @@ interface I { var w:I={x:null,y:3}; >w : I >I : I ->{x:null,y:3} : { x: null; y: number; } +>{x:null,y:3} : { x: null; y: 3; } >x : null >null : null >y : number diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt index f532bd237559d..d6509f6ce4b9d 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(50,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(68,5): error TS2412: Property '2.0' of type 'number' is not assignable to numeric index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(79,5): error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; }' is not assignable to type '{ [x: number]: string; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(79,5): error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: ""; 2.0: number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; }' is not assignable to type '{ [x: number]: string; }'. Object literal may only specify known properties, and 'a' does not exist in type '{ [x: number]: string; }'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(88,9): error TS2304: Cannot find name 'Myn'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -107,7 +107,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo var b: { [x: number]: string; } = { a: '', ~~~~~ -!!! error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; }' is not assignable to type '{ [x: number]: string; }'. +!!! error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: ""; 2.0: number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; }' is not assignable to type '{ [x: number]: string; }'. !!! error TS2322: Object literal may only specify known properties, and 'a' does not exist in type '{ [x: number]: string; }'. b: 1, c: () => { }, diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.types b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.types index 06d6dfdf8c7d9..e3292a46c1124 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.types +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations.types @@ -139,7 +139,7 @@ var a: { var b: { [x: number]: string; } = { >b : { [x: number]: string; } >x : number ->{ a: '', b: 1, c: () => { }, "d": '', "e": 1, 1.0: '', 2.0: 1, "3.0": '', "4.0": 1, f: null, get X() { return ''; }, set X(v) { }, foo() { return ''; }} : { a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; } +>{ a: '', b: 1, c: () => { }, "d": '', "e": 1, 1.0: '', 2.0: 1, "3.0": '', "4.0": 1, f: null, get X() { return ''; }, set X(v) { }, foo() { return ''; }} : { a: string; b: number; c: () => void; "d": string; "e": number; 1.0: ""; 2.0: number; "3.0": string; "4.0": number; f: any; X: string; foo(): string; } a: '', >a : string diff --git a/tests/baselines/reference/numericIndexingResults.types b/tests/baselines/reference/numericIndexingResults.types index 8d25a44eab0db..a7a1be684b33e 100644 --- a/tests/baselines/reference/numericIndexingResults.types +++ b/tests/baselines/reference/numericIndexingResults.types @@ -151,7 +151,7 @@ var r6 = a[3]; var b: { [x: number]: string } = { 1: '', "2": '' } >b : { [x: number]: string; } >x : number ->{ 1: '', "2": '' } : { 1: string; "2": string; } +>{ 1: '', "2": '' } : { 1: ""; "2": ""; } >'' : "" >'' : "" @@ -194,7 +194,7 @@ var r6 = b[3]; var b2: { [x: number]: string; 1: string; "2": string; } = { 1: '', "2": '' } >b2 : { [x: number]: string; 1: string; "2": string; } >x : number ->{ 1: '', "2": '' } : { 1: string; "2": string; } +>{ 1: '', "2": '' } : { 1: ""; "2": ""; } >'' : "" >'' : "" diff --git a/tests/baselines/reference/objectFreeze.types b/tests/baselines/reference/objectFreeze.types index b673d513e8561..551ac41594a20 100644 --- a/tests/baselines/reference/objectFreeze.types +++ b/tests/baselines/reference/objectFreeze.types @@ -42,7 +42,7 @@ const a = Object.freeze([1, 2, 3]); >Object.freeze : { (a: T[]): ReadonlyArray; (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor >freeze : { (a: T[]): ReadonlyArray; (f: T): T; (o: T): Readonly; } ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 @@ -65,7 +65,7 @@ const o = Object.freeze({ a: 1, b: "string" }); >Object.freeze : { (a: T[]): ReadonlyArray; (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor >freeze : { (a: T[]): ReadonlyArray; (f: T): T; (o: T): Readonly; } ->{ a: 1, b: "string" } : { a: number; b: string; } +>{ a: 1, b: "string" } : { a: 1; b: "string"; } >a : number >1 : 1 >b : string diff --git a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt index 0d064af393527..8f3857549a6ef 100644 --- a/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt +++ b/tests/baselines/reference/objectLitTargetTypeCallSite.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/objectLitTargetTypeCallSite.ts(5,9): error TS2345: Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. +tests/cases/compiler/objectLitTargetTypeCallSite.ts(5,9): error TS2345: Argument of type '{ a: boolean; b: "y"; }' is not assignable to parameter of type '{ a: number; b: string; }'. Types of property 'a' are incompatible. Type 'boolean' is not assignable to type 'number'. @@ -10,6 +10,6 @@ tests/cases/compiler/objectLitTargetTypeCallSite.ts(5,9): error TS2345: Argument process({a:true,b:"y"}); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ a: boolean; b: string; }' is not assignable to parameter of type '{ a: number; b: string; }'. +!!! error TS2345: Argument of type '{ a: boolean; b: "y"; }' is not assignable to parameter of type '{ a: number; b: string; }'. !!! error TS2345: Types of property 'a' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.types b/tests/baselines/reference/objectLiteralArraySpecialization.types index d51b7ffc3cf2e..1f4096910d2d8 100644 --- a/tests/baselines/reference/objectLiteralArraySpecialization.types +++ b/tests/baselines/reference/objectLiteralArraySpecialization.types @@ -28,13 +28,13 @@ var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // sh >thing : MyArrayWrapper<{ name: string; id: number; }> >create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]) : MyArrayWrapper<{ name: string; id: number; }> >create : (initialValues?: T[]) => MyArrayWrapper ->[ { name: "bob", id: 24 }, { name: "doug", id: 32 } ] : { name: string; id: number; }[] ->{ name: "bob", id: 24 } : { name: string; id: number; } +>[ { name: "bob", id: 24 }, { name: "doug", id: 32 } ] : ({ name: "bob"; id: 24; } | { name: "doug"; id: 32; })[] +>{ name: "bob", id: 24 } : { name: "bob"; id: 24; } >name : string >"bob" : "bob" >id : number >24 : 24 ->{ name: "doug", id: 32 } : { name: string; id: number; } +>{ name: "doug", id: 32 } : { name: "doug"; id: 32; } >name : string >"doug" : "doug" >id : number diff --git a/tests/baselines/reference/objectLiteralContextualTyping.types b/tests/baselines/reference/objectLiteralContextualTyping.types index a0c6ff7417b07..7162685b17ac3 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.types +++ b/tests/baselines/reference/objectLiteralContextualTyping.types @@ -27,7 +27,7 @@ var x = foo({ name: "Sprocket" }); >x : string >foo({ name: "Sprocket" }) : string >foo : { (item: Item): string; (item: any): number; } ->{ name: "Sprocket" } : { name: string; } +>{ name: "Sprocket" } : { name: "Sprocket"; } >name : string >"Sprocket" : "Sprocket" @@ -38,7 +38,7 @@ var y = foo({ name: "Sprocket", description: "Bumpy wheel" }); >y : string >foo({ name: "Sprocket", description: "Bumpy wheel" }) : string >foo : { (item: Item): string; (item: any): number; } ->{ name: "Sprocket", description: "Bumpy wheel" } : { name: string; description: string; } +>{ name: "Sprocket", description: "Bumpy wheel" } : { name: "Sprocket"; description: "Bumpy wheel"; } >name : string >"Sprocket" : "Sprocket" >description : string diff --git a/tests/baselines/reference/objectLiteralEnumPropertyNames.types b/tests/baselines/reference/objectLiteralEnumPropertyNames.types index 460d96bc56dcf..35c3ab0e8cf9c 100644 --- a/tests/baselines/reference/objectLiteralEnumPropertyNames.types +++ b/tests/baselines/reference/objectLiteralEnumPropertyNames.types @@ -19,7 +19,7 @@ type TestStrs = { [key in Strs]: string } const x: TestStrs = { >x : TestStrs >TestStrs : TestStrs ->{ [Strs.A]: 'xo', [Strs.B]: 'xe'} : { [Strs.A]: string; [Strs.B]: string; } +>{ [Strs.A]: 'xo', [Strs.B]: 'xe'} : { [Strs.A]: "xo"; [Strs.B]: "xe"; } [Strs.A]: 'xo', >Strs.A : Strs.A @@ -52,7 +52,7 @@ const ux = { const y: TestStrs = { >y : TestStrs >TestStrs : TestStrs ->{ ['a']: 'yo', ['b']: 'ye'} : { ['a']: string; ['b']: string; } +>{ ['a']: 'yo', ['b']: 'ye'} : { ['a']: "yo"; ['b']: "ye"; } ['a']: 'yo', >'a' : "a" @@ -73,7 +73,7 @@ const b = 'b'; const z: TestStrs = { >z : TestStrs >TestStrs : TestStrs ->{ [a]: 'zo', [b]: 'ze'} : { [a]: string; [b]: string; } +>{ [a]: 'zo', [b]: 'ze'} : { [a]: "zo"; [b]: "ze"; } [a]: 'zo', >a : "a" @@ -111,7 +111,7 @@ type TestNums = { 0: number, 1: number } const n: TestNums = { >n : TestNums >TestNums : TestNums ->{ [Nums.A]: 1, [Nums.B]: 2} : { [Nums.A]: number; [Nums.B]: number; } +>{ [Nums.A]: 1, [Nums.B]: 2} : { [Nums.A]: 1; [Nums.B]: 2; } [Nums.A]: 1, >Nums.A : Nums.A @@ -152,7 +152,7 @@ const bn = 1; const m: TestNums = { >m : TestNums >TestNums : TestNums ->{ [an]: 5, [bn]: 6} : { [an]: number; [bn]: number; } +>{ [an]: 5, [bn]: 6} : { [an]: 5; [bn]: 6; } [an]: 5, >an : 0 diff --git a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt index 0c5909dc4ed45..a7c07fd61bce0 100644 --- a/tests/baselines/reference/objectLiteralExcessProperties.errors.txt +++ b/tests/baselines/reference/objectLiteralExcessProperties.errors.txt @@ -2,18 +2,18 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(9,18): error TS2322: Type Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'? tests/cases/compiler/objectLiteralExcessProperties.ts(11,27): error TS2322: Type '{ foreward: string; }' is not assignable to type 'string | Book'. Object literal may only specify known properties, and 'foreward' does not exist in type 'string | Book'. -tests/cases/compiler/objectLiteralExcessProperties.ts(13,53): error TS2322: Type '({ foreword: string; } | { forwards: string; })[]' is not assignable to type 'Book | Book[]'. - Type '({ foreword: string; } | { forwards: string; })[]' is not assignable to type 'Book[]'. - Type '{ foreword: string; } | { forwards: string; }' is not assignable to type 'Book'. +tests/cases/compiler/objectLiteralExcessProperties.ts(13,53): error TS2322: Type '({ foreword: "hello"; } | { forwards: string; })[]' is not assignable to type 'Book | Book[]'. + Type '({ foreword: "hello"; } | { forwards: string; })[]' is not assignable to type 'Book[]'. + Type '{ foreword: "hello"; } | { forwards: string; }' is not assignable to type 'Book'. Type '{ forwards: string; }' is not assignable to type 'Book'. Object literal may only specify known properties, and 'forwards' does not exist in type 'Book'. -tests/cases/compiler/objectLiteralExcessProperties.ts(15,42): error TS2322: Type '{ foreword: string; colour: string; }' is not assignable to type 'Book & Cover'. +tests/cases/compiler/objectLiteralExcessProperties.ts(15,42): error TS2322: Type '{ foreword: "hi"; colour: string; }' is not assignable to type 'Book & Cover'. Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'? -tests/cases/compiler/objectLiteralExcessProperties.ts(17,26): error TS2322: Type '{ foreward: string; color: string; }' is not assignable to type 'Book & Cover'. +tests/cases/compiler/objectLiteralExcessProperties.ts(17,26): error TS2322: Type '{ foreward: string; color: "blue"; }' is not assignable to type 'Book & Cover'. Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'? -tests/cases/compiler/objectLiteralExcessProperties.ts(19,57): error TS2322: Type '{ foreword: string; color: string; price: number; }' is not assignable to type 'Book & Cover'. +tests/cases/compiler/objectLiteralExcessProperties.ts(19,57): error TS2322: Type '{ foreword: "hi"; color: "blue"; price: number; }' is not assignable to type 'Book & Cover'. Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'. -tests/cases/compiler/objectLiteralExcessProperties.ts(21,43): error TS2322: Type '{ foreword: string; price: number; }' is not assignable to type 'Book & number'. +tests/cases/compiler/objectLiteralExcessProperties.ts(21,43): error TS2322: Type '{ foreword: "hi"; price: number; }' is not assignable to type 'Book & number'. Object literal may only specify known properties, and 'price' does not exist in type 'Book & number'. tests/cases/compiler/objectLiteralExcessProperties.ts(23,29): error TS2322: Type '{ couleur: string; }' is not assignable to type 'Cover | Cover[]'. Object literal may only specify known properties, and 'couleur' does not exist in type 'Cover | Cover[]'. @@ -46,30 +46,30 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type var b3: Book | (Book[]) = [{ foreword: "hello" }, { forwards: "back" }]; ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '({ foreword: string; } | { forwards: string; })[]' is not assignable to type 'Book | Book[]'. -!!! error TS2322: Type '({ foreword: string; } | { forwards: string; })[]' is not assignable to type 'Book[]'. -!!! error TS2322: Type '{ foreword: string; } | { forwards: string; }' is not assignable to type 'Book'. +!!! error TS2322: Type '({ foreword: "hello"; } | { forwards: string; })[]' is not assignable to type 'Book | Book[]'. +!!! error TS2322: Type '({ foreword: "hello"; } | { forwards: string; })[]' is not assignable to type 'Book[]'. +!!! error TS2322: Type '{ foreword: "hello"; } | { forwards: string; }' is not assignable to type 'Book'. !!! error TS2322: Type '{ forwards: string; }' is not assignable to type 'Book'. !!! error TS2322: Object literal may only specify known properties, and 'forwards' does not exist in type 'Book'. var b4: Book & Cover = { foreword: "hi", colour: "blue" }; ~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ foreword: string; colour: string; }' is not assignable to type 'Book & Cover'. +!!! error TS2322: Type '{ foreword: "hi"; colour: string; }' is not assignable to type 'Book & Cover'. !!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'? var b5: Book & Cover = { foreward: "hi", color: "blue" }; ~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ foreward: string; color: string; }' is not assignable to type 'Book & Cover'. +!!! error TS2322: Type '{ foreward: string; color: "blue"; }' is not assignable to type 'Book & Cover'. !!! error TS2322: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'? var b6: Book & Cover = { foreword: "hi", color: "blue", price: 10.99 }; ~~~~~~~~~~~~ -!!! error TS2322: Type '{ foreword: string; color: string; price: number; }' is not assignable to type 'Book & Cover'. +!!! error TS2322: Type '{ foreword: "hi"; color: "blue"; price: number; }' is not assignable to type 'Book & Cover'. !!! error TS2322: Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'. var b7: Book & number = { foreword: "hi", price: 10.99 }; ~~~~~~~~~~~~ -!!! error TS2322: Type '{ foreword: string; price: number; }' is not assignable to type 'Book & number'. +!!! error TS2322: Type '{ foreword: "hi"; price: number; }' is not assignable to type 'Book & number'. !!! error TS2322: Object literal may only specify known properties, and 'price' does not exist in type 'Book & number'. var b8: Cover | Cover[] = { couleur : "non" }; diff --git a/tests/baselines/reference/objectLiteralExcessProperties.types b/tests/baselines/reference/objectLiteralExcessProperties.types index e5150394a40de..58a1d15d7a844 100644 --- a/tests/baselines/reference/objectLiteralExcessProperties.types +++ b/tests/baselines/reference/objectLiteralExcessProperties.types @@ -31,8 +31,8 @@ var b3: Book | (Book[]) = [{ foreword: "hello" }, { forwards: "back" }]; >b3 : Book | Book[] >Book : Book >Book : Book ->[{ foreword: "hello" }, { forwards: "back" }] : ({ foreword: string; } | { forwards: string; })[] ->{ foreword: "hello" } : { foreword: string; } +>[{ foreword: "hello" }, { forwards: "back" }] : ({ foreword: "hello"; } | { forwards: string; })[] +>{ foreword: "hello" } : { foreword: "hello"; } >foreword : string >"hello" : "hello" >{ forwards: "back" } : { forwards: string; } @@ -43,7 +43,7 @@ var b4: Book & Cover = { foreword: "hi", colour: "blue" }; >b4 : Book & Cover >Book : Book >Cover : Cover ->{ foreword: "hi", colour: "blue" } : { foreword: string; colour: string; } +>{ foreword: "hi", colour: "blue" } : { foreword: "hi"; colour: string; } >foreword : string >"hi" : "hi" >colour : string @@ -53,7 +53,7 @@ var b5: Book & Cover = { foreward: "hi", color: "blue" }; >b5 : Book & Cover >Book : Book >Cover : Cover ->{ foreward: "hi", color: "blue" } : { foreward: string; color: string; } +>{ foreward: "hi", color: "blue" } : { foreward: string; color: "blue"; } >foreward : string >"hi" : "hi" >color : string @@ -63,7 +63,7 @@ var b6: Book & Cover = { foreword: "hi", color: "blue", price: 10.99 }; >b6 : Book & Cover >Book : Book >Cover : Cover ->{ foreword: "hi", color: "blue", price: 10.99 } : { foreword: string; color: string; price: number; } +>{ foreword: "hi", color: "blue", price: 10.99 } : { foreword: "hi"; color: "blue"; price: number; } >foreword : string >"hi" : "hi" >color : string @@ -74,7 +74,7 @@ var b6: Book & Cover = { foreword: "hi", color: "blue", price: 10.99 }; var b7: Book & number = { foreword: "hi", price: 10.99 }; >b7 : Book & number >Book : Book ->{ foreword: "hi", price: 10.99 } : { foreword: string; price: number; } +>{ foreword: "hi", price: 10.99 } : { foreword: "hi"; price: number; } >foreword : string >"hi" : "hi" >price : number diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt index fb2cbdaf649e6..216563784f77e 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts(8,6): error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I'. Object literal may only specify known properties, and 'hello' does not exist in type 'I'. -tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts(10,17): error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts(10,17): error TS2345: Argument of type '{ value: ""; what: number; }' is not assignable to parameter of type 'I'. Object literal may only specify known properties, and 'what' does not exist in type 'I'. tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts(11,4): error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I'. Property 'value' is missing in type '{ toString: (s: string) => string; }'. @@ -24,7 +24,7 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping.ts(13,36): error T f2({ value: '' }) // missing toString satisfied by Object's member f2({ value: '', what: 1 }) // missing toString satisfied by Object's member ~~~~~~~ -!!! error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I'. +!!! error TS2345: Argument of type '{ value: ""; what: number; }' is not assignable to parameter of type 'I'. !!! error TS2345: Object literal may only specify known properties, and 'what' does not exist in type 'I'. f2({ toString: (s) => s }) // error, missing property value from ArgsString ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.types b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.types index 9d51fe9fe1195..b5fce0d7531ad 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.types +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping.types @@ -25,7 +25,7 @@ f2({ hello: 1 }) // error f2({ value: '' }) // missing toString satisfied by Object's member >f2({ value: '' }) : void >f2 : (args: I) => void ->{ value: '' } : { value: string; } +>{ value: '' } : { value: ""; } >value : string >'' : "" @@ -59,7 +59,7 @@ f2({ toString: (s: string) => s }) // error, missing property value from ArgsStr f2({ value: '', toString: (s) => s.uhhh }) // error >f2({ value: '', toString: (s) => s.uhhh }) : void >f2 : (args: I) => void ->{ value: '', toString: (s) => s.uhhh } : { value: string; toString: (s: string) => any; } +>{ value: '', toString: (s) => s.uhhh } : { value: ""; toString: (s: string) => any; } >value : string >'' : "" >toString : (s: string) => any diff --git a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt index 0117d2c0c8c23..610193d65a77f 100644 --- a/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt +++ b/tests/baselines/reference/objectLiteralFunctionArgContextualTyping2.errors.txt @@ -1,14 +1,14 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(8,6): error TS2345: Argument of type '{ hello: number; }' is not assignable to parameter of type 'I2'. Object literal may only specify known properties, and 'hello' does not exist in type 'I2'. -tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(9,4): error TS2345: Argument of type '{ value: string; }' is not assignable to parameter of type 'I2'. - Property 'doStuff' is missing in type '{ value: string; }'. -tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(10,17): error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(9,4): error TS2345: Argument of type '{ value: ""; }' is not assignable to parameter of type 'I2'. + Property 'doStuff' is missing in type '{ value: ""; }'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(10,17): error TS2345: Argument of type '{ value: ""; what: number; }' is not assignable to parameter of type 'I2'. Object literal may only specify known properties, and 'what' does not exist in type 'I2'. tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(11,6): error TS2345: Argument of type '{ toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. Object literal may only specify known properties, and 'toString' does not exist in type 'I2'. tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(12,6): error TS2345: Argument of type '{ toString: (s: string) => string; }' is not assignable to parameter of type 'I2'. Object literal may only specify known properties, and 'toString' does not exist in type 'I2'. -tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error TS2345: Argument of type '{ value: string; toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. +tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error TS2345: Argument of type '{ value: ""; toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. Object literal may only specify known properties, and 'toString' does not exist in type 'I2'. @@ -26,11 +26,11 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error !!! error TS2345: Object literal may only specify known properties, and 'hello' does not exist in type 'I2'. f2({ value: '' }) ~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ value: string; }' is not assignable to parameter of type 'I2'. -!!! error TS2345: Property 'doStuff' is missing in type '{ value: string; }'. +!!! error TS2345: Argument of type '{ value: ""; }' is not assignable to parameter of type 'I2'. +!!! error TS2345: Property 'doStuff' is missing in type '{ value: ""; }'. f2({ value: '', what: 1 }) ~~~~~~~ -!!! error TS2345: Argument of type '{ value: string; what: number; }' is not assignable to parameter of type 'I2'. +!!! error TS2345: Argument of type '{ value: ""; what: number; }' is not assignable to parameter of type 'I2'. !!! error TS2345: Object literal may only specify known properties, and 'what' does not exist in type 'I2'. f2({ toString: (s) => s }) ~~~~~~~~~~~~~~~~~~ @@ -42,5 +42,5 @@ tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts(13,17): error !!! error TS2345: Object literal may only specify known properties, and 'toString' does not exist in type 'I2'. f2({ value: '', toString: (s) => s.uhhh }) ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ value: string; toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. +!!! error TS2345: Argument of type '{ value: ""; toString: (s: any) => any; }' is not assignable to parameter of type 'I2'. !!! error TS2345: Object literal may only specify known properties, and 'toString' does not exist in type 'I2'. \ No newline at end of file diff --git a/tests/baselines/reference/objectLiteralNormalization.errors.txt b/tests/baselines/reference/objectLiteralNormalization.errors.txt index 6bdc9b955e324..38be8a0115ad2 100644 --- a/tests/baselines/reference/objectLiteralNormalization.errors.txt +++ b/tests/baselines/reference/objectLiteralNormalization.errors.txt @@ -1,20 +1,20 @@ -tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(7,1): error TS2322: Type '{ a: number; b: number; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. - Type '{ a: number; b: number; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. - Property 'c' is missing in type '{ a: number; b: number; }'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(8,1): error TS2322: Type '{ b: string; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. - Type '{ b: string; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. - Property 'a' is missing in type '{ b: string; }'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(7,1): error TS2322: Type '{ a: 0; b: number; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. + Type '{ a: 0; b: number; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. + Property 'c' is missing in type '{ a: 0; b: number; }'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(8,1): error TS2322: Type '{ b: "y"; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. + Type '{ b: "y"; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. + Property 'a' is missing in type '{ b: "y"; }'. tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(9,1): error TS2322: Type '{ c: true; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. Type '{ c: true; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. Property 'a' is missing in type '{ c: true; }'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(17,1): error TS2322: Type '{ a: string; b: number; }' is not assignable to type '{ a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; }'. - Type '{ a: string; b: number; }' is not assignable to type '{ a?: undefined; b?: undefined; }'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(17,1): error TS2322: Type '{ a: "def"; b: 20; }' is not assignable to type '{ a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; }'. + Type '{ a: "def"; b: 20; }' is not assignable to type '{ a?: undefined; b?: undefined; }'. Types of property 'a' are incompatible. - Type 'string' is not assignable to type 'undefined'. -tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(18,1): error TS2322: Type '{ a: number; }' is not assignable to type '{ a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; }'. - Type '{ a: number; }' is not assignable to type '{ a?: undefined; b?: undefined; }'. + Type '"def"' is not assignable to type 'undefined'. +tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts(18,1): error TS2322: Type '{ a: 1; }' is not assignable to type '{ a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; }'. + Type '{ a: 1; }' is not assignable to type '{ a?: undefined; b?: undefined; }'. Types of property 'a' are incompatible. - Type 'number' is not assignable to type 'undefined'. + Type '1' is not assignable to type 'undefined'. ==== tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts (5 errors) ==== @@ -26,14 +26,14 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts a1 = { a: 1 }; a1 = { a: 0, b: 0 }; // Error ~~ -!!! error TS2322: Type '{ a: number; b: number; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. -!!! error TS2322: Type '{ a: number; b: number; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. -!!! error TS2322: Property 'c' is missing in type '{ a: number; b: number; }'. +!!! error TS2322: Type '{ a: 0; b: number; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. +!!! error TS2322: Type '{ a: 0; b: number; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. +!!! error TS2322: Property 'c' is missing in type '{ a: 0; b: number; }'. a1 = { b: "y" }; // Error ~~ -!!! error TS2322: Type '{ b: string; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. -!!! error TS2322: Type '{ b: string; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. -!!! error TS2322: Property 'a' is missing in type '{ b: string; }'. +!!! error TS2322: Type '{ b: "y"; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. +!!! error TS2322: Type '{ b: "y"; }' is not assignable to type '{ a: number; b: string; c: boolean; }'. +!!! error TS2322: Property 'a' is missing in type '{ b: "y"; }'. a1 = { c: true }; // Error ~~ !!! error TS2322: Type '{ c: true; }' is not assignable to type '{ a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; }'. @@ -48,16 +48,16 @@ tests/cases/conformance/expressions/objectLiterals/objectLiteralNormalization.ts a2 = {}; a2 = { a: "def", b: 20 }; // Error ~~ -!!! error TS2322: Type '{ a: string; b: number; }' is not assignable to type '{ a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; }'. -!!! error TS2322: Type '{ a: string; b: number; }' is not assignable to type '{ a?: undefined; b?: undefined; }'. +!!! error TS2322: Type '{ a: "def"; b: 20; }' is not assignable to type '{ a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; }'. +!!! error TS2322: Type '{ a: "def"; b: 20; }' is not assignable to type '{ a?: undefined; b?: undefined; }'. !!! error TS2322: Types of property 'a' are incompatible. -!!! error TS2322: Type 'string' is not assignable to type 'undefined'. +!!! error TS2322: Type '"def"' is not assignable to type 'undefined'. a2 = { a: 1 }; // Error ~~ -!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; }'. -!!! error TS2322: Type '{ a: number; }' is not assignable to type '{ a?: undefined; b?: undefined; }'. +!!! error TS2322: Type '{ a: 1; }' is not assignable to type '{ a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; }'. +!!! error TS2322: Type '{ a: 1; }' is not assignable to type '{ a?: undefined; b?: undefined; }'. !!! error TS2322: Types of property 'a' are incompatible. -!!! error TS2322: Type 'number' is not assignable to type 'undefined'. +!!! error TS2322: Type '1' is not assignable to type 'undefined'. // Object literals containing spreads are not normalized declare let b1: { a: string, b: string } | { b: string, c: string }; diff --git a/tests/baselines/reference/objectLiteralNormalization.types b/tests/baselines/reference/objectLiteralNormalization.types index 8fa49c9d9acbe..2a3a8316bc9fd 100644 --- a/tests/baselines/reference/objectLiteralNormalization.types +++ b/tests/baselines/reference/objectLiteralNormalization.types @@ -37,25 +37,25 @@ a1.c; // boolean | undefined >c : boolean | undefined a1 = { a: 1 }; ->a1 = { a: 1 } : { a: number; } +>a1 = { a: 1 } : { a: 1; } >a1 : { a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; } ->{ a: 1 } : { a: number; } +>{ a: 1 } : { a: 1; } >a : number >1 : 1 a1 = { a: 0, b: 0 }; // Error ->a1 = { a: 0, b: 0 } : { a: number; b: number; } +>a1 = { a: 0, b: 0 } : { a: 0; b: number; } >a1 : { a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; } ->{ a: 0, b: 0 } : { a: number; b: number; } +>{ a: 0, b: 0 } : { a: 0; b: number; } >a : number >0 : 0 >b : number >0 : 0 a1 = { b: "y" }; // Error ->a1 = { b: "y" } : { b: string; } +>a1 = { b: "y" } : { b: "y"; } >a1 : { a: number; b?: undefined; c?: undefined; } | { a: number; b: string; c?: undefined; } | { a: number; b: string; c: boolean; } ->{ b: "y" } : { b: string; } +>{ b: "y" } : { b: "y"; } >b : string >"y" : "y" @@ -92,18 +92,18 @@ a2.b; // number | undefined >b : number | undefined a2 = { a: 10, b: 20 }; ->a2 = { a: 10, b: 20 } : { a: number; b: number; } +>a2 = { a: 10, b: 20 } : { a: 10; b: 20; } >a2 : { a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; } ->{ a: 10, b: 20 } : { a: number; b: number; } +>{ a: 10, b: 20 } : { a: 10; b: 20; } >a : number >10 : 10 >b : number >20 : 20 a2 = { a: "def" }; ->a2 = { a: "def" } : { a: string; } +>a2 = { a: "def" } : { a: "def"; } >a2 : { a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; } ->{ a: "def" } : { a: string; } +>{ a: "def" } : { a: "def"; } >a : string >"def" : "def" @@ -113,18 +113,18 @@ a2 = {}; >{} : {} a2 = { a: "def", b: 20 }; // Error ->a2 = { a: "def", b: 20 } : { a: string; b: number; } +>a2 = { a: "def", b: 20 } : { a: "def"; b: 20; } >a2 : { a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; } ->{ a: "def", b: 20 } : { a: string; b: number; } +>{ a: "def", b: 20 } : { a: "def"; b: 20; } >a : string >"def" : "def" >b : number >20 : 20 a2 = { a: 1 }; // Error ->a2 = { a: 1 } : { a: number; } +>a2 = { a: 1 } : { a: 1; } >a2 : { a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; } ->{ a: 1 } : { a: number; } +>{ a: 1 } : { a: 1; } >a : number >1 : 1 @@ -282,12 +282,12 @@ let e1 = f({ a: 1, b: 2 }, { a: "abc" }, {}); >e1 : { a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; } >f({ a: 1, b: 2 }, { a: "abc" }, {}) : { a: number; b: number; } | { a: string; b?: undefined; } | { a?: undefined; b?: undefined; } >f : (...items: T[]) => T ->{ a: 1, b: 2 } : { a: number; b: number; } +>{ a: 1, b: 2 } : { a: 1; b: 2; } >a : number >1 : 1 >b : number >2 : 2 ->{ a: "abc" } : { a: string; } +>{ a: "abc" } : { a: "abc"; } >a : string >"abc" : "abc" >{} : {} @@ -297,10 +297,10 @@ let e2 = f({}, { a: "abc" }, { a: 1, b: 2 }); >f({}, { a: "abc" }, { a: 1, b: 2 }) : { a?: undefined; b?: undefined; } | { a: string; b?: undefined; } | { a: number; b: number; } >f : (...items: T[]) => T >{} : {} ->{ a: "abc" } : { a: string; } +>{ a: "abc" } : { a: "abc"; } >a : string >"abc" : "abc" ->{ a: 1, b: 2 } : { a: number; b: number; } +>{ a: 1, b: 2 } : { a: 1; b: 2; } >a : number >1 : 1 >b : number @@ -311,7 +311,7 @@ let e3 = f(data, { a: 2 }); >f(data, { a: 2 }) : { a: number; } >f : (...items: T[]) => T >data : { a: 1; b: "abc"; c: true; } ->{ a: 2 } : { a: number; } +>{ a: 2 } : { a: 2; } >a : number >2 : 2 @@ -319,7 +319,7 @@ let e4 = f({ a: 2 }, data); >e4 : { a: number; } >f({ a: 2 }, data) : { a: number; } >f : (...items: T[]) => T ->{ a: 2 } : { a: number; } +>{ a: 2 } : { a: 2; } >a : number >2 : 2 >data : { a: 1; b: "abc"; c: true; } diff --git a/tests/baselines/reference/objectLiteralParameterResolution.types b/tests/baselines/reference/objectLiteralParameterResolution.types index 01eb7dac9bd52..305f17fca6be7 100644 --- a/tests/baselines/reference/objectLiteralParameterResolution.types +++ b/tests/baselines/reference/objectLiteralParameterResolution.types @@ -29,7 +29,7 @@ var s = $.extend({ >$.extend : { (target: T, ...objs: any[]): T; (deep: boolean, target: T, ...objs: any[]): T; } >$ : Foo >extend : { (target: T, ...objs: any[]): T; (deep: boolean, target: T, ...objs: any[]): T; } ->{ type: "GET" , data: "data" , success: wrapSuccessCallback(requestContext, callback) , error: wrapErrorCallback(requestContext, errorCallback) , dataType: "json" , converters: { "text json": "" }, traditional: true , timeout: 12, } : { type: string; data: string; success: any; error: any; dataType: string; converters: { "text json": string; }; traditional: true; timeout: number; } +>{ type: "GET" , data: "data" , success: wrapSuccessCallback(requestContext, callback) , error: wrapErrorCallback(requestContext, errorCallback) , dataType: "json" , converters: { "text json": "" }, traditional: true , timeout: 12, } : { type: "GET"; data: "data"; success: any; error: any; dataType: "json"; converters: { "text json": ""; }; traditional: true; timeout: 12; } type: "GET" , >type : string @@ -58,8 +58,8 @@ var s = $.extend({ >"json" : "json" converters: { "text json": "" }, ->converters : { "text json": string; } ->{ "text json": "" } : { "text json": string; } +>converters : { "text json": ""; } +>{ "text json": "" } : { "text json": ""; } >"" : "" traditional: true , diff --git a/tests/baselines/reference/objectRest.types b/tests/baselines/reference/objectRest.types index dff8830e818b2..dcb43cd820308 100644 --- a/tests/baselines/reference/objectRest.types +++ b/tests/baselines/reference/objectRest.types @@ -117,12 +117,12 @@ var { x, ...fresh } = { x: 1, y: 2 }; >2 : 2 ({ x, ...fresh } = { x: 1, y: 2 }); ->({ x, ...fresh } = { x: 1, y: 2 }) : { x: number; y: number; } ->{ x, ...fresh } = { x: 1, y: 2 } : { x: number; y: number; } +>({ x, ...fresh } = { x: 1, y: 2 }) : { x: 1; y: 2; } +>{ x, ...fresh } = { x: 1, y: 2 } : { x: 1; y: 2; } >{ x, ...fresh } : { y: number; x: number; } >x : number >fresh : { y: number; } ->{ x: 1, y: 2 } : { x: number; y: number; } +>{ x: 1, y: 2 } : { x: 1; y: 2; } >x : number >1 : 1 >y : number diff --git a/tests/baselines/reference/objectRestForOf.types b/tests/baselines/reference/objectRestForOf.types index 43d42a045e182..94453a8f5ab04 100644 --- a/tests/baselines/reference/objectRestForOf.types +++ b/tests/baselines/reference/objectRestForOf.types @@ -41,8 +41,8 @@ for (const norest of array.map(a => ({ ...a, x: 'a string' }))) { >map : (callbackfn: (value: { x: number; y: string; }, index: number, array: { x: number; y: string; }[]) => U, thisArg?: any) => U[] >a => ({ ...a, x: 'a string' }) : (a: { x: number; y: string; }) => { x: string; y: string; } >a : { x: number; y: string; } ->({ ...a, x: 'a string' }) : { x: string; y: string; } ->{ ...a, x: 'a string' } : { x: string; y: string; } +>({ ...a, x: 'a string' }) : { x: "a string"; y: string; } +>{ ...a, x: 'a string' } : { x: "a string"; y: string; } >a : { x: number; y: string; } >x : string >'a string' : "a string" diff --git a/tests/baselines/reference/objectRestParameter.types b/tests/baselines/reference/objectRestParameter.types index 831ac9df59f9a..6e8e95d4e40e4 100644 --- a/tests/baselines/reference/objectRestParameter.types +++ b/tests/baselines/reference/objectRestParameter.types @@ -36,7 +36,7 @@ suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' >12 : 12 >nested : { ka: any; } >rest : { y: string; } ->{ x: { z: 1, ka: 1 }, y: 'noo' } : { x: { z: number; ka: number; }; y: string; } +>{ x: { z: 1, ka: 1 }, y: 'noo' } : { x: { z: number; ka: number; }; y: "noo"; } >x : { z: number; ka: number; } >{ z: 1, ka: 1 } : { z: number; ka: number; } >z : number diff --git a/tests/baselines/reference/objectRestParameterES5.types b/tests/baselines/reference/objectRestParameterES5.types index 1b8dd29e29ef6..c9a2fb5ca4736 100644 --- a/tests/baselines/reference/objectRestParameterES5.types +++ b/tests/baselines/reference/objectRestParameterES5.types @@ -36,7 +36,7 @@ suddenly(({ x: { z = 12, ...nested }, ...rest } = { x: { z: 1, ka: 1 }, y: 'noo' >12 : 12 >nested : { ka: any; } >rest : { y: string; } ->{ x: { z: 1, ka: 1 }, y: 'noo' } : { x: { z: number; ka: number; }; y: string; } +>{ x: { z: 1, ka: 1 }, y: 'noo' } : { x: { z: number; ka: number; }; y: "noo"; } >x : { z: number; ka: number; } >{ z: 1, ka: 1 } : { z: number; ka: number; } >z : number diff --git a/tests/baselines/reference/objectSpread.types b/tests/baselines/reference/objectSpread.types index 5166ceb54d7cf..29994a3511f3e 100644 --- a/tests/baselines/reference/objectSpread.types +++ b/tests/baselines/reference/objectSpread.types @@ -66,7 +66,7 @@ let override: { a: number, b: string } = >b : string { ...o, b: 'override' } ->{ ...o, b: 'override' } : { b: string; a: number; } +>{ ...o, b: 'override' } : { b: "override"; a: number; } >o : { a: number; b: string; } >b : string >'override' : "override" @@ -78,11 +78,11 @@ let nested: { a: number, b: boolean, c: string } = >c : string { ...{ a: 3, ...{ b: false, c: 'overriden' } }, c: 'whatever' } ->{ ...{ a: 3, ...{ b: false, c: 'overriden' } }, c: 'whatever' } : { c: string; b: false; a: number; } ->{ a: 3, ...{ b: false, c: 'overriden' } } : { b: false; c: string; a: number; } +>{ ...{ a: 3, ...{ b: false, c: 'overriden' } }, c: 'whatever' } : { c: "whatever"; b: false; a: 3; } +>{ a: 3, ...{ b: false, c: 'overriden' } } : { b: false; c: "overriden"; a: 3; } >a : number >3 : 3 ->{ b: false, c: 'overriden' } : { b: false; c: string; } +>{ b: false, c: 'overriden' } : { b: false; c: "overriden"; } >b : boolean >false : false >c : string @@ -134,7 +134,7 @@ let combinedAfter: { a: number, b: string, c: boolean } = >c : boolean { ...o, ...o2, b: 'ok' } ->{ ...o, ...o2, b: 'ok' } : { b: string; c: boolean; a: number; } +>{ ...o, ...o2, b: 'ok' } : { b: "ok"; c: boolean; a: number; } >o : { a: number; b: string; } >o2 : { b: string; c: boolean; } >b : string @@ -148,18 +148,18 @@ let combinedNested: { a: number, b: boolean, c: string, d: string } = >d : string { ...{ a: 4, ...{ b: false, c: 'overriden' } }, d: 'actually new', ...{ a: 5, d: 'maybe new' } } ->{ ...{ a: 4, ...{ b: false, c: 'overriden' } }, d: 'actually new', ...{ a: 5, d: 'maybe new' } } : { a: number; d: string; b: false; c: string; } ->{ a: 4, ...{ b: false, c: 'overriden' } } : { b: false; c: string; a: number; } +>{ ...{ a: 4, ...{ b: false, c: 'overriden' } }, d: 'actually new', ...{ a: 5, d: 'maybe new' } } : { a: 5; d: "maybe new"; b: false; c: "overriden"; } +>{ a: 4, ...{ b: false, c: 'overriden' } } : { b: false; c: "overriden"; a: 4; } >a : number >4 : 4 ->{ b: false, c: 'overriden' } : { b: false; c: string; } +>{ b: false, c: 'overriden' } : { b: false; c: "overriden"; } >b : boolean >false : false >c : string >'overriden' : "overriden" >d : string >'actually new' : "actually new" ->{ a: 5, d: 'maybe new' } : { a: number; d: string; } +>{ a: 5, d: 'maybe new' } : { a: 5; d: "maybe new"; } >a : number >5 : 5 >d : string @@ -172,8 +172,8 @@ let combinedNestedChangeType: { a: number, b: boolean, c: number } = >c : number { ...{ a: 1, ...{ b: false, c: 'overriden' } }, c: -1 } ->{ ...{ a: 1, ...{ b: false, c: 'overriden' } }, c: -1 } : { c: number; b: false; a: number; } ->{ a: 1, ...{ b: false, c: 'overriden' } } : { b: false; c: string; a: number; } +>{ ...{ a: 1, ...{ b: false, c: 'overriden' } }, c: -1 } : { c: -1; b: false; a: 1; } +>{ a: 1, ...{ b: false, c: 'overriden' } } : { b: false; c: string; a: 1; } >a : number >1 : 1 >{ b: false, c: 'overriden' } : { b: false; c: string; } @@ -211,7 +211,7 @@ let getter: { a: number, c: number } = >c : number { ...op, c: 7 } ->{ ...op, c: 7 } : { c: number; a: number; } +>{ ...op, c: 7 } : { c: 7; a: number; } >op : { readonly a: number; } >c : number >7 : 7 @@ -280,17 +280,17 @@ function conditionalSpreadBoolean(b: boolean) : { x: number, y: number } { >13 : 13 o = { ->o = { ...o, ...b && { x: 14 } } : { x: number; y: number; } | { x: number; y: number; } +>o = { ...o, ...b && { x: 14 } } : { x: number; y: number; } | { x: 14; y: number; } >o : { x: number; y: number; } ->{ ...o, ...b && { x: 14 } } : { x: number; y: number; } | { x: number; y: number; } +>{ ...o, ...b && { x: 14 } } : { x: number; y: number; } | { x: 14; y: number; } ...o, >o : { x: number; y: number; } ...b && { x: 14 } ->b && { x: 14 } : false | { x: number; } +>b && { x: 14 } : false | { x: 14; } >b : boolean ->{ x: 14 } : { x: number; } +>{ x: 14 } : { x: 14; } >x : number >14 : 14 } @@ -444,7 +444,7 @@ let changeTypeAfter: { a: string, b: string } = >b : string { ...o, a: 'wrong type?' } ->{ ...o, a: 'wrong type?' } : { a: string; b: string; } +>{ ...o, a: 'wrong type?' } : { a: "wrong type?"; b: string; } >o : { a: number; b: string; } >a : string >'wrong type?' : "wrong type?" @@ -521,7 +521,7 @@ function container( >b : string { ['before everything']: 12, ...o, b: 'yes' } ->{ ['before everything']: 12, ...o, b: 'yes' } : { b: string; a: number; ['before everything']: number; } +>{ ['before everything']: 12, ...o, b: 'yes' } : { b: "yes"; a: number; ['before everything']: 12; } >'before everything' : "before everything" >12 : 12 >o : { a: number; b: string; } @@ -535,7 +535,7 @@ function container( >c : boolean { ...o, ['in the middle']: 13, b: 'maybe?', ...o2 } ->{ ...o, ['in the middle']: 13, b: 'maybe?', ...o2 } : { b: string; c: boolean; ['in the middle']: number; a: number; } +>{ ...o, ['in the middle']: 13, b: 'maybe?', ...o2 } : { b: string; c: boolean; ['in the middle']: 13; a: number; } >o : { a: number; b: string; } >'in the middle' : "in the middle" >13 : 13 @@ -549,7 +549,7 @@ function container( >b : string { ...o, b: 'yeah', ['at the end']: 14 } ->{ ...o, b: 'yeah', ['at the end']: 14 } : { b: string; ['at the end']: number; a: number; } +>{ ...o, b: 'yeah', ['at the end']: 14 } : { b: "yeah"; ['at the end']: 14; a: number; } >o : { a: number; b: string; } >b : string >'yeah' : "yeah" diff --git a/tests/baselines/reference/objectSpreadNegative.errors.txt b/tests/baselines/reference/objectSpreadNegative.errors.txt index 5b78f10f2818f..a6bd50a3a6f76 100644 --- a/tests/baselines/reference/objectSpreadNegative.errors.txt +++ b/tests/baselines/reference/objectSpreadNegative.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(13,21): error TS2339: Property 'x' does not exist on type '{}'. tests/cases/conformance/types/spread/objectSpreadNegative.ts(16,5): error TS2322: Type '{ sn?: string | number; }' is not assignable to type '{ sn: string | number; }'. Property 'sn' is optional in type '{ sn?: string | number; }' but required in type '{ sn: string | number; }'. -tests/cases/conformance/types/spread/objectSpreadNegative.ts(23,1): error TS2322: Type '{ s: string; }' is not assignable to type '{ s: string; b: boolean; }'. - Property 'b' is missing in type '{ s: string; }'. +tests/cases/conformance/types/spread/objectSpreadNegative.ts(23,1): error TS2322: Type '{ s: "foo"; }' is not assignable to type '{ s: string; b: boolean; }'. + Property 'b' is missing in type '{ s: "foo"; }'. tests/cases/conformance/types/spread/objectSpreadNegative.ts(25,1): error TS2322: Type '{ b: boolean; }' is not assignable to type '{ s: string; b: boolean; }'. Property 's' is missing in type '{ b: boolean; }'. tests/cases/conformance/types/spread/objectSpreadNegative.ts(28,36): error TS2300: Duplicate identifier 'b'. @@ -18,7 +18,7 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(53,9): error TS2339 tests/cases/conformance/types/spread/objectSpreadNegative.ts(58,11): error TS2339: Property 'a' does not exist on type 'object'. tests/cases/conformance/types/spread/objectSpreadNegative.ts(62,14): error TS2698: Spread types may only be created from object types. tests/cases/conformance/types/spread/objectSpreadNegative.ts(65,14): error TS2698: Spread types may only be created from object types. -tests/cases/conformance/types/spread/objectSpreadNegative.ts(79,37): error TS2322: Type '{ a: string; b: string; extra: string; }' is not assignable to type 'A'. +tests/cases/conformance/types/spread/objectSpreadNegative.ts(79,37): error TS2322: Type '{ a: "a"; b: "b"; extra: string; }' is not assignable to type 'A'. Object literal may only specify known properties, and 'extra' does not exist in type 'A'. tests/cases/conformance/types/spread/objectSpreadNegative.ts(82,7): error TS2322: Type '{ a: string; b: string; extra: string; }' is not assignable to type 'A'. Object literal may only specify known properties, and 'extra' does not exist in type 'A'. @@ -56,8 +56,8 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(84,7): error TS2322 let spread = { ...{ b: true }, ...{s: "foo" } }; spread = { s: "foo" }; // error, missing 'b' ~~~~~~ -!!! error TS2322: Type '{ s: string; }' is not assignable to type '{ s: string; b: boolean; }'. -!!! error TS2322: Property 'b' is missing in type '{ s: string; }'. +!!! error TS2322: Type '{ s: "foo"; }' is not assignable to type '{ s: string; b: boolean; }'. +!!! error TS2322: Property 'b' is missing in type '{ s: "foo"; }'. let b = { b: false }; spread = b; // error, missing 's' ~~~~~~ @@ -144,7 +144,7 @@ tests/cases/conformance/types/spread/objectSpreadNegative.ts(84,7): error TS2322 type Extra = { a: string, b: string, extra: string }; const extra1: A = { a: "a", b: "b", extra: "extra" }; ~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ a: string; b: string; extra: string; }' is not assignable to type 'A'. +!!! error TS2322: Type '{ a: "a"; b: "b"; extra: string; }' is not assignable to type 'A'. !!! error TS2322: Object literal may only specify known properties, and 'extra' does not exist in type 'A'. const extra2 = { a: "a", b: "b", extra: "extra" }; const a1: A = { ...extra1 }; // error spans should be here diff --git a/tests/baselines/reference/objectSpreadNegative.types b/tests/baselines/reference/objectSpreadNegative.types index 5a495ab6f9df4..77b7cc0896e94 100644 --- a/tests/baselines/reference/objectSpreadNegative.types +++ b/tests/baselines/reference/objectSpreadNegative.types @@ -77,9 +77,9 @@ let spread = { ...{ b: true }, ...{s: "foo" } }; >"foo" : "foo" spread = { s: "foo" }; // error, missing 'b' ->spread = { s: "foo" } : { s: string; } +>spread = { s: "foo" } : { s: "foo"; } >spread : { s: string; b: boolean; } ->{ s: "foo" } : { s: string; } +>{ s: "foo" } : { s: "foo"; } >s : string >"foo" : "foo" @@ -273,12 +273,12 @@ let exclusive: { id: string, a: number, b: string, c: string, d: boolean } = f({ a: 1, b: 'yes' }, { c: 'no', d: false }) >f({ a: 1, b: 'yes' }, { c: 'no', d: false }) : any >f : (t: T, u: U) => any ->{ a: 1, b: 'yes' } : { a: number; b: string; } +>{ a: 1, b: 'yes' } : { a: 1; b: "yes"; } >a : number >1 : 1 >b : string >'yes' : "yes" ->{ c: 'no', d: false } : { c: string; d: false; } +>{ c: 'no', d: false } : { c: "no"; d: false; } >c : string >'no' : "no" >d : boolean @@ -293,10 +293,10 @@ let overlap: { id: string, a: number, b: string } = f({ a: 1 }, { a: 2, b: 'extra' }) >f({ a: 1 }, { a: 2, b: 'extra' }) : any >f : (t: T, u: U) => any ->{ a: 1 } : { a: number; } +>{ a: 1 } : { a: 1; } >a : number >1 : 1 ->{ a: 2, b: 'extra' } : { a: number; b: string; } +>{ a: 2, b: 'extra' } : { a: 2; b: "extra"; } >a : number >2 : 2 >b : string @@ -310,10 +310,10 @@ let overlapConflict: { id:string, a: string } = f({ a: 1 }, { a: 'mismatch' }) >f({ a: 1 }, { a: 'mismatch' }) : any >f : (t: T, u: U) => any ->{ a: 1 } : { a: number; } +>{ a: 1 } : { a: 1; } >a : number >1 : 1 ->{ a: 'mismatch' } : { a: string; } +>{ a: 'mismatch' } : { a: "mismatch"; } >a : string >'mismatch' : "mismatch" @@ -327,12 +327,12 @@ let overwriteId: { id: string, a: number, c: number, d: string } = f({ a: 1, id: true }, { c: 1, d: 'no' }) >f({ a: 1, id: true }, { c: 1, d: 'no' }) : any >f : (t: T, u: U) => any ->{ a: 1, id: true } : { a: number; id: true; } +>{ a: 1, id: true } : { a: 1; id: true; } >a : number >1 : 1 >id : boolean >true : true ->{ c: 1, d: 'no' } : { c: number; d: string; } +>{ c: 1, d: 'no' } : { c: 1; d: "no"; } >c : number >1 : 1 >d : string @@ -353,7 +353,7 @@ type Extra = { a: string, b: string, extra: string }; const extra1: A = { a: "a", b: "b", extra: "extra" }; >extra1 : A >A : A ->{ a: "a", b: "b", extra: "extra" } : { a: string; b: string; extra: string; } +>{ a: "a", b: "b", extra: "extra" } : { a: "a"; b: "b"; extra: string; } >a : string >"a" : "a" >b : string @@ -386,7 +386,7 @@ const a2: A = { ...extra2 }; // not on the symbol declarations above const extra3: Extra = { a: "a", b: "b", extra: "extra" }; >extra3 : Extra >Extra : Extra ->{ a: "a", b: "b", extra: "extra" } : { a: string; b: string; extra: string; } +>{ a: "a", b: "b", extra: "extra" } : { a: "a"; b: "b"; extra: "extra"; } >a : string >"a" : "a" >b : string diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types index 8ac7b807cbab8..d2562b5f66caa 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types @@ -50,7 +50,7 @@ var a: { var b: { [x: number]: string; } = { 0: '' }; >b : { [x: number]: string; } >x : number ->{ 0: '' } : { 0: string; } +>{ 0: '' } : { 0: ""; } >'' : "" function foo1(x: A); diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types index bcf2ef6d73325..cf39445f507e5 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types @@ -50,7 +50,7 @@ var a: { var b: { [x: number]: string; } = { 0: '' }; >b : { [x: number]: string; } >x : number ->{ 0: '' } : { 0: string; } +>{ 0: '' } : { 0: ""; } >'' : "" function foo1(x: A); diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types index 4028835a9c4ad..b364dcb65aac9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types @@ -50,7 +50,7 @@ var a: { var b: { [x: string]: string; } = { foo: '' }; >b : { [x: string]: string; } >x : string ->{ foo: '' } : { foo: string; } +>{ foo: '' } : { foo: ""; } >foo : string >'' : "" diff --git a/tests/baselines/reference/optionalBindingParameters1.errors.txt b/tests/baselines/reference/optionalBindingParameters1.errors.txt index 339f004298394..6be31635ddeca 100644 --- a/tests/baselines/reference/optionalBindingParameters1.errors.txt +++ b/tests/baselines/reference/optionalBindingParameters1.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(1,14): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. -tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(7,5): error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. +tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(7,5): error TS2345: Argument of type '[boolean, 0, string]' is not assignable to parameter of type '[string, number, boolean]'. Type 'boolean' is not assignable to type 'string'. @@ -14,5 +14,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters1.ts(7,5): er foo([false, 0, ""]); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. +!!! error TS2345: Argument of type '[boolean, 0, string]' is not assignable to parameter of type '[string, number, boolean]'. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParameters1.types b/tests/baselines/reference/optionalBindingParameters1.types index 74b255325132e..a191a7480fc70 100644 --- a/tests/baselines/reference/optionalBindingParameters1.types +++ b/tests/baselines/reference/optionalBindingParameters1.types @@ -10,7 +10,7 @@ function foo([x,y,z]?: [string, number, boolean]) { foo(["", 0, false]); >foo(["", 0, false]) : void >foo : ([x, y, z]?: [string, number, boolean]) => void ->["", 0, false] : [string, number, false] +>["", 0, false] : ["", 0, false] >"" : "" >0 : 0 >false : false diff --git a/tests/baselines/reference/optionalBindingParameters2.errors.txt b/tests/baselines/reference/optionalBindingParameters2.errors.txt index b7e9bb1c2da1a..c5673d9e7e905 100644 --- a/tests/baselines/reference/optionalBindingParameters2.errors.txt +++ b/tests/baselines/reference/optionalBindingParameters2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(1,14): error TS2463: A binding pattern parameter cannot be optional in an implementation signature. -tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(7,5): error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(7,5): error TS2345: Argument of type '{ x: boolean; y: 0; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. Types of property 'x' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -15,6 +15,6 @@ tests/cases/conformance/es6/destructuring/optionalBindingParameters2.ts(7,5): er foo({ x: false, y: 0, z: "" }); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +!!! error TS2345: Argument of type '{ x: boolean; y: 0; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. !!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParameters2.types b/tests/baselines/reference/optionalBindingParameters2.types index 69538fe661d3c..394e3ae9f6bdb 100644 --- a/tests/baselines/reference/optionalBindingParameters2.types +++ b/tests/baselines/reference/optionalBindingParameters2.types @@ -13,7 +13,7 @@ function foo({ x, y, z }?: { x: string; y: number; z: boolean }) { foo({ x: "", y: 0, z: false }); >foo({ x: "", y: 0, z: false }) : void >foo : ({ x, y, z }?: { x: string; y: number; z: boolean; }) => void ->{ x: "", y: 0, z: false } : { x: string; y: number; z: false; } +>{ x: "", y: 0, z: false } : { x: ""; y: 0; z: false; } >x : string >"" : "" >y : number diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt b/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt index d2be862f6eff7..24b73fa6e4745 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt +++ b/tests/baselines/reference/optionalBindingParametersInOverloads1.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads1.ts(8,5): error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. +tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads1.ts(8,5): error TS2345: Argument of type '[boolean, 0, string]' is not assignable to parameter of type '[string, number, boolean]'. Type 'boolean' is not assignable to type 'string'. @@ -12,5 +12,5 @@ tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads1. foo([false, 0, ""]); ~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[boolean, number, ""]' is not assignable to parameter of type '[string, number, boolean]'. +!!! error TS2345: Argument of type '[boolean, 0, string]' is not assignable to parameter of type '[string, number, boolean]'. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads1.types b/tests/baselines/reference/optionalBindingParametersInOverloads1.types index 01d1756a6ac7e..8cafb45176687 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads1.types +++ b/tests/baselines/reference/optionalBindingParametersInOverloads1.types @@ -14,7 +14,7 @@ function foo(...rest: any[]) { foo(["", 0, false]); >foo(["", 0, false]) : any >foo : ([x, y, z]?: [string, number, boolean]) => any ->["", 0, false] : [string, number, false] +>["", 0, false] : ["", 0, false] >"" : "" >0 : 0 >false : false diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt b/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt index ccbdfce2fddec..8060b753ce9b2 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt +++ b/tests/baselines/reference/optionalBindingParametersInOverloads2.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2.ts(8,5): error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2.ts(8,5): error TS2345: Argument of type '{ x: boolean; y: 0; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. Types of property 'x' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -13,6 +13,6 @@ tests/cases/conformance/es6/destructuring/optionalBindingParametersInOverloads2. foo({ x: false, y: 0, z: "" }); ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ x: boolean; y: number; z: ""; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. +!!! error TS2345: Argument of type '{ x: boolean; y: 0; z: string; }' is not assignable to parameter of type '{ x: string; y: number; z: boolean; }'. !!! error TS2345: Types of property 'x' are incompatible. !!! error TS2345: Type 'boolean' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/optionalBindingParametersInOverloads2.types b/tests/baselines/reference/optionalBindingParametersInOverloads2.types index 287a0634a8e35..2ee516a786749 100644 --- a/tests/baselines/reference/optionalBindingParametersInOverloads2.types +++ b/tests/baselines/reference/optionalBindingParametersInOverloads2.types @@ -17,7 +17,7 @@ function foo(...rest: any[]) { foo({ x: "", y: 0, z: false }); >foo({ x: "", y: 0, z: false }) : any >foo : ({ x, y, z }?: { x: string; y: number; z: boolean; }) => any ->{ x: "", y: 0, z: false } : { x: string; y: number; z: false; } +>{ x: "", y: 0, z: false } : { x: ""; y: 0; z: false; } >x : string >"" : "" >y : number diff --git a/tests/baselines/reference/optionalParamArgsTest.types b/tests/baselines/reference/optionalParamArgsTest.types index bb898755bcb4d..dca38398e78c8 100644 --- a/tests/baselines/reference/optionalParamArgsTest.types +++ b/tests/baselines/reference/optionalParamArgsTest.types @@ -509,10 +509,10 @@ fnOpt1(1, [2, 3], [1], true); >fnOpt1(1, [2, 3], [1], true) : void >fnOpt1 : (id: number, children?: number[], expectedPath?: number[], isRoot?: boolean) => void >1 : 1 ->[2, 3] : number[] +>[2, 3] : (2 | 3)[] >2 : 2 >3 : 3 ->[1] : number[] +>[1] : 1[] >1 : 1 >true : true @@ -520,10 +520,10 @@ fnOpt2(1, [2, 3], [1], true); >fnOpt2(1, [2, 3], [1], true) : void >fnOpt2 : (id: number, children?: number[], expectedPath?: number[], isRoot?: boolean) => void >1 : 1 ->[2, 3] : number[] +>[2, 3] : (2 | 3)[] >2 : 2 >3 : 3 ->[1] : number[] +>[1] : 1[] >1 : 1 >true : true diff --git a/tests/baselines/reference/optionalProperties01.types b/tests/baselines/reference/optionalProperties01.types index b60d87f07becb..dc89b1bc674df 100644 --- a/tests/baselines/reference/optionalProperties01.types +++ b/tests/baselines/reference/optionalProperties01.types @@ -15,7 +15,7 @@ interface Foo { const foo1 = { required1: "hello" } as Foo; >foo1 : Foo >{ required1: "hello" } as Foo : Foo ->{ required1: "hello" } : { required1: string; } +>{ required1: "hello" } : { required1: "hello"; } >required1 : string >"hello" : "hello" >Foo : Foo @@ -23,7 +23,7 @@ const foo1 = { required1: "hello" } as Foo; const foo2 = { required1: "hello", optional: "bar" } as Foo; >foo2 : Foo >{ required1: "hello", optional: "bar" } as Foo : Foo ->{ required1: "hello", optional: "bar" } : { required1: string; optional: string; } +>{ required1: "hello", optional: "bar" } : { required1: "hello"; optional: "bar"; } >required1 : string >"hello" : "hello" >optional : string diff --git a/tests/baselines/reference/optionalPropertiesTest.errors.txt b/tests/baselines/reference/optionalPropertiesTest.errors.txt index a4b721e92ef66..e281057c5bbbc 100644 --- a/tests/baselines/reference/optionalPropertiesTest.errors.txt +++ b/tests/baselines/reference/optionalPropertiesTest.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'. - Property 'id' is missing in type '{ name: string; }'. +tests/cases/compiler/optionalPropertiesTest.ts(14,1): error TS2322: Type '{ name: "test"; }' is not assignable to type 'IFoo'. + Property 'id' is missing in type '{ name: "test"; }'. tests/cases/compiler/optionalPropertiesTest.ts(25,5): error TS2322: Type '{}' is not assignable to type 'i1'. Property 'M' is missing in type '{}'. tests/cases/compiler/optionalPropertiesTest.ts(26,5): error TS2322: Type '{}' is not assignable to type 'i3'. @@ -24,8 +24,8 @@ tests/cases/compiler/optionalPropertiesTest.ts(40,1): error TS2322: Type 'i2' is foo = { id: 1234, name: "test" }; // Ok foo = { name: "test" }; // Error, id missing ~~~ -!!! error TS2322: Type '{ name: string; }' is not assignable to type 'IFoo'. -!!! error TS2322: Property 'id' is missing in type '{ name: string; }'. +!!! error TS2322: Type '{ name: "test"; }' is not assignable to type 'IFoo'. +!!! error TS2322: Property 'id' is missing in type '{ name: "test"; }'. foo = {id: 1234, print:()=>{}} // Ok var s = foo.name || "default"; diff --git a/tests/baselines/reference/optionalPropertiesTest.types b/tests/baselines/reference/optionalPropertiesTest.types index 018a70c051b90..fc441a2078115 100644 --- a/tests/baselines/reference/optionalPropertiesTest.types +++ b/tests/baselines/reference/optionalPropertiesTest.types @@ -24,32 +24,32 @@ var foo: IFoo; >IFoo : IFoo foo = { id: 1234 }; // Ok ->foo = { id: 1234 } : { id: number; } +>foo = { id: 1234 } : { id: 1234; } >foo : IFoo ->{ id: 1234 } : { id: number; } +>{ id: 1234 } : { id: 1234; } >id : number >1234 : 1234 foo = { id: 1234, name: "test" }; // Ok ->foo = { id: 1234, name: "test" } : { id: number; name: string; } +>foo = { id: 1234, name: "test" } : { id: 1234; name: "test"; } >foo : IFoo ->{ id: 1234, name: "test" } : { id: number; name: string; } +>{ id: 1234, name: "test" } : { id: 1234; name: "test"; } >id : number >1234 : 1234 >name : string >"test" : "test" foo = { name: "test" }; // Error, id missing ->foo = { name: "test" } : { name: string; } +>foo = { name: "test" } : { name: "test"; } >foo : IFoo ->{ name: "test" } : { name: string; } +>{ name: "test" } : { name: "test"; } >name : string >"test" : "test" foo = {id: 1234, print:()=>{}} // Ok ->foo = {id: 1234, print:()=>{}} : { id: number; print: () => void; } +>foo = {id: 1234, print:()=>{}} : { id: 1234; print: () => void; } >foo : IFoo ->{id: 1234, print:()=>{}} : { id: number; print: () => void; } +>{id: 1234, print:()=>{}} : { id: 1234; print: () => void; } >id : number >1234 : 1234 >print : () => void @@ -120,7 +120,7 @@ var test5: i1 = { M: function () { } }; var test6: i3 = { M: 5 }; >test6 : i3 >i3 : i3 ->{ M: 5 } : { M: number; } +>{ M: 5 } : { M: 5; } >M : number >5 : 5 @@ -139,7 +139,7 @@ test7 = {}; var test8: i4 = { M: 5 } >test8 : i4 >i4 : i4 ->{ M: 5 } : { M: number; } +>{ M: 5 } : { M: 5; } >M : number >5 : 5 diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index dddc0a0d575b6..e4da12a606b61 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,5): error TS2345: Argument of type '{ s: string; n: 0; }' is not assignable to parameter of type '{ n: number; }'. Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' has type 'A' at tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts 20:4, but here has type 'C'. -tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS2345: Argument of type '{ s: string; n: 0; }' is not assignable to parameter of type '{ n: number; }'. Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. @@ -26,7 +26,7 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS234 v({ s: "", n: 0 }).toLowerCase(); ~~~~~ -!!! error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2345: Argument of type '{ s: string; n: 0; }' is not assignable to parameter of type '{ n: number; }'. !!! error TS2345: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. var w: A; @@ -36,5 +36,5 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS234 w({ s: "", n: 0 }).toLowerCase(); ~~~~~ -!!! error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'. +!!! error TS2345: Argument of type '{ s: string; n: 0; }' is not assignable to parameter of type '{ n: number; }'. !!! error TS2345: Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types index 5afe742dc680c..bbd092c1e49e7 100644 --- a/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types +++ b/tests/baselines/reference/overloadOnConstAsTypeAnnotation.types @@ -2,7 +2,7 @@ var f: (x: 'hi') => number = (x: 'hi') => { return 1; }; >f : (x: "hi") => number >x : "hi" ->(x: 'hi') => { return 1; } : (x: "hi") => number +>(x: 'hi') => { return 1; } : (x: "hi") => 1 >x : "hi" >1 : 1 diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation.types b/tests/baselines/reference/overloadOnConstNoAnyImplementation.types index 00829f9dc8ec4..d9ad620a1ba65 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation.types +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation.types @@ -50,7 +50,7 @@ function x1(a: number, cb: (x: string) => number) { var cb: (number) => number = (x: number) => 1; >cb : (number: any) => number >number : any ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 @@ -64,7 +64,7 @@ x1(1, (x: 'hi') => 1); // error >x1(1, (x: 'hi') => 1) : any >x1 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } >1 : 1 ->(x: 'hi') => 1 : (x: "hi") => number +>(x: 'hi') => 1 : (x: "hi") => 1 >x : "hi" >1 : 1 @@ -72,7 +72,7 @@ x1(1, (x: string) => 1); >x1(1, (x: string) => 1) : any >x1 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } >1 : 1 ->(x: string) => 1 : (x: string) => number +>(x: string) => 1 : (x: string) => 1 >x : string >1 : 1 diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt index a090f370863f5..436348c7446c4 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.errors.txt @@ -1,9 +1,9 @@ tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(6,5): error TS2394: Overload signature is not compatible with function implementation. tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(12,18): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'. -tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. +tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => 1' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type '"bye"'. -tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(21,9): error TS2345: Argument of type '(x: number) => number' is not assignable to parameter of type '(x: "hi") => number'. +tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(21,9): error TS2345: Argument of type '(x: number) => 1' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type 'number'. @@ -32,13 +32,13 @@ tests/cases/compiler/overloadOnConstNoAnyImplementation2.ts(21,9): error TS2345: c.x1(1, (x: 'hi') => { return 1; } ); c.x1(1, (x: 'bye') => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. +!!! error TS2345: Argument of type '(x: "bye") => 1' is not assignable to parameter of type '(x: "hi") => number'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type '"hi"' is not assignable to type '"bye"'. c.x1(1, (x) => { return 1; } ); c.x1(1, (x: number) => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number) => number' is not assignable to parameter of type '(x: "hi") => number'. +!!! error TS2345: Argument of type '(x: number) => 1' is not assignable to parameter of type '(x: "hi") => number'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type '"hi"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.types b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.types index 108b922944d11..7facb2943356a 100644 --- a/tests/baselines/reference/overloadOnConstNoAnyImplementation2.types +++ b/tests/baselines/reference/overloadOnConstNoAnyImplementation2.types @@ -60,7 +60,7 @@ c.x1(1, (x: 'hi') => { return 1; } ); >c : C >x1 : (a: number, callback: (x: "hi") => number) => any >1 : 1 ->(x: 'hi') => { return 1; } : (x: "hi") => number +>(x: 'hi') => { return 1; } : (x: "hi") => 1 >x : "hi" >1 : 1 @@ -70,7 +70,7 @@ c.x1(1, (x: 'bye') => { return 1; } ); >c : C >x1 : (a: number, callback: (x: "hi") => number) => any >1 : 1 ->(x: 'bye') => { return 1; } : (x: "bye") => number +>(x: 'bye') => { return 1; } : (x: "bye") => 1 >x : "bye" >1 : 1 @@ -80,7 +80,7 @@ c.x1(1, (x) => { return 1; } ); >c : C >x1 : (a: number, callback: (x: "hi") => number) => any >1 : 1 ->(x) => { return 1; } : (x: "hi") => number +>(x) => { return 1; } : (x: "hi") => 1 >x : "hi" >1 : 1 @@ -90,7 +90,7 @@ c.x1(1, (x: number) => { return 1; } ); >c : C >x1 : (a: number, callback: (x: "hi") => number) => any >1 : 1 ->(x: number) => { return 1; } : (x: number) => number +>(x: number) => { return 1; } : (x: number) => 1 >x : number >1 : 1 diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation.types b/tests/baselines/reference/overloadOnConstNoStringImplementation.types index 0fdbc97e380e9..a4d13ef06a355 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation.types +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation.types @@ -50,7 +50,7 @@ function x2(a: number, cb: (x: any) => number) { var cb: (number) => number = (x: number) => 1; >cb : (number: any) => number >number : any ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 @@ -64,7 +64,7 @@ x2(1, (x: 'hi') => 1); // error >x2(1, (x: 'hi') => 1) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } >1 : 1 ->(x: 'hi') => 1 : (x: "hi") => number +>(x: 'hi') => 1 : (x: "hi") => 1 >x : "hi" >1 : 1 @@ -72,7 +72,7 @@ x2(1, (x: string) => 1); >x2(1, (x: string) => 1) : any >x2 : { (a: number, cb: (x: "hi") => number): any; (a: number, cb: (x: "bye") => number): any; } >1 : 1 ->(x: string) => 1 : (x: string) => number +>(x: string) => 1 : (x: string) => 1 >x : string >1 : 1 diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt b/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt index e7ac72eb0520b..90081d9259b68 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. +tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(18,9): error TS2345: Argument of type '(x: "bye") => 1' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type '"bye"'. -tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(20,9): error TS2345: Argument of type '(x: number) => number' is not assignable to parameter of type '(x: "hi") => number'. +tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(20,9): error TS2345: Argument of type '(x: number) => 1' is not assignable to parameter of type '(x: "hi") => number'. Types of parameters 'x' and 'x' are incompatible. Type '"hi"' is not assignable to type 'number'. @@ -26,12 +26,12 @@ tests/cases/compiler/overloadOnConstNoStringImplementation2.ts(20,9): error TS23 c.x1(1, (x: 'hi') => { return 1; } ); c.x1(1, (x: 'bye') => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: "bye") => number' is not assignable to parameter of type '(x: "hi") => number'. +!!! error TS2345: Argument of type '(x: "bye") => 1' is not assignable to parameter of type '(x: "hi") => number'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type '"hi"' is not assignable to type '"bye"'. c.x1(1, (x: string) => { return 1; } ); c.x1(1, (x: number) => { return 1; } ); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number) => number' is not assignable to parameter of type '(x: "hi") => number'. +!!! error TS2345: Argument of type '(x: number) => 1' is not assignable to parameter of type '(x: "hi") => number'. !!! error TS2345: Types of parameters 'x' and 'x' are incompatible. !!! error TS2345: Type '"hi"' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/overloadOnConstNoStringImplementation2.types b/tests/baselines/reference/overloadOnConstNoStringImplementation2.types index dd46d3fcd6576..3b16f1ee03ba3 100644 --- a/tests/baselines/reference/overloadOnConstNoStringImplementation2.types +++ b/tests/baselines/reference/overloadOnConstNoStringImplementation2.types @@ -61,7 +61,7 @@ c.x1(1, (x: 'hi') => { return 1; } ); >c : C >x1 : (a: number, callback: (x: "hi") => number) => any >1 : 1 ->(x: 'hi') => { return 1; } : (x: "hi") => number +>(x: 'hi') => { return 1; } : (x: "hi") => 1 >x : "hi" >1 : 1 @@ -71,7 +71,7 @@ c.x1(1, (x: 'bye') => { return 1; } ); >c : C >x1 : (a: number, callback: (x: "hi") => number) => any >1 : 1 ->(x: 'bye') => { return 1; } : (x: "bye") => number +>(x: 'bye') => { return 1; } : (x: "bye") => 1 >x : "bye" >1 : 1 @@ -81,7 +81,7 @@ c.x1(1, (x: string) => { return 1; } ); >c : C >x1 : (a: number, callback: (x: "hi") => number) => any >1 : 1 ->(x: string) => { return 1; } : (x: string) => number +>(x: string) => { return 1; } : (x: string) => 1 >x : string >1 : 1 @@ -91,7 +91,7 @@ c.x1(1, (x: number) => { return 1; } ); >c : C >x1 : (a: number, callback: (x: "hi") => number) => any >1 : 1 ->(x: number) => { return 1; } : (x: number) => number +>(x: number) => { return 1; } : (x: number) => 1 >x : number >1 : 1 diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types index d5a06781eec55..776e55a023970 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types @@ -44,7 +44,7 @@ module Bugs { >tokens.push : (...items: IToken[]) => number >tokens : IToken[] >push : (...items: IToken[]) => number ->{ startIndex: 1, type: '', bracket: 3 } : { startIndex: number; type: string; bracket: number; } +>{ startIndex: 1, type: '', bracket: 3 } : { startIndex: 1; type: ""; bracket: 3; } >startIndex : number >1 : 1 >type : string @@ -59,8 +59,8 @@ module Bugs { >push : (...items: IToken[]) => number >({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 }) : IToken >IToken : IToken ->({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 }) : { startIndex: number; type: string; bracket: number; state: null; length: number; } ->{ startIndex: 1, type: '', bracket: 3, state: null, length: 10 } : { startIndex: number; type: string; bracket: number; state: null; length: number; } +>({ startIndex: 1, type: '', bracket: 3, state: null, length: 10 }) : { startIndex: 1; type: ""; bracket: 3; state: null; length: number; } +>{ startIndex: 1, type: '', bracket: 3, state: null, length: 10 } : { startIndex: 1; type: ""; bracket: 3; state: null; length: number; } >startIndex : number >1 : 1 >type : string diff --git a/tests/baselines/reference/overloadResolutionTest1.errors.txt b/tests/baselines/reference/overloadResolutionTest1.errors.txt index 8852f8638650a..b36684db501d8 100644 --- a/tests/baselines/reference/overloadResolutionTest1.errors.txt +++ b/tests/baselines/reference/overloadResolutionTest1.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/overloadResolutionTest1.ts(7,16): error TS2345: Argument of type '{ a: "s"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. - Type '{ a: "s"; }' is not assignable to type '{ a: boolean; }'. +tests/cases/compiler/overloadResolutionTest1.ts(7,16): error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. + Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. Types of property 'a' are incompatible. - Type '"s"' is not assignable to type 'boolean'. -tests/cases/compiler/overloadResolutionTest1.ts(18,15): error TS2345: Argument of type '{ a: "s"; }' is not assignable to parameter of type '{ a: boolean; }'. + Type 'string' is not assignable to type 'boolean'. +tests/cases/compiler/overloadResolutionTest1.ts(18,15): error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. Types of property 'a' are incompatible. - Type '"s"' is not assignable to type 'boolean'. + Type 'string' is not assignable to type 'boolean'. tests/cases/compiler/overloadResolutionTest1.ts(24,14): error TS2345: Argument of type '{ a: boolean; }' is not assignable to parameter of type '{ a: string; }'. Types of property 'a' are incompatible. Type 'boolean' is not assignable to type 'string'. @@ -19,10 +19,10 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,14): error TS2345: Argument o var x11 = foo([{a:0}]); // works var x111 = foo([{a:"s"}]); // error - does not match any signature ~~~~~~~~~ -!!! error TS2345: Argument of type '{ a: "s"; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. -!!! error TS2345: Type '{ a: "s"; }' is not assignable to type '{ a: boolean; }'. +!!! error TS2345: Argument of type '{ a: string; }[]' is not assignable to parameter of type '{ a: boolean; }[]'. +!!! error TS2345: Type '{ a: string; }' is not assignable to type '{ a: boolean; }'. !!! error TS2345: Types of property 'a' are incompatible. -!!! error TS2345: Type '"s"' is not assignable to type 'boolean'. +!!! error TS2345: Type 'string' is not assignable to type 'boolean'. var x1111 = foo([{a:null}]); // works - ambiguous call is resolved to be the first in the overload set so this returns a string @@ -35,9 +35,9 @@ tests/cases/compiler/overloadResolutionTest1.ts(24,14): error TS2345: Argument o var x3 = foo2({a:true}); // works var x4 = foo2({a:"s"}); // error ~~~~~~~ -!!! error TS2345: Argument of type '{ a: "s"; }' is not assignable to parameter of type '{ a: boolean; }'. +!!! error TS2345: Argument of type '{ a: string; }' is not assignable to parameter of type '{ a: boolean; }'. !!! error TS2345: Types of property 'a' are incompatible. -!!! error TS2345: Type '"s"' is not assignable to type 'boolean'. +!!! error TS2345: Type 'string' is not assignable to type 'boolean'. function foo4(bar:{a:number;}):number; diff --git a/tests/baselines/reference/overloadResolutionTest1.types b/tests/baselines/reference/overloadResolutionTest1.types index 8ff83bd66d56d..a034dcd492a00 100644 --- a/tests/baselines/reference/overloadResolutionTest1.types +++ b/tests/baselines/reference/overloadResolutionTest1.types @@ -28,8 +28,8 @@ var x11 = foo([{a:0}]); // works >x11 : string >foo([{a:0}]) : string >foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } ->[{a:0}] : { a: number; }[] ->{a:0} : { a: number; } +>[{a:0}] : { a: 0; }[] +>{a:0} : { a: 0; } >a : number >0 : 0 @@ -73,7 +73,7 @@ var x2 = foo2({a:0}); // works >x2 : string >foo2({a:0}) : string >foo2 : { (bar: { a: number; }): string; (bar: { a: boolean; }): number; } ->{a:0} : { a: number; } +>{a:0} : { a: 0; } >a : number >0 : 0 diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types index 9b44e197cd8e5..5cf070df0fe92 100644 --- a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types @@ -17,13 +17,13 @@ function x2(callback: (x: any) => number) { } x2(() => 1); >x2(() => 1) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } ->() => 1 : () => number +>() => 1 : () => 1 >1 : 1 x2((x) => 1 ); >x2((x) => 1 ) : any >x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } ->(x) => 1 : (x: number) => number +>(x) => 1 : (x: number) => 1 >x : number >1 : 1 diff --git a/tests/baselines/reference/overloadsWithProvisionalErrors.types b/tests/baselines/reference/overloadsWithProvisionalErrors.types index c655f22c05070..771f5e77f0a9d 100644 --- a/tests/baselines/reference/overloadsWithProvisionalErrors.types +++ b/tests/baselines/reference/overloadsWithProvisionalErrors.types @@ -24,10 +24,10 @@ func(s => ({})); // Error for no applicable overload (object type is missing a a func(s => ({ a: blah, b: 3 })); // Only error inside the function, but not outside (since it would be applicable if not for the provisional error) >func(s => ({ a: blah, b: 3 })) : string >func : { (s: string): number; (lambda: (s: string) => { a: number; b: number; }): string; } ->s => ({ a: blah, b: 3 }) : (s: string) => { a: any; b: number; } +>s => ({ a: blah, b: 3 }) : (s: string) => { a: any; b: 3; } >s : string ->({ a: blah, b: 3 }) : { a: any; b: number; } ->{ a: blah, b: 3 } : { a: any; b: number; } +>({ a: blah, b: 3 }) : { a: any; b: 3; } +>{ a: blah, b: 3 } : { a: any; b: 3; } >a : any >blah : any >b : number diff --git a/tests/baselines/reference/overrideBaseIntersectionMethod.types b/tests/baselines/reference/overrideBaseIntersectionMethod.types index b5412b18c0707..9d9ef64cd1e5c 100644 --- a/tests/baselines/reference/overrideBaseIntersectionMethod.types +++ b/tests/baselines/reference/overrideBaseIntersectionMethod.types @@ -55,7 +55,7 @@ class Point { >getLocation : () => [number, number] return [0,0]; ->[0,0] : [number, number] +>[0,0] : [0, 0] >0 : 0 >0 : 0 } diff --git a/tests/baselines/reference/plusOperatorWithNumberType.types b/tests/baselines/reference/plusOperatorWithNumberType.types index 6d630b1d6c7b1..1d42f504d8439 100644 --- a/tests/baselines/reference/plusOperatorWithNumberType.types +++ b/tests/baselines/reference/plusOperatorWithNumberType.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/plusOperatorWithStringType.types b/tests/baselines/reference/plusOperatorWithStringType.types index ec19aaed49710..9d6dc98fe1783 100644 --- a/tests/baselines/reference/plusOperatorWithStringType.types +++ b/tests/baselines/reference/plusOperatorWithStringType.types @@ -5,7 +5,7 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] ->["", "abc"] : string[] +>["", "abc"] : ("" | "abc")[] >"" : "" >"abc" : "abc" diff --git a/tests/baselines/reference/promiseVoidErrorCallback.types b/tests/baselines/reference/promiseVoidErrorCallback.types index bd1b3a87c2603..d57b26c514a3a 100644 --- a/tests/baselines/reference/promiseVoidErrorCallback.types +++ b/tests/baselines/reference/promiseVoidErrorCallback.types @@ -30,7 +30,7 @@ function f1(): Promise { >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->{ __t1: "foo_t1" } : { __t1: string; } +>{ __t1: "foo_t1" } : { __t1: "foo_t1"; } >__t1 : string >"foo_t1" : "foo_t1" } diff --git a/tests/baselines/reference/propertyAccess.errors.txt b/tests/baselines/reference/propertyAccess.errors.txt index 2ac87bc0e3e8f..d8103aefca94f 100644 --- a/tests/baselines/reference/propertyAccess.errors.txt +++ b/tests/baselines/reference/propertyAccess.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(11,55): error TS2322: Type '{ 3: string; 'three': string; }' is not assignable to type '{ [n: number]: string; }'. +tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(11,55): error TS2322: Type '{ 3: "three"; 'three': string; }' is not assignable to type '{ [n: number]: string; }'. Object literal may only specify known properties, and ''three'' does not exist in type '{ [n: number]: string; }'. tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(45,14): error TS2339: Property 'qqq' does not exist on type '{ 10: string; x: string; y: number; z: { n: string; m: number; o: () => boolean; }; 'literal property': number; }'. tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(80,19): error TS2538: Type '{ name: string; }' cannot be used as an index type. @@ -20,7 +20,7 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(149,5): err var numIndex: { [n: number]: string } = { 3: 'three', 'three': 'three' }; ~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ 3: string; 'three': string; }' is not assignable to type '{ [n: number]: string; }'. +!!! error TS2322: Type '{ 3: "three"; 'three': string; }' is not assignable to type '{ [n: number]: string; }'. !!! error TS2322: Object literal may only specify known properties, and ''three'' does not exist in type '{ [n: number]: string; }'. var strIndex: { [n: string]: Compass } = { 'N': Compass.North, 'E': Compass.East }; var bothIndex: diff --git a/tests/baselines/reference/propertyAccess.types b/tests/baselines/reference/propertyAccess.types index eeb14e4696046..32bf0e9468247 100644 --- a/tests/baselines/reference/propertyAccess.types +++ b/tests/baselines/reference/propertyAccess.types @@ -25,7 +25,7 @@ enum Compass { var numIndex: { [n: number]: string } = { 3: 'three', 'three': 'three' }; >numIndex : { [n: number]: string; } >n : number ->{ 3: 'three', 'three': 'three' } : { 3: string; 'three': string; } +>{ 3: 'three', 'three': 'three' } : { 3: "three"; 'three': string; } >'three' : "three" >'three' : "three" diff --git a/tests/baselines/reference/readonlyMembers.types b/tests/baselines/reference/readonlyMembers.types index 7b0c568caeb0a..2245eab1b700f 100644 --- a/tests/baselines/reference/readonlyMembers.types +++ b/tests/baselines/reference/readonlyMembers.types @@ -11,7 +11,7 @@ interface X { var x: X = { a: 0 }; >x : X >X : X ->{ a: 0 } : { a: number; } +>{ a: 0 } : { a: 0; } >a : number >0 : 0 @@ -152,7 +152,7 @@ var p: { readonly a: number, b: number } = { a: 1, b: 1 }; >p : { readonly a: number; b: number; } >a : number >b : number ->{ a: 1, b: 1 } : { a: number; b: number; } +>{ a: 1, b: 1 } : { a: 1; b: 1; } >a : number >1 : 1 >b : number diff --git a/tests/baselines/reference/restArgAssignmentCompat.types b/tests/baselines/reference/restArgAssignmentCompat.types index ccccb83134939..2d8c8c086642b 100644 --- a/tests/baselines/reference/restArgAssignmentCompat.types +++ b/tests/baselines/reference/restArgAssignmentCompat.types @@ -38,7 +38,7 @@ n = f; n([4], 'foo'); >n([4], 'foo') : void >n : (x: number[], y: string) => void ->[4] : number[] +>[4] : 4[] >4 : 4 >'foo' : "foo" diff --git a/tests/baselines/reference/restElementMustBeLast.types b/tests/baselines/reference/restElementMustBeLast.types index 12e5ec84abefe..12e5379ba5896 100644 --- a/tests/baselines/reference/restElementMustBeLast.types +++ b/tests/baselines/reference/restElementMustBeLast.types @@ -8,12 +8,12 @@ var [...a, x] = [1, 2, 3]; // Error, rest must be last element >3 : 3 [...a, x] = [1, 2, 3]; // Error, rest must be last element ->[...a, x] = [1, 2, 3] : number[] +>[...a, x] = [1, 2, 3] : (1 | 2 | 3)[] >[...a, x] : number[] >...a : number >a : number[] >x : number ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/restElementWithAssignmentPattern1.errors.txt b/tests/baselines/reference/restElementWithAssignmentPattern1.errors.txt index 2e1046c9317f5..fa391c75ea180 100644 --- a/tests/baselines/reference/restElementWithAssignmentPattern1.errors.txt +++ b/tests/baselines/reference/restElementWithAssignmentPattern1.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern1.ts(2,6): error TS2322: Type 'string | number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. -tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern1.ts(2,9): error TS2322: Type 'string | number' is not assignable to type 'number'. - Type 'string' is not assignable to type 'number'. +tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern1.ts(2,6): error TS2322: Type '"" | 1' is not assignable to type 'string'. + Type '1' is not assignable to type 'string'. +tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern1.ts(2,9): error TS2322: Type '"" | 1' is not assignable to type 'number'. + Type '""' is not assignable to type 'number'. ==== tests/cases/conformance/es6/destructuring/restElementWithAssignmentPattern1.ts (2 errors) ==== var a: string, b: number; [...[a, b = 0]] = ["", 1]; ~ -!!! error TS2322: Type 'string | number' is not assignable to type 'string'. -!!! error TS2322: Type 'number' is not assignable to type 'string'. +!!! error TS2322: Type '"" | 1' is not assignable to type 'string'. +!!! error TS2322: Type '1' is not assignable to type 'string'. ~ -!!! error TS2322: Type 'string | number' is not assignable to type 'number'. -!!! error TS2322: Type 'string' is not assignable to type 'number'. \ No newline at end of file +!!! error TS2322: Type '"" | 1' is not assignable to type 'number'. +!!! error TS2322: Type '""' is not assignable to type 'number'. \ No newline at end of file diff --git a/tests/baselines/reference/restElementWithAssignmentPattern1.types b/tests/baselines/reference/restElementWithAssignmentPattern1.types index 3740fc66343d0..05f4a81853787 100644 --- a/tests/baselines/reference/restElementWithAssignmentPattern1.types +++ b/tests/baselines/reference/restElementWithAssignmentPattern1.types @@ -4,7 +4,7 @@ var a: string, b: number; >b : number [...[a, b = 0]] = ["", 1]; ->[...[a, b = 0]] = ["", 1] : (string | number)[] +>[...[a, b = 0]] = ["", 1] : ("" | 1)[] >[...[a, b = 0]] : (string | number)[] >...[a, b = 0] : string | number >[a, b = 0] : [string, number] @@ -12,7 +12,7 @@ var a: string, b: number; >b = 0 : 0 >b : number >0 : 0 ->["", 1] : (string | number)[] +>["", 1] : ("" | 1)[] >"" : "" >1 : 1 diff --git a/tests/baselines/reference/restElementWithAssignmentPattern3.types b/tests/baselines/reference/restElementWithAssignmentPattern3.types index c2e01bc441455..f18b9ff81782f 100644 --- a/tests/baselines/reference/restElementWithAssignmentPattern3.types +++ b/tests/baselines/reference/restElementWithAssignmentPattern3.types @@ -5,7 +5,7 @@ var a: string, b: number; var tuple: [string, number] = ["", 1]; >tuple : [string, number] ->["", 1] : [string, number] +>["", 1] : ["", 1] >"" : "" >1 : 1 diff --git a/tests/baselines/reference/restElementWithAssignmentPattern4.types b/tests/baselines/reference/restElementWithAssignmentPattern4.types index f29dd1b219c28..800967cd07309 100644 --- a/tests/baselines/reference/restElementWithAssignmentPattern4.types +++ b/tests/baselines/reference/restElementWithAssignmentPattern4.types @@ -5,7 +5,7 @@ var a: string, b: number; var tuple: [string, number] = ["", 1]; >tuple : [string, number] ->["", 1] : [string, number] +>["", 1] : ["", 1] >"" : "" >1 : 1 diff --git a/tests/baselines/reference/restElementWithAssignmentPattern5.types b/tests/baselines/reference/restElementWithAssignmentPattern5.types index 298bc2e4363f6..9b444f316ce32 100644 --- a/tests/baselines/reference/restElementWithAssignmentPattern5.types +++ b/tests/baselines/reference/restElementWithAssignmentPattern5.types @@ -4,13 +4,13 @@ var s: string, s2: string; >s2 : string [...[s, s2]] = ["", ""]; ->[...[s, s2]] = ["", ""] : string[] +>[...[s, s2]] = ["", ""] : ""[] >[...[s, s2]] : string[] >...[s, s2] : string >[s, s2] : [string, string] >s : string >s2 : string ->["", ""] : string[] +>["", ""] : ""[] >"" : "" >"" : "" diff --git a/tests/baselines/reference/returnInConstructor1.types b/tests/baselines/reference/returnInConstructor1.types index 007271ddf4b04..ecde44f65bac2 100644 --- a/tests/baselines/reference/returnInConstructor1.types +++ b/tests/baselines/reference/returnInConstructor1.types @@ -54,7 +54,7 @@ class E { constructor() { return { foo: 1 }; ->{ foo: 1 } : { foo: number; } +>{ foo: 1 } : { foo: 1; } >foo : number >1 : 1 } diff --git a/tests/baselines/reference/returnStatements.types b/tests/baselines/reference/returnStatements.types index b75104dd666ab..e52c34b426fd1 100644 --- a/tests/baselines/reference/returnStatements.types +++ b/tests/baselines/reference/returnStatements.types @@ -57,7 +57,7 @@ class D extends C { function fn10(): I { return { id: 12 }; } >fn10 : () => I >I : I ->{ id: 12 } : { id: number; } +>{ id: 12 } : { id: 12; } >id : number >12 : 12 diff --git a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.types b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.types index 46e8eb601f1c3..139b42565452a 100644 --- a/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.types +++ b/tests/baselines/reference/shadowingViaLocalValueOrBindingElement.types @@ -15,7 +15,7 @@ if (true) { var { x = 0 } = { x: 0 }; // Error >x : number >0 : 0 ->{ x: 0 } : { x?: number; } +>{ x: 0 } : { x?: 0; } >x : number >0 : 0 @@ -23,7 +23,7 @@ if (true) { >x : any >x : number >0 : 0 ->{ x: 0 } : { x?: number; } +>{ x: 0 } : { x?: 0; } >x : number >0 : 0 diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.types b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.types index 864a04d7b82a2..d7c637ec0b36d 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.types +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring.types @@ -168,14 +168,14 @@ >y : any ({ y:y = 5 } = { y: 1 }) ->({ y:y = 5 } = { y: 1 }) : { y?: number; } ->{ y:y = 5 } = { y: 1 } : { y?: number; } +>({ y:y = 5 } = { y: 1 }) : { y?: 1; } +>{ y:y = 5 } = { y: 1 } : { y?: 1; } >{ y:y = 5 } : { y?: number; } >y : number >y = 5 : 5 >y : any >5 : 5 ->{ y: 1 } : { y?: number; } +>{ y: 1 } : { y?: 1; } >y : number >1 : 1 @@ -189,11 +189,11 @@ >y0 : number ({ y0 = 5 } = { y0: 1 }) ->({ y0 = 5 } = { y0: 1 }) : { y0?: number; } ->{ y0 = 5 } = { y0: 1 } : { y0?: number; } +>({ y0 = 5 } = { y0: 1 }) : { y0?: 1; } +>{ y0 = 5 } = { y0: 1 } : { y0?: 1; } >{ y0 = 5 } : { y0?: number; } >y0 : number ->{ y0: 1 } : { y0?: number; } +>{ y0: 1 } : { y0?: 1; } >y0 : number >1 : 1 @@ -207,14 +207,14 @@ >y0 : number ({ y0:y0 = 5 } = { y0: 1 }) ->({ y0:y0 = 5 } = { y0: 1 }) : { y0?: number; } ->{ y0:y0 = 5 } = { y0: 1 } : { y0?: number; } +>({ y0:y0 = 5 } = { y0: 1 }) : { y0?: 1; } +>{ y0:y0 = 5 } = { y0: 1 } : { y0?: 1; } >{ y0:y0 = 5 } : { y0?: number; } >y0 : number >y0 = 5 : 5 >y0 : number >5 : 5 ->{ y0: 1 } : { y0?: number; } +>{ y0: 1 } : { y0?: 1; } >y0 : number >1 : 1 @@ -336,20 +336,20 @@ >x : number ({ y4:y4 = 5, y5:y5 = { x: 1 } } = {}) ->({ y4:y4 = 5, y5:y5 = { x: 1 } } = {}) : { y4?: number; y5?: { x: number; }; } ->{ y4:y4 = 5, y5:y5 = { x: 1 } } = {} : { y4?: number; y5?: { x: number; }; } ->{ y4:y4 = 5, y5:y5 = { x: 1 } } : { y4?: number; y5?: { x: number; }; } +>({ y4:y4 = 5, y5:y5 = { x: 1 } } = {}) : { y4?: number; y5?: { x: 1; }; } +>{ y4:y4 = 5, y5:y5 = { x: 1 } } = {} : { y4?: number; y5?: { x: 1; }; } +>{ y4:y4 = 5, y5:y5 = { x: 1 } } : { y4?: number; y5?: { x: 1; }; } >y4 : number >y4 = 5 : 5 >y4 : number >5 : 5 +>y5 : { x: 1; } +>y5 = { x: 1 } : { x: 1; } >y5 : { x: number; } ->y5 = { x: 1 } : { x: number; } ->y5 : { x: number; } ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 ->{} : { y4?: number; y5?: { x: number; }; } +>{} : { y4?: number; y5?: { x: 1; }; } }); @@ -386,8 +386,8 @@ >z : any ({ z:z = { x: 5 } } = { z: { x: 1 } }); ->({ z:z = { x: 5 } } = { z: { x: 1 } }) : { z?: { x: number; }; } ->{ z:z = { x: 5 } } = { z: { x: 1 } } : { z?: { x: number; }; } +>({ z:z = { x: 5 } } = { z: { x: 1 } }) : { z?: { x: 1; }; } +>{ z:z = { x: 5 } } = { z: { x: 1 } } : { z?: { x: 1; }; } >{ z:z = { x: 5 } } : { z?: { x: number; }; } >z : { x: number; } >z = { x: 5 } : { x: number; } @@ -395,9 +395,9 @@ >{ x: 5 } : { x: number; } >x : number >5 : 5 ->{ z: { x: 1 } } : { z?: { x: number; }; } ->z : { x: number; } ->{ x: 1 } : { x: number; } +>{ z: { x: 1 } } : { z?: { x: 1; }; } +>z : { x: 1; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 diff --git a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.types b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.types index 939d9864fd086..a04b1c9100019 100644 --- a/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.types +++ b/tests/baselines/reference/shorthandPropertyAssignmentsInDestructuring_ES6.types @@ -168,14 +168,14 @@ >y : any ({ y:y = 5 } = { y: 1 }) ->({ y:y = 5 } = { y: 1 }) : { y?: number; } ->{ y:y = 5 } = { y: 1 } : { y?: number; } +>({ y:y = 5 } = { y: 1 }) : { y?: 1; } +>{ y:y = 5 } = { y: 1 } : { y?: 1; } >{ y:y = 5 } : { y?: number; } >y : number >y = 5 : 5 >y : any >5 : 5 ->{ y: 1 } : { y?: number; } +>{ y: 1 } : { y?: 1; } >y : number >1 : 1 @@ -189,11 +189,11 @@ >y0 : number ({ y0 = 5 } = { y0: 1 }) ->({ y0 = 5 } = { y0: 1 }) : { y0?: number; } ->{ y0 = 5 } = { y0: 1 } : { y0?: number; } +>({ y0 = 5 } = { y0: 1 }) : { y0?: 1; } +>{ y0 = 5 } = { y0: 1 } : { y0?: 1; } >{ y0 = 5 } : { y0?: number; } >y0 : number ->{ y0: 1 } : { y0?: number; } +>{ y0: 1 } : { y0?: 1; } >y0 : number >1 : 1 @@ -207,14 +207,14 @@ >y0 : number ({ y0:y0 = 5 } = { y0: 1 }) ->({ y0:y0 = 5 } = { y0: 1 }) : { y0?: number; } ->{ y0:y0 = 5 } = { y0: 1 } : { y0?: number; } +>({ y0:y0 = 5 } = { y0: 1 }) : { y0?: 1; } +>{ y0:y0 = 5 } = { y0: 1 } : { y0?: 1; } >{ y0:y0 = 5 } : { y0?: number; } >y0 : number >y0 = 5 : 5 >y0 : number >5 : 5 ->{ y0: 1 } : { y0?: number; } +>{ y0: 1 } : { y0?: 1; } >y0 : number >1 : 1 @@ -336,20 +336,20 @@ >x : number ({ y4:y4 = 5, y5:y5 = { x: 1 } } = {}) ->({ y4:y4 = 5, y5:y5 = { x: 1 } } = {}) : { y4?: number; y5?: { x: number; }; } ->{ y4:y4 = 5, y5:y5 = { x: 1 } } = {} : { y4?: number; y5?: { x: number; }; } ->{ y4:y4 = 5, y5:y5 = { x: 1 } } : { y4?: number; y5?: { x: number; }; } +>({ y4:y4 = 5, y5:y5 = { x: 1 } } = {}) : { y4?: number; y5?: { x: 1; }; } +>{ y4:y4 = 5, y5:y5 = { x: 1 } } = {} : { y4?: number; y5?: { x: 1; }; } +>{ y4:y4 = 5, y5:y5 = { x: 1 } } : { y4?: number; y5?: { x: 1; }; } >y4 : number >y4 = 5 : 5 >y4 : number >5 : 5 +>y5 : { x: 1; } +>y5 = { x: 1 } : { x: 1; } >y5 : { x: number; } ->y5 = { x: 1 } : { x: number; } ->y5 : { x: number; } ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 ->{} : { y4?: number; y5?: { x: number; }; } +>{} : { y4?: number; y5?: { x: 1; }; } }); @@ -386,8 +386,8 @@ >z : any ({ z:z = { x: 5 } } = { z: { x: 1 } }); ->({ z:z = { x: 5 } } = { z: { x: 1 } }) : { z?: { x: number; }; } ->{ z:z = { x: 5 } } = { z: { x: 1 } } : { z?: { x: number; }; } +>({ z:z = { x: 5 } } = { z: { x: 1 } }) : { z?: { x: 1; }; } +>{ z:z = { x: 5 } } = { z: { x: 1 } } : { z?: { x: 1; }; } >{ z:z = { x: 5 } } : { z?: { x: number; }; } >z : { x: number; } >z = { x: 5 } : { x: number; } @@ -395,9 +395,9 @@ >{ x: 5 } : { x: number; } >x : number >5 : 5 ->{ z: { x: 1 } } : { z?: { x: number; }; } ->z : { x: number; } ->{ x: 1 } : { x: number; } +>{ z: { x: 1 } } : { z?: { x: 1; }; } +>z : { x: 1; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types index 00ecd2659eead..3e781d663b85d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, [string, string]]; let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -30,18 +30,18 @@ function getRobot() { let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["mower", ["mowing", ""]] : [string, [string, string]] +>["mower", ["mowing", ""]] : ["mower", ["mowing", ""]] >"mower" : "mower" ->["mowing", ""] : [string, string] +>["mowing", ""] : ["mowing", ""] >"mowing" : "mowing" >"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types index f317fa2a83cfd..9bb0370f10c35 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPattern2.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, [string, string]]; let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -30,18 +30,18 @@ function getRobot() { let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["mower", ["mowing", ""]] : [string, [string, string]] +>["mower", ["mowing", ""]] : ["mower", ["mowing", ""]] >"mower" : "mower" ->["mowing", ""] : [string, string] +>["mowing", ""] : ["mowing", ""] >"mowing" : "mowing" >"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" @@ -124,11 +124,11 @@ for ([, nameA] = getRobot(), i = 0; i < 1; i++) { } for ([, nameA] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >[, nameA] = [2, "trimmer", "trimming"], i = 0 : 0 ->[, nameA] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameA] = [2, "trimmer", "trimming"] : [number, "trimmer", "trimming"] >[, nameA] : [undefined, string] > : undefined >nameA : string ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [number, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -201,15 +201,15 @@ for ([, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; i++) } for ([, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 ->[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, ["trimming", "edging"]] >[, [primarySkillA, secondarySkillA]] : [undefined, [string, string]] > : undefined >[primarySkillA, secondarySkillA] : [string, string] >primarySkillA : string >secondarySkillA : string ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" >i = 0 : 0 @@ -276,10 +276,10 @@ for ([numberB] = getRobot(), i = 0; i < 1; i++) { } for ([numberB] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >[numberB] = [2, "trimmer", "trimming"], i = 0 : 0 ->[numberB] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB] = [2, "trimmer", "trimming"] : [2, string, string] >[numberB] : [number] >numberB : number ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, string, string] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -346,12 +346,12 @@ for ([nameB] = getMultiRobot(), i = 0; i < 1; i++) { } for ([nameB] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >[nameB] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 ->[nameB] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameB] = ["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >[nameB] : [string] >nameB : string ->["trimmer", ["trimming", "edging"]] : [string, string[]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >"trimmer" : "trimmer" ->["trimming", "edging"] : string[] +>["trimming", "edging"] : ("trimming" | "edging")[] >"trimming" : "trimming" >"edging" : "edging" >i = 0 : 0 @@ -422,12 +422,12 @@ for ([numberA2, nameA2, skillA2] = getRobot(), i = 0; i < 1; i++) { } for ([numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"], i = 0 : 0 ->[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA2, nameA2, skillA2] = [2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >[numberA2, nameA2, skillA2] : [number, string, string] >numberA2 : number >nameA2 : string >skillA2 : string ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -500,15 +500,15 @@ for ([nameMA, [primarySkillA, secondarySkillA]] = getMultiRobot(), i = 0; i < 1; } for ([nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 ->[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMA, [primarySkillA, secondarySkillA]] = ["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >[nameMA, [primarySkillA, secondarySkillA]] : [string, [string, string]] >nameMA : string >[primarySkillA, secondarySkillA] : [string, string] >primarySkillA : string >secondarySkillA : string ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" >i = 0 : 0 @@ -586,7 +586,7 @@ for ([numberA3, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; i < 1 >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -661,9 +661,9 @@ for ([...multiRobotAInfo] = ["trimmer", ["trimming", "edging" >multiRobotAInfo : (string | [string, string])[] >["trimmer", ["trimming", "edging"]] : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" >i = 0 : 0 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types index 443f22bbab813..c991a0e12c22d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, string[]]; let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -30,18 +30,18 @@ function getRobot() { let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, string[]] >MultiSkilledRobot : [string, string[]] ->["mower", ["mowing", ""]] : [string, string[]] +>["mower", ["mowing", ""]] : ["mower", ("mowing" | "")[]] >"mower" : "mower" ->["mowing", ""] : string[] +>["mowing", ""] : ("mowing" | "")[] >"mowing" : "mowing" >"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, string[]] >MultiSkilledRobot : [string, string[]] ->["trimmer", ["trimming", "edging"]] : [string, string[]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >"trimmer" : "trimmer" ->["trimming", "edging"] : string[] +>["trimming", "edging"] : ("trimming" | "edging")[] >"trimming" : "trimming" >"edging" : "edging" @@ -97,7 +97,7 @@ for (let [, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { > : undefined >nameA : string >"name" : "name" ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [number, "trimmer", string] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -128,7 +128,7 @@ for (let [, [ >"secondary" : "secondary" ] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" >multiRobotA : [string, string[]] @@ -159,7 +159,7 @@ for (let [, [ >"secondary" : "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" >getMultiRobot() : [string, string[]] @@ -191,12 +191,12 @@ for (let [, [ >"secondary" : "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" >i : number @@ -260,7 +260,7 @@ for (let [numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >numberB : number >-1 : -1 >1 : 1 ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, string, string] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -321,9 +321,9 @@ for (let [nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { for (let [nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >nameB : string >"name" : "name" ->["trimmer", ["trimming", "edging"]] : [string, string[]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >"trimmer" : "trimmer" ->["trimming", "edging"] : string[] +>["trimming", "edging"] : ("trimming" | "edging")[] >"trimming" : "trimming" >"edging" : "edging" >i : number @@ -399,7 +399,7 @@ for (let [numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "t >"name" : "name" >skillA2 : string >"skill" : "skill" ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -433,7 +433,7 @@ for (let >"secondary" : "secondary" ] = ["none", "none"] ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" @@ -468,7 +468,7 @@ for (let [nameMA = "noName", >"secondary" : "secondary" ] = ["none", "none"] ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" @@ -504,14 +504,14 @@ for (let [nameMA = "noName", >"secondary" : "secondary" ] = ["none", "none"] ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" ] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" >i : number diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types index 0795142c6778d..1f82f8fa11c70 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, [string, string]]; let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -30,18 +30,18 @@ function getRobot() { let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["mower", ["mowing", ""]] : [string, [string, string]] +>["mower", ["mowing", ""]] : ["mower", ["mowing", ""]] >"mower" : "mower" ->["mowing", ""] : [string, string] +>["mowing", ""] : ["mowing", ""] >"mowing" : "mowing" >"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" @@ -128,13 +128,13 @@ for ([, nameA = "name"] = getRobot(), i = 0; i < 1; i++) { } for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >[, nameA = "name"] = [2, "trimmer", "trimming"], i = 0 : 0 ->[, nameA = "name"] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameA = "name"] = [2, "trimmer", "trimming"] : [number, "trimmer", "trimming"] >[, nameA = "name"] : [undefined, string] > : undefined >nameA = "name" : "name" >nameA : string >"name" : "name" ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [number, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -157,9 +157,9 @@ for ([, nameA = "name"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { for ([, [ >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA, i = 0 : 0 >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = multiRobotA : [string, [string, string]] ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, ["none", "none"]] > : undefined ->[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : ["none", "none"] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", @@ -173,7 +173,7 @@ for ([, [ >"secondary" : "secondary" ] = ["none", "none"]] = multiRobotA, i = 0; i < 1; i++) { ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" >multiRobotA : [string, [string, string]] @@ -196,9 +196,9 @@ for ([, [ for ([, [ >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot(), i = 0 : 0 >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, ["none", "none"]] > : undefined ->[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : ["none", "none"] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", @@ -212,7 +212,7 @@ for ([, [ >"secondary" : "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0; i < 1; i++) { ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" >getMultiRobot() : [string, [string, string]] @@ -235,10 +235,10 @@ for ([, [ } for ([, [ >[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, ["trimming", "edging"]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"]] : [undefined, ["none", "none"]] > : undefined ->[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["none", "none"] : ["none", "none"] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", @@ -252,12 +252,12 @@ for ([, [ >"secondary" : "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : [string, ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" >i = 0 : 0 @@ -330,13 +330,13 @@ for ([numberB = -1] = getRobot(), i = 0; i < 1; i++) { } for ([numberB = -1] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >[numberB = -1] = [2, "trimmer", "trimming"], i = 0 : 0 ->[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1] = [2, "trimmer", "trimming"] : [2, string, string] >[numberB = -1] : [number] >numberB = -1 : -1 >numberB : number >-1 : -1 >1 : 1 ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, string, string] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -407,14 +407,14 @@ for ([nameB = "name"] = getMultiRobot(), i = 0; i < 1; i++) { } for ([nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { >[nameB = "name"] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 ->[nameB = "name"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameB = "name"] = ["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >[nameB = "name"] : [string] >nameB = "name" : "name" >nameB : string >"name" : "name" ->["trimmer", ["trimming", "edging"]] : [string, string[]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >"trimmer" : "trimmer" ->["trimming", "edging"] : string[] +>["trimming", "edging"] : ("trimming" | "edging")[] >"trimming" : "trimming" >"edging" : "edging" >i = 0 : 0 @@ -499,7 +499,7 @@ for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = getRobot(), i = 0; i } for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0; i < 1; i++) { >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"], i = 0 : 0 ->[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >[numberA2 = -1, nameA2 = "name", skillA2 = "skill"] : [number, string, string] >numberA2 = -1 : -1 >numberA2 : number @@ -511,7 +511,7 @@ for ([numberA2 = -1, nameA2 = "name", skillA2 = "skill"] = [2, "trimmer", "trimm >skillA2 = "skill" : "skill" >skillA2 : string >"skill" : "skill" ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -546,7 +546,7 @@ for (let >"secondary" : "secondary" ] = ["none", "none"] ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" @@ -570,13 +570,13 @@ for (let for ([nameMA = "noName", >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot(), i = 0 : 0 >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = getMultiRobot() : [string, [string, string]] ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, ["none", "none"]] >nameMA = "noName" : "noName" >nameMA : string >"noName" : "noName" [ ->[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : ["none", "none"] >[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] primarySkillA = "primary", @@ -590,7 +590,7 @@ for ([nameMA = "noName", >"secondary" : "secondary" ] = ["none", "none"] ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" @@ -615,14 +615,14 @@ for ([nameMA = "noName", } for ([nameMA = "noName", >[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]], i = 0 : 0 ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, [string, string]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] = ["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"]] : [string, ["none", "none"]] >nameMA = "noName" : "noName" >nameMA : string >"noName" : "noName" [ ->[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary" ] = ["none", "none"] : ["none", "none"] >[ primarySkillA = "primary", secondarySkillA = "secondary" ] : [string, string] primarySkillA = "primary", @@ -636,14 +636,14 @@ for ([nameMA = "noName", >"secondary" : "secondary" ] = ["none", "none"] ->["none", "none"] : [string, string] +>["none", "none"] : ["none", "none"] >"none" : "none" >"none" : "none" ] = ["trimmer", ["trimming", "edging"]], i = 0; i < 1; i++) { ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" >i = 0 : 0 @@ -730,7 +730,7 @@ for ([numberA3 = -1, ...robotAInfo] = [2, "trimmer", "trimming"], i = 0; >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types index 3a78d92033bf1..3525983910bea 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern.types @@ -37,7 +37,7 @@ interface MultiRobot { let robot: Robot = { name: "mower", skill: "mowing" }; >robot : Robot >Robot : Robot ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string @@ -46,11 +46,11 @@ let robot: Robot = { name: "mower", skill: "mowing" }; let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string @@ -113,7 +113,7 @@ for (let {name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; >nameA : string >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -188,11 +188,11 @@ for (let { skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -265,7 +265,7 @@ for (let {name: nameA, skill: skillA } = { name: "trimmer", skill: "trimm >skillA : string >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -346,11 +346,11 @@ for (let {name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types index 49ae5c619440b..0e1cb9515d189 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPattern2.types @@ -37,7 +37,7 @@ interface MultiRobot { let robot: Robot = { name: "mower", skill: "mowing" }; >robot : Robot >Robot : Robot ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string @@ -46,11 +46,11 @@ let robot: Robot = { name: "mower", skill: "mowing" }; let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string @@ -137,7 +137,7 @@ for ({ name: nameA } = { name: "trimmer", skill: "trimming" }, i = 0; i < >nameA : string >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -227,11 +227,11 @@ for ({ skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -306,7 +306,7 @@ for ({ name } = { name: "trimmer", skill: "trimming" }, i = 0; i < 1; i++ >name : string >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -390,11 +390,11 @@ for ({ skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -480,7 +480,7 @@ for ({ name: nameA, skill: skillA } = { name: "trimmer", skill: "trimming >skillA : string >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -576,11 +576,11 @@ for ({ name: nameA, skills: { primary: primaryA, secondary: secondaryA } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -658,7 +658,7 @@ for ({ name, skill } = { name: "trimmer", skill: "trimming" }, i = 0; i < >skill : string >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -745,11 +745,11 @@ for ({ name, skills: { primary, secondary } } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types index 261ccd3639675..86fb67efe625a 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.types @@ -37,7 +37,7 @@ interface MultiRobot { let robot: Robot = { name: "mower", skill: "mowing" }; >robot : Robot >Robot : Robot ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string @@ -46,11 +46,11 @@ let robot: Robot = { name: "mower", skill: "mowing" }; let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string @@ -116,7 +116,7 @@ for (let {name: nameA = "noName" } = { name: "trimmer", skill: "trimming" >"noName" : "noName" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -151,7 +151,7 @@ for (let { >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -189,7 +189,7 @@ for (let { >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -228,7 +228,7 @@ for (let { >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -237,11 +237,11 @@ for (let { } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -320,7 +320,7 @@ for (let {name: nameA = "noName", skill: skillA = "skill" } = { name: "tr >"skill" : "skill" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -360,7 +360,7 @@ for (let { >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -403,7 +403,7 @@ for (let { >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -447,7 +447,7 @@ for (let { >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -456,11 +456,11 @@ for (let { } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types index c5f2c806def80..7b535bbe7775c 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.types @@ -37,7 +37,7 @@ interface MultiRobot { let robot: Robot = { name: "mower", skill: "mowing" }; >robot : Robot >Robot : Robot ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string @@ -46,11 +46,11 @@ let robot: Robot = { name: "mower", skill: "mowing" }; let multiRobot: MultiRobot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >multiRobot : MultiRobot >MultiRobot : MultiRobot ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string @@ -143,7 +143,7 @@ for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, >"noName" : "noName" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -167,11 +167,11 @@ for ({name: nameA = "noName" } = { name: "trimmer", skill: "trimming" }, for ({ >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: "none"; secondary?: "none"; }; } skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } primary: primaryA = "primary", @@ -187,7 +187,7 @@ for ({ >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -214,11 +214,11 @@ for ({ for ({ >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: "none"; secondary?: "none"; }; } skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } primary: primaryA = "primary", @@ -234,7 +234,7 @@ for ({ >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -262,11 +262,11 @@ for ({ for ({ >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: "none"; secondary?: "none"; }; } skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } primary: primaryA = "primary", @@ -282,7 +282,7 @@ for ({ >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -291,11 +291,11 @@ for ({ } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -371,7 +371,7 @@ for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; >name : string >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -395,11 +395,11 @@ for ({ name = "noName" } = { name: "trimmer", skill: "trimming" }, i = 0; for ({ >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: "none"; secondary?: "none"; }; } skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -409,7 +409,7 @@ for ({ >secondary : string } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -436,11 +436,11 @@ for ({ for ({ >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: "none"; secondary?: "none"; }; } skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -450,7 +450,7 @@ for ({ >secondary : string } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -478,11 +478,11 @@ for ({ for ({ >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { skills?: { primary?: "none"; secondary?: "none"; }; } skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -492,7 +492,7 @@ for ({ >secondary : string } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -501,11 +501,11 @@ for ({ } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -603,7 +603,7 @@ for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimme >"skill" : "skill" >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -627,7 +627,7 @@ for ({name: nameA = "noName", skill: skillA = "skill" } = { name: "trimme for ({ >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: "none"; secondary?: "none"; }; } name: nameA = "noName", >name : string @@ -636,8 +636,8 @@ for ({ >"noName" : "noName" skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } primary: primaryA = "primary", @@ -653,7 +653,7 @@ for ({ >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -680,7 +680,7 @@ for ({ for ({ >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: "none"; secondary?: "none"; }; } name: nameA = "noName", >name : string @@ -689,8 +689,8 @@ for ({ >"noName" : "noName" skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } primary: primaryA = "primary", @@ -706,7 +706,7 @@ for ({ >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -734,7 +734,7 @@ for ({ for ({ >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: "none"; secondary?: "none"; }; } name: nameA = "noName", >name : string @@ -743,8 +743,8 @@ for ({ >"noName" : "noName" skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } primary: primaryA = "primary", @@ -760,7 +760,7 @@ for ({ >"secondary" : "secondary" } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -769,11 +769,11 @@ for ({ } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -852,7 +852,7 @@ for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "tr >skill : string >{ name: "trimmer", skill: "trimming" } : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -876,14 +876,14 @@ for ({ name = "noName", skill = "skill" } = { name: "trimmer", skill: "tr for ({ >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot, i = 0 : 0 >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = multiRobot : MultiRobot ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: "none"; secondary?: "none"; }; } name = "noName", >name : string skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -893,7 +893,7 @@ for ({ >secondary : string } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -920,14 +920,14 @@ for ({ for ({ >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot(), i = 0 : 0 >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = getMultiRobot() : MultiRobot ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: "none"; secondary?: "none"; }; } name = "noName", >name : string skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -937,7 +937,7 @@ for ({ >secondary : string } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -965,14 +965,14 @@ for ({ for ({ >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, i = 0 : 0 >{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" }} : { name?: string; skills?: { primary?: "none"; secondary?: "none"; }; } name = "noName", >name : string skills: { ->skills : { primary?: string; secondary?: string; } ->{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>skills : { primary?: "none"; secondary?: "none"; } +>{ primary = "primary", secondary = "secondary" } = { primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -982,7 +982,7 @@ for ({ >secondary : string } = { primary: "none", secondary: "none" } ->{ primary: "none", secondary: "none" } : { primary?: string; secondary?: string; } +>{ primary: "none", secondary: "none" } : { primary?: "none"; secondary?: "none"; } >primary : string >"none" : "none" >secondary : string @@ -991,11 +991,11 @@ for ({ } = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }, >{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : MultiRobot >MultiRobot : MultiRobot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types index 41dc32d2648c6..fc69266957e01 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, [string, string]]; let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -23,7 +23,7 @@ let robotA: Robot = [1, "mower", "mowing"]; let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -44,18 +44,18 @@ function getRobots() { let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["mower", ["mowing", ""]] : [string, [string, string]] +>["mower", ["mowing", ""]] : ["mower", ["mowing", ""]] >"mower" : "mower" ->["mowing", ""] : [string, string] +>["mowing", ""] : ["mowing", ""] >"mowing" : "mowing" >"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types index abc08ee63d425..6862976fbf4ca 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPattern2.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, [string, string]]; let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -23,7 +23,7 @@ let robotA: Robot = [1, "mower", "mowing"]; let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -44,18 +44,18 @@ function getRobots() { let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["mower", ["mowing", ""]] : [string, [string, string]] +>["mower", ["mowing", ""]] : ["mower", ["mowing", ""]] >"mower" : "mower" ->["mowing", ""] : [string, string] +>["mowing", ""] : ["mowing", ""] >"mowing" : "mowing" >"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types index e82c981033e7d..ed7f3fa0aca5d 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, [string, string]]; let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -23,7 +23,7 @@ let robotA: Robot = [1, "mower", "mowing"]; let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -44,18 +44,18 @@ function getRobots() { let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["mower", ["mowing", ""]] : [string, [string, string]] +>["mower", ["mowing", ""]] : ["mower", ["mowing", ""]] >"mower" : "mower" ->["mowing", ""] : [string, string] +>["mowing", ""] : ["mowing", ""] >"mowing" : "mowing" >"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" @@ -126,7 +126,7 @@ for (let [, [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >multiRobots : [string, [string, string]][] @@ -150,7 +150,7 @@ for (let [, [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] @@ -175,7 +175,7 @@ for (let [, [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] @@ -339,7 +339,7 @@ for (let [nameMA = "noName", [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >multiRobots : [string, [string, string]][] @@ -364,7 +364,7 @@ for (let [nameMA = "noName", [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] @@ -390,7 +390,7 @@ for (let [nameMA = "noName", [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types index dad997dac4fe5..df4ee69281df7 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, [string, string]]; let robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -23,7 +23,7 @@ let robotA: Robot = [1, "mower", "mowing"]; let robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -44,18 +44,18 @@ function getRobots() { let multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["mower", ["mowing", ""]] : [string, [string, string]] +>["mower", ["mowing", ""]] : ["mower", ["mowing", ""]] >"mower" : "mower" ->["mowing", ""] : [string, string] +>["mowing", ""] : ["mowing", ""] >"mowing" : "mowing" >"" : "" let multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" @@ -141,9 +141,9 @@ for ([, nameA = "noName"] of [robotA, robotB]) { >nameA : string } for ([, [ ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [undefined, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [undefined, ["skill1", "skill2"]] > : undefined ->[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : ["skill1", "skill2"] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", @@ -157,7 +157,7 @@ for ([, [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >multiRobots : [string, [string, string]][] @@ -170,9 +170,9 @@ for ([, [ >primarySkillA : string } for ([, [ ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [undefined, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [undefined, ["skill1", "skill2"]] > : undefined ->[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : ["skill1", "skill2"] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", @@ -186,7 +186,7 @@ for ([, [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] @@ -200,9 +200,9 @@ for ([, [ >primarySkillA : string } for ([, [ ->[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [undefined, [string, string]] +>[, [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [undefined, ["skill1", "skill2"]] > : undefined ->[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : ["skill1", "skill2"] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", @@ -216,7 +216,7 @@ for ([, [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] @@ -392,11 +392,11 @@ for ([numberA2 = -1, nameA2 = "noName", skillA2 = "skill"] of [robotA, robotB]) >nameA2 : string } for ([nameMA = "noName", [ ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, [string, string]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, ["skill1", "skill2"]] >nameMA = "noName" : "noName" >nameMA : string >"noName" : "noName" ->[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : ["skill1", "skill2"] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", @@ -410,7 +410,7 @@ for ([nameMA = "noName", [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of multiRobots) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >multiRobots : [string, [string, string]][] @@ -423,11 +423,11 @@ for ([nameMA = "noName", [ >nameMA : string } for ([nameMA = "noName", [ ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, [string, string]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, ["skill1", "skill2"]] >nameMA = "noName" : "noName" >nameMA : string >"noName" : "noName" ->[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : ["skill1", "skill2"] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", @@ -441,7 +441,7 @@ for ([nameMA = "noName", [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of getMultiRobots()) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >getMultiRobots() : [string, [string, string]][] @@ -455,11 +455,11 @@ for ([nameMA = "noName", [ >nameMA : string } for ([nameMA = "noName", [ ->[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, [string, string]] +>[nameMA = "noName", [ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"]] : [string, ["skill1", "skill2"]] >nameMA = "noName" : "noName" >nameMA : string >"noName" : "noName" ->[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : [string, string] +>[ primarySkillA = "primary", secondarySkillA = "secondary"] = ["skill1", "skill2"] : ["skill1", "skill2"] >[ primarySkillA = "primary", secondarySkillA = "secondary"] : [string, string] primarySkillA = "primary", @@ -473,7 +473,7 @@ for ([nameMA = "noName", [ >"secondary" : "secondary" ] = ["skill1", "skill2"]] of [multiRobotA, multiRobotB]) { ->["skill1", "skill2"] : [string, string] +>["skill1", "skill2"] : ["skill1", "skill2"] >"skill1" : "skill1" >"skill2" : "skill2" >[multiRobotA, multiRobotB] : [string, [string, string]][] diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types index 26d570974df92..d69597ce8a95c 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern.types @@ -37,13 +37,13 @@ interface MultiRobot { let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; >robots : Robot[] >Robot : Robot ->[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : ({ name: "mower"; skill: "mowing"; } | { name: "trimmer"; skill: "trimming"; })[] +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string >"mowing" : "mowing" ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -52,23 +52,23 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] >MultiRobot : MultiRobot ->[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } | { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; })[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string >"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types index 64680d66001d9..59c4044edcc00 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPattern2.types @@ -37,13 +37,13 @@ interface MultiRobot { let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; >robots : Robot[] >Robot : Robot ->[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : ({ name: "mower"; skill: "mowing"; } | { name: "trimmer"; skill: "trimming"; })[] +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string >"mowing" : "mowing" ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -52,23 +52,23 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] >MultiRobot : MultiRobot ->[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } | { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; })[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string >"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types index d55ab46cbd28b..1e2dc5eef7503 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.types @@ -37,13 +37,13 @@ interface MultiRobot { let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; >robots : Robot[] >Robot : Robot ->[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : ({ name: "mower"; skill: "mowing"; } | { name: "trimmer"; skill: "trimming"; })[] +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string >"mowing" : "mowing" ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -52,23 +52,23 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] >MultiRobot : MultiRobot ->[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } | { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; })[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string >"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -148,7 +148,7 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { ->{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: "nosKill"; secondary?: "noSkill"; } >primary : string >"nosKill" : "nosKill" >secondary : string @@ -172,7 +172,7 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { ->{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: "nosKill"; secondary?: "noSkill"; } >primary : string >"nosKill" : "nosKill" >secondary : string @@ -197,7 +197,7 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec >"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of ->{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: "nosKill"; secondary?: "noSkill"; } >primary : string >"nosKill" : "nosKill" >secondary : string @@ -206,23 +206,23 @@ for (let { skills: { primary: primaryA = "primary", secondary: secondaryA = "sec [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] >MultiRobot : MultiRobot ->[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } | { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; })[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string >"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -315,7 +315,7 @@ for (let { >"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -351,7 +351,7 @@ for (let { >"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -388,7 +388,7 @@ for (let { >"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -397,23 +397,23 @@ for (let { } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] >MultiRobot : MultiRobot ->[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } | { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; })[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string >"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types index 6119665124d2d..56d0f5b6735c1 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.types @@ -37,13 +37,13 @@ interface MultiRobot { let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }]; >robots : Robot[] >Robot : Robot ->[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : { name: string; skill: string; }[] ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>[{ name: "mower", skill: "mowing" }, { name: "trimmer", skill: "trimming" }] : ({ name: "mower"; skill: "mowing"; } | { name: "trimmer"; skill: "trimming"; })[] +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string >"mowing" : "mowing" ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -52,23 +52,23 @@ let robots: Robot[] = [{ name: "mower", skill: "mowing" }, { name: "trimmer", sk let multiRobots: MultiRobot[] = [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >multiRobots : MultiRobot[] >MultiRobot : MultiRobot ->[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } | { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; })[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string >"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]; ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -158,9 +158,9 @@ for ({name: nameA = "noName" } of [{ name: "mower", skill: "mowing" }, { name: " >nameA : string } for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills?: { primary?: "nosKill"; secondary?: "noSkill"; }; } >skills : MultiRobot ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: "nosKill"; secondary?: "noSkill"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } >primary : string >primaryA = "primary" : "primary" @@ -172,7 +172,7 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of multiRobots) { ->{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: "nosKill"; secondary?: "noSkill"; } >primary : string >"nosKill" : "nosKill" >secondary : string @@ -187,9 +187,9 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >primaryA : string } for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills?: { primary?: "nosKill"; secondary?: "noSkill"; }; } >skills : MultiRobot ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: "nosKill"; secondary?: "noSkill"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } >primary : string >primaryA = "primary" : "primary" @@ -201,7 +201,7 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of getMultiRobots()) { ->{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: "nosKill"; secondary?: "noSkill"; } >primary : string >"nosKill" : "nosKill" >secondary : string @@ -217,9 +217,9 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >primaryA : string } for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = ->{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } } : { skills?: { primary?: "nosKill"; secondary?: "noSkill"; }; } >skills : MultiRobot ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "nosKill", secondary: "noSkill" } : { primary?: "nosKill"; secondary?: "noSkill"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } >primary : string >primaryA = "primary" : "primary" @@ -231,7 +231,7 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda >"secondary" : "secondary" { primary: "nosKill", secondary: "noSkill" } } of ->{ primary: "nosKill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "nosKill", secondary: "noSkill" } : { primary?: "nosKill"; secondary?: "noSkill"; } >primary : string >"nosKill" : "nosKill" >secondary : string @@ -240,23 +240,23 @@ for ({ skills: { primary: primaryA = "primary", secondary: secondaryA = "seconda [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] >MultiRobot : MultiRobot ->[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } | { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; })[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string >"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -318,11 +318,11 @@ for ({ name = "noName" } of [{ name: "mower", skill: "mowing" }, { name: "trimme >nameA : string } for ({ ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills?: { primary?: "noSkill"; secondary?: "noSkill"; }; } skills: { >skills : MultiRobot ->{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -332,7 +332,7 @@ for ({ >secondary : string } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -349,11 +349,11 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills?: { primary?: "noSkill"; secondary?: "noSkill"; }; } skills: { >skills : MultiRobot ->{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -363,7 +363,7 @@ for ({ >secondary : string } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -381,11 +381,11 @@ for ({ >primaryA : string } for ({ ->{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills?: { primary?: string; secondary?: string; }; } +>{ skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { skills?: { primary?: "noSkill"; secondary?: "noSkill"; }; } skills: { >skills : { name: string; skills: { primary: string; secondary: string; }; } ->{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -395,7 +395,7 @@ for ({ >secondary : string } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -502,7 +502,7 @@ for ({name: nameA = "noName", skill: skillA = "noSkill" } of [{ name: "mower", >nameA : string } for ({ ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: "noSkill"; secondary?: "noSkill"; }; } name: nameA = "noName", >name : MultiRobot @@ -512,7 +512,7 @@ for ({ skills: { >skills : MultiRobot ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } primary: primaryA = "primary", @@ -528,7 +528,7 @@ for ({ >"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -545,7 +545,7 @@ for ({ >nameA : string } for ({ ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: "noSkill"; secondary?: "noSkill"; }; } name: nameA = "noName", >name : MultiRobot @@ -555,7 +555,7 @@ for ({ skills: { >skills : MultiRobot ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } primary: primaryA = "primary", @@ -571,7 +571,7 @@ for ({ >"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -589,7 +589,7 @@ for ({ >nameA : string } for ({ ->{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name: nameA = "noName", skills: { primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: "noSkill"; secondary?: "noSkill"; }; } name: nameA = "noName", >name : MultiRobot @@ -599,7 +599,7 @@ for ({ skills: { >skills : MultiRobot ->{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >{ primary: primaryA = "primary", secondary: secondaryA = "secondary" } : { primary?: string; secondary?: string; } primary: primaryA = "primary", @@ -615,7 +615,7 @@ for ({ >"secondary" : "secondary" } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -624,23 +624,23 @@ for ({ } of [{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, >[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : MultiRobot[] >MultiRobot : MultiRobot ->[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : { name: string; skills: { primary: string; secondary: string; }; }[] ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>[{ name: "mower", skills: { primary: "mowing", secondary: "none" } }, { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }] : ({ name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } | { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; })[] +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string >"none" : "none" { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }]) { ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -705,14 +705,14 @@ for ({ name = "noName", skill = "noSkill" } of [{ name: "mower", skill: "mowing >nameA : string } for ({ ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: "noSkill"; secondary?: "noSkill"; }; } name = "noName", >name : MultiRobot skills: { >skills : MultiRobot ->{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -722,7 +722,7 @@ for ({ >secondary : string } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -739,14 +739,14 @@ for ({ >nameA : string } for ({ ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: "noSkill"; secondary?: "noSkill"; }; } name = "noName", >name : MultiRobot skills: { >skills : MultiRobot ->{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -756,7 +756,7 @@ for ({ >secondary : string } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -774,14 +774,14 @@ for ({ >nameA : string } for ({ ->{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: string; secondary?: string; }; } +>{ name = "noName", skills: { primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" }} : { name?: string; skills?: { primary?: "noSkill"; secondary?: "noSkill"; }; } name = "noName", >name : { name: string; skills: { primary: string; secondary: string; }; } skills: { >skills : { name: string; skills: { primary: string; secondary: string; }; } ->{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary = "primary", secondary = "secondary" } = { primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >{ primary = "primary", secondary = "secondary" } : { primary?: string; secondary?: string; } primary = "primary", @@ -791,7 +791,7 @@ for ({ >secondary : string } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types index bbd13dddf5741..6761acaf31809 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.types @@ -26,11 +26,11 @@ interface Robot { var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >robotA : Robot >Robot : Robot ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string @@ -93,11 +93,11 @@ foo1(robotA); foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void >foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }: Robot) => void ->{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: "Edger"; skills: { primary: "edging"; secondary: "branch trimming"; }; } >name : string >"Edger" : "Edger" ->skills : { primary: string; secondary: string; } ->{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>skills : { primary: "edging"; secondary: "branch trimming"; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: "edging"; secondary: "branch trimming"; } >primary : string >"edging" : "edging" >secondary : string @@ -111,11 +111,11 @@ foo2(robotA); foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void >foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }: Robot) => void ->{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: "Edger"; skills: { primary: "edging"; secondary: "branch trimming"; }; } >name : string >"Edger" : "Edger" ->skills : { primary: string; secondary: string; } ->{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>skills : { primary: "edging"; secondary: "branch trimming"; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: "edging"; secondary: "branch trimming"; } >primary : string >"edging" : "edging" >secondary : string @@ -129,11 +129,11 @@ foo3(robotA); foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void >foo3 : ({ skills }: Robot) => void ->{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: "Edger"; skills: { primary: "edging"; secondary: "branch trimming"; }; } >name : string >"Edger" : "Edger" ->skills : { primary: string; secondary: string; } ->{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>skills : { primary: "edging"; secondary: "branch trimming"; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: "edging"; secondary: "branch trimming"; } >primary : string >"edging" : "edging" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types index d9c8b3197523e..913b71a98f000 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.types @@ -26,11 +26,11 @@ interface Robot { var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >robotA : Robot >Robot : Robot ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string @@ -53,7 +53,7 @@ function foo1( >"secondary" : "secondary" } = { primary: "SomeSkill", secondary: "someSkill" } ->{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: "SomeSkill"; secondary?: "someSkill"; } >primary : string >"SomeSkill" : "SomeSkill" >secondary : string @@ -92,7 +92,7 @@ function foo2( >"secondary" : "secondary" } = { primary: "SomeSkill", secondary: "someSkill" } ->{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: string; secondary?: string; } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary?: "SomeSkill"; secondary?: "someSkill"; } >primary : string >"SomeSkill" : "SomeSkill" >secondary : string @@ -112,7 +112,7 @@ function foo2( function foo3({ skills = { primary: "SomeSkill", secondary: "someSkill" } }: Robot = robotA) { >foo3 : ({ skills }?: Robot) => void >skills : { primary?: string; secondary?: string; } ->{ primary: "SomeSkill", secondary: "someSkill" } : { primary: string; secondary: string; } +>{ primary: "SomeSkill", secondary: "someSkill" } : { primary: "SomeSkill"; secondary: "someSkill"; } >primary : string >"SomeSkill" : "SomeSkill" >secondary : string @@ -138,11 +138,11 @@ foo1(robotA); foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo1({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void >foo1 : ({ skills: { primary: primaryA, secondary: secondaryA } }?: Robot) => void ->{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: "Edger"; skills: { primary: "edging"; secondary: "branch trimming"; }; } >name : string >"Edger" : "Edger" ->skills : { primary: string; secondary: string; } ->{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>skills : { primary: "edging"; secondary: "branch trimming"; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: "edging"; secondary: "branch trimming"; } >primary : string >"edging" : "edging" >secondary : string @@ -156,11 +156,11 @@ foo2(robotA); foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo2({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void >foo2 : ({ name: nameC, skills: { primary: primaryB, secondary: secondaryB } }?: Robot) => void ->{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: "Edger"; skills: { primary: "edging"; secondary: "branch trimming"; }; } >name : string >"Edger" : "Edger" ->skills : { primary: string; secondary: string; } ->{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>skills : { primary: "edging"; secondary: "branch trimming"; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: "edging"; secondary: "branch trimming"; } >primary : string >"edging" : "edging" >secondary : string @@ -174,11 +174,11 @@ foo3(robotA); foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }); >foo3({ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }) : void >foo3 : ({ skills }?: Robot) => void ->{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: "Edger"; skills: { primary: "edging"; secondary: "branch trimming"; }; } >name : string >"Edger" : "Edger" ->skills : { primary: string; secondary: string; } ->{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>skills : { primary: "edging"; secondary: "branch trimming"; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: "edging"; secondary: "branch trimming"; } >primary : string >"edging" : "edging" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types index 5185ab359945f..255fa6459f4a3 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPattern.types @@ -22,7 +22,7 @@ var hello = "hello"; var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string @@ -77,7 +77,7 @@ foo1(robotA); foo1({ name: "Edger", skill: "cutting edges" }); >foo1({ name: "Edger", skill: "cutting edges" }) : void >foo1 : ({ name: nameA }: Robot) => void ->{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>{ name: "Edger", skill: "cutting edges" } : { name: "Edger"; skill: "cutting edges"; } >name : string >"Edger" : "Edger" >skill : string @@ -91,7 +91,7 @@ foo2(robotA); foo2({ name: "Edger", skill: "cutting edges" }); >foo2({ name: "Edger", skill: "cutting edges" }) : void >foo2 : ({ name: nameB, skill: skillB }: Robot) => void ->{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>{ name: "Edger", skill: "cutting edges" } : { name: "Edger"; skill: "cutting edges"; } >name : string >"Edger" : "Edger" >skill : string @@ -105,7 +105,7 @@ foo3(robotA); foo3({ name: "Edger", skill: "cutting edges" }); >foo3({ name: "Edger", skill: "cutting edges" }) : void >foo3 : ({ name }: Robot) => void ->{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>{ name: "Edger", skill: "cutting edges" } : { name: "Edger"; skill: "cutting edges"; } >name : string >"Edger" : "Edger" >skill : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types index ca6670e556115..f325799abec61 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.types @@ -22,7 +22,7 @@ var hello = "hello"; var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string @@ -84,7 +84,7 @@ foo1(robotA); foo1({ name: "Edger", skill: "cutting edges" }); >foo1({ name: "Edger", skill: "cutting edges" }) : void >foo1 : ({ name: nameA }?: Robot) => void ->{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>{ name: "Edger", skill: "cutting edges" } : { name: "Edger"; skill: "cutting edges"; } >name : string >"Edger" : "Edger" >skill : string @@ -98,7 +98,7 @@ foo2(robotA); foo2({ name: "Edger", skill: "cutting edges" }); >foo2({ name: "Edger", skill: "cutting edges" }) : void >foo2 : ({ name: nameB, skill: skillB }?: Robot) => void ->{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>{ name: "Edger", skill: "cutting edges" } : { name: "Edger"; skill: "cutting edges"; } >name : string >"Edger" : "Edger" >skill : string @@ -112,7 +112,7 @@ foo3(robotA); foo3({ name: "Edger", skill: "cutting edges" }); >foo3({ name: "Edger", skill: "cutting edges" }) : void >foo3 : ({ name }?: Robot) => void ->{ name: "Edger", skill: "cutting edges" } : { name: string; skill: string; } +>{ name: "Edger", skill: "cutting edges" } : { name: "Edger"; skill: "cutting edges"; } >name : string >"Edger" : "Edger" >skill : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types index d7aed64a23282..df75701289c00 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern.types @@ -12,7 +12,7 @@ type Robot = [number, string, string]; var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -81,7 +81,7 @@ foo1(robotA); foo1([2, "trimmer", "trimming"]); >foo1([2, "trimmer", "trimming"]) : void >foo1 : ([, nameA]: [number, string, string]) => void ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -94,7 +94,7 @@ foo2(robotA); foo2([2, "trimmer", "trimming"]); >foo2([2, "trimmer", "trimming"]) : void >foo2 : ([numberB]: [number, string, string]) => void ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -107,7 +107,7 @@ foo3(robotA); foo3([2, "trimmer", "trimming"]); >foo3([2, "trimmer", "trimming"]) : void >foo3 : ([numberA2, nameA2, skillA2]: [number, string, string]) => void ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -120,7 +120,7 @@ foo4(robotA); foo4([2, "trimmer", "trimming"]); >foo4([2, "trimmer", "trimming"]) : void >foo4 : ([numberA3, ...robotAInfo]: [number, string, string]) => void ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types index 00809184d3b30..60038aaf6e806 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPattern2.types @@ -12,9 +12,9 @@ type Robot = [string, [string, string]]; var robotA: Robot = ["trimmer", ["trimming", "edging"]]; >robotA : [string, [string, string]] >Robot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" @@ -81,9 +81,9 @@ foo1(robotA); foo1(["roomba", ["vaccum", "mopping"]]); >foo1(["roomba", ["vaccum", "mopping"]]) : void >foo1 : ([, skillA]: [string, [string, string]]) => void ->["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>["roomba", ["vaccum", "mopping"]] : ["roomba", ["vaccum", "mopping"]] >"roomba" : "roomba" ->["vaccum", "mopping"] : [string, string] +>["vaccum", "mopping"] : ["vaccum", "mopping"] >"vaccum" : "vaccum" >"mopping" : "mopping" @@ -95,9 +95,9 @@ foo2(robotA); foo2(["roomba", ["vaccum", "mopping"]]); >foo2(["roomba", ["vaccum", "mopping"]]) : void >foo2 : ([nameMB]: [string, [string, string]]) => void ->["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>["roomba", ["vaccum", "mopping"]] : ["roomba", ["vaccum", "mopping"]] >"roomba" : "roomba" ->["vaccum", "mopping"] : [string, string] +>["vaccum", "mopping"] : ["vaccum", "mopping"] >"vaccum" : "vaccum" >"mopping" : "mopping" @@ -109,9 +109,9 @@ foo3(robotA); foo3(["roomba", ["vaccum", "mopping"]]); >foo3(["roomba", ["vaccum", "mopping"]]) : void >foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, [string, string]]) => void ->["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>["roomba", ["vaccum", "mopping"]] : ["roomba", ["vaccum", "mopping"]] >"roomba" : "roomba" ->["vaccum", "mopping"] : [string, string] +>["vaccum", "mopping"] : ["vaccum", "mopping"] >"vaccum" : "vaccum" >"mopping" : "mopping" @@ -123,9 +123,9 @@ foo4(robotA); foo4(["roomba", ["vaccum", "mopping"]]); >foo4(["roomba", ["vaccum", "mopping"]]) : void >foo4 : ([...multiRobotAInfo]: [string, [string, string]]) => void ->["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>["roomba", ["vaccum", "mopping"]] : ["roomba", ["vaccum", "mopping"]] >"roomba" : "roomba" ->["vaccum", "mopping"] : [string, string] +>["vaccum", "mopping"] : ["vaccum", "mopping"] >"vaccum" : "vaccum" >"mopping" : "mopping" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types index a9d1013c136cf..4832012ad1551 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.types @@ -12,7 +12,7 @@ type Robot = [number, string, string]; var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -23,7 +23,7 @@ function foo1([, nameA = "noName"]: Robot = [-1, "name", "skill"]) { >nameA : string >"noName" : "noName" >Robot : [number, string, string] ->[-1, "name", "skill"] : [number, string, string] +>[-1, "name", "skill"] : [-1, "name", "skill"] >-1 : -1 >1 : 1 >"name" : "name" @@ -43,7 +43,7 @@ function foo2([numberB = -1]: Robot = [-1, "name", "skill"]) { >-1 : -1 >1 : 1 >Robot : [number, string, string] ->[-1, "name", "skill"] : [number, string, string] +>[-1, "name", "skill"] : [-1, "name", "skill"] >-1 : -1 >1 : 1 >"name" : "name" @@ -67,7 +67,7 @@ function foo3([numberA2 = -1, nameA2 = "name", skillA2 = "skill"]: Robot = [-1, >skillA2 : string >"skill" : "skill" >Robot : [number, string, string] ->[-1, "name", "skill"] : [number, string, string] +>[-1, "name", "skill"] : [-1, "name", "skill"] >-1 : -1 >1 : 1 >"name" : "name" @@ -88,7 +88,7 @@ function foo4([numberA3 = -1, ...robotAInfo]: Robot = [-1, "name", "skill"]) { >1 : 1 >robotAInfo : (string | number)[] >Robot : [number, string, string] ->[-1, "name", "skill"] : [number, string, string] +>[-1, "name", "skill"] : [-1, "name", "skill"] >-1 : -1 >1 : 1 >"name" : "name" @@ -110,7 +110,7 @@ foo1(robotA); foo1([2, "trimmer", "trimming"]); >foo1([2, "trimmer", "trimming"]) : void >foo1 : ([, nameA]?: [number, string, string]) => void ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -123,7 +123,7 @@ foo2(robotA); foo2([2, "trimmer", "trimming"]); >foo2([2, "trimmer", "trimming"]) : void >foo2 : ([numberB]?: [number, string, string]) => void ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -136,7 +136,7 @@ foo3(robotA); foo3([2, "trimmer", "trimming"]); >foo3([2, "trimmer", "trimming"]) : void >foo3 : ([numberA2, nameA2, skillA2]?: [number, string, string]) => void ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -149,7 +149,7 @@ foo4(robotA); foo4([2, "trimmer", "trimming"]); >foo4([2, "trimmer", "trimming"]) : void >foo4 : ([numberA3, ...robotAInfo]?: [number, string, string]) => void ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types index b3569bb58b7d1..7857fd2762c85 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.types @@ -12,9 +12,9 @@ type Robot = [string, string[]]; var robotA: Robot = ["trimmer", ["trimming", "edging"]]; >robotA : [string, string[]] >Robot : [string, string[]] ->["trimmer", ["trimming", "edging"]] : [string, string[]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >"trimmer" : "trimmer" ->["trimming", "edging"] : string[] +>["trimming", "edging"] : ("trimming" | "edging")[] >"trimming" : "trimming" >"edging" : "edging" @@ -26,9 +26,9 @@ function foo1([, skillA = ["noSkill", "noSkill"]]: Robot= ["name", ["skill1", "s >"noSkill" : "noSkill" >"noSkill" : "noSkill" >Robot : [string, string[]] ->["name", ["skill1", "skill2"]] : [string, string[]] +>["name", ["skill1", "skill2"]] : ["name", ("skill1" | "skill2")[]] >"name" : "name" ->["skill1", "skill2"] : string[] +>["skill1", "skill2"] : ("skill1" | "skill2")[] >"skill1" : "skill1" >"skill2" : "skill2" @@ -45,9 +45,9 @@ function foo2([nameMB = "noName"]: Robot = ["name", ["skill1", "skill2"]]) { >nameMB : string >"noName" : "noName" >Robot : [string, string[]] ->["name", ["skill1", "skill2"]] : [string, string[]] +>["name", ["skill1", "skill2"]] : ["name", ("skill1" | "skill2")[]] >"name" : "name" ->["skill1", "skill2"] : string[] +>["skill1", "skill2"] : ("skill1" | "skill2")[] >"skill1" : "skill1" >"skill2" : "skill2" @@ -73,7 +73,7 @@ function foo3([nameMA = "noName", [ >"secondary" : "secondary" ] = ["noSkill", "noSkill"]]: Robot) { ->["noSkill", "noSkill"] : [string, string] +>["noSkill", "noSkill"] : ["noSkill", "noSkill"] >"noSkill" : "noSkill" >"noSkill" : "noSkill" >Robot : [string, string[]] @@ -94,9 +94,9 @@ foo1(robotA); foo1(["roomba", ["vaccum", "mopping"]]); >foo1(["roomba", ["vaccum", "mopping"]]) : void >foo1 : ([, skillA]?: [string, string[]]) => void ->["roomba", ["vaccum", "mopping"]] : [string, string[]] +>["roomba", ["vaccum", "mopping"]] : ["roomba", ("vaccum" | "mopping")[]] >"roomba" : "roomba" ->["vaccum", "mopping"] : string[] +>["vaccum", "mopping"] : ("vaccum" | "mopping")[] >"vaccum" : "vaccum" >"mopping" : "mopping" @@ -108,9 +108,9 @@ foo2(robotA); foo2(["roomba", ["vaccum", "mopping"]]); >foo2(["roomba", ["vaccum", "mopping"]]) : void >foo2 : ([nameMB]?: [string, string[]]) => void ->["roomba", ["vaccum", "mopping"]] : [string, string[]] +>["roomba", ["vaccum", "mopping"]] : ["roomba", ("vaccum" | "mopping")[]] >"roomba" : "roomba" ->["vaccum", "mopping"] : string[] +>["vaccum", "mopping"] : ("vaccum" | "mopping")[] >"vaccum" : "vaccum" >"mopping" : "mopping" @@ -122,9 +122,9 @@ foo3(robotA); foo3(["roomba", ["vaccum", "mopping"]]); >foo3(["roomba", ["vaccum", "mopping"]]) : void >foo3 : ([nameMA, [primarySkillA, secondarySkillA]]: [string, string[]]) => void ->["roomba", ["vaccum", "mopping"]] : [string, string[]] +>["roomba", ["vaccum", "mopping"]] : ["roomba", ("vaccum" | "mopping")[]] >"roomba" : "roomba" ->["vaccum", "mopping"] : string[] +>["vaccum", "mopping"] : ("vaccum" | "mopping")[] >"vaccum" : "vaccum" >"mopping" : "mopping" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types index 5d61294b5684b..bde7b8b24b9b6 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement.types @@ -22,7 +22,7 @@ var hello = "hello"; var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string @@ -31,7 +31,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" }; var robotB: Robot = { name: "trimmer", skill: "trimming" }; >robotB : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types index 9ed1df0f533ba..730f8f1a7078a 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatement1.types @@ -22,7 +22,7 @@ var hello = "hello"; var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string @@ -31,7 +31,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" }; var robotB: Robot = { name: "trimmer", skill: "trimming" }; >robotB : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types index 46bdfec4b06b2..cb97d1be7f9f5 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.types @@ -12,7 +12,7 @@ type Robot = [number, string, string]; var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -20,7 +20,7 @@ var robotA: Robot = [1, "mower", "mowing"]; var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types index 99f280985b553..3e50bd95e6723 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.types @@ -12,18 +12,18 @@ type MultiSkilledRobot = [string, [string, string]]; var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["mower", ["mowing", ""]] : [string, [string, string]] +>["mower", ["mowing", ""]] : ["mower", ["mowing", ""]] >"mower" : "mower" ->["mowing", ""] : [string, string] +>["mowing", ""] : ["mowing", ""] >"mowing" : "mowing" >"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types index bdd2059b863e8..996d6735f4bed 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, [string, string]]; var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -23,7 +23,7 @@ var robotA: Robot = [1, "mower", "mowing"]; var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -31,18 +31,18 @@ var robotB: Robot = [2, "trimmer", "trimming"]; var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["mower", ["mowing", ""]] : [string, [string, string]] +>["mower", ["mowing", ""]] : ["mower", ["mowing", ""]] >"mower" : "mower" ->["mowing", ""] : [string, string] +>["mowing", ""] : ["mowing", ""] >"mowing" : "mowing" >"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, [string, string]] >MultiSkilledRobot : [string, [string, string]] ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" @@ -80,11 +80,11 @@ let multiRobotAInfo: (string | [string, string])[]; >getRobotB : () => [number, string, string] [, nameB] = [2, "trimmer", "trimming"]; ->[, nameB] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameB] = [2, "trimmer", "trimming"] : [number, "trimmer", "trimming"] >[, nameB] : [undefined, string] > : undefined >nameB : string ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [number, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -105,13 +105,13 @@ let multiRobotAInfo: (string | [string, string])[]; >getMultiRobotB : () => [string, [string, string]] [, multiSkillB] = ["roomba", ["vaccum", "mopping"]]; ->[, multiSkillB] = ["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>[, multiSkillB] = ["roomba", ["vaccum", "mopping"]] : [string, ["vaccum", "mopping"]] >[, multiSkillB] : [undefined, [string, string]] > : undefined >multiSkillB : [string, string] ->["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>["roomba", ["vaccum", "mopping"]] : [string, ["vaccum", "mopping"]] >"roomba" : "roomba" ->["vaccum", "mopping"] : [string, string] +>["vaccum", "mopping"] : ["vaccum", "mopping"] >"vaccum" : "vaccum" >"mopping" : "mopping" @@ -129,10 +129,10 @@ let multiRobotAInfo: (string | [string, string])[]; >getRobotB : () => [number, string, string] [numberB] = [2, "trimmer", "trimming"]; ->[numberB] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB] = [2, "trimmer", "trimming"] : [2, string, string] >[numberB] : [number] >numberB : number ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, string, string] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -151,12 +151,12 @@ let multiRobotAInfo: (string | [string, string])[]; >getMultiRobotB : () => [string, [string, string]] [nameMB] = ["trimmer", ["trimming", "edging"]]; ->[nameMB] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameMB] = ["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >[nameMB] : [string] >nameMB : string ->["trimmer", ["trimming", "edging"]] : [string, string[]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >"trimmer" : "trimmer" ->["trimming", "edging"] : string[] +>["trimming", "edging"] : ("trimming" | "edging")[] >"trimming" : "trimming" >"edging" : "edging" @@ -178,12 +178,12 @@ let multiRobotAInfo: (string | [string, string])[]; >getRobotB : () => [number, string, string] [numberB, nameB, skillB] = [2, "trimmer", "trimming"]; ->[numberB, nameB, skillB] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB, nameB, skillB] = [2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >[numberB, nameB, skillB] : [number, string, string] >numberB : number >nameB : string >skillB : string ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -208,15 +208,15 @@ let multiRobotAInfo: (string | [string, string])[]; >getMultiRobotB : () => [string, [string, string]] [nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]]; ->[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMB, [primarySkillB, secondarySkillB]] = ["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >[nameMB, [primarySkillB, secondarySkillB]] : [string, [string, string]] >nameMB : string >[primarySkillB, secondarySkillB] : [string, string] >primarySkillB : string >secondarySkillB : string ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" @@ -245,7 +245,7 @@ let multiRobotAInfo: (string | [string, string])[]; >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -266,13 +266,13 @@ let multiRobotAInfo: (string | [string, string])[]; >getMultiRobotB : () => [string, [string, string]] [...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]]; ->[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] : (string | [string, string])[] +>[...multiRobotAInfo] = ["trimmer", ["trimming", "edging"]] : ("trimmer" | ["trimming", "edging"])[] >[...multiRobotAInfo] : (string | [string, string])[] >...multiRobotAInfo : string | [string, string] >multiRobotAInfo : (string | [string, string])[] ->["trimmer", ["trimming", "edging"]] : (string | [string, string])[] +>["trimmer", ["trimming", "edging"]] : ("trimmer" | ["trimming", "edging"])[] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types index 61b32753bf705..4fa23442723fb 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern6.types @@ -2,7 +2,7 @@ var [x = 20] = [1, 2]; >x : number >20 : 20 ->[1, 2] : [number, number] +>[1, 2] : [1, 2] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types index 6b6e6c2c7221f..71a027d25e7b2 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPattern7.types @@ -3,7 +3,7 @@ var [x = 20, j] = [1, 2]; >x : number >20 : 20 >j : number ->[1, 2] : [number, number] +>[1, 2] : [1, number] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types index fae55a6cabfef..a335f8e2f9739 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.types @@ -12,7 +12,7 @@ type Robot = [number, string, string]; var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -20,7 +20,7 @@ var robotA: Robot = [1, "mower", "mowing"]; var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -51,7 +51,7 @@ let [numberC2 = -1] = [3, "edging", "Trimming edges"]; >numberC2 : number >-1 : -1 >1 : 1 ->[3, "edging", "Trimming edges"] : [number, string, string] +>[3, "edging", "Trimming edges"] : [3, string, string] >3 : 3 >"edging" : "edging" >"Trimming edges" : "Trimming edges" @@ -64,7 +64,7 @@ let [numberC = -1, nameC = "noName", skillC = "noSkill"] = [3, "edging", "Trimmi >"noName" : "noName" >skillC : string >"noSkill" : "noSkill" ->[3, "edging", "Trimming edges"] : [number, string, string] +>[3, "edging", "Trimming edges"] : [3, "edging", "Trimming edges"] >3 : 3 >"edging" : "edging" >"Trimming edges" : "Trimming edges" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types index 21d75479c6dd8..318bea9052121 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.types @@ -12,18 +12,18 @@ type MultiSkilledRobot = [string, string[]]; var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, string[]] >MultiSkilledRobot : [string, string[]] ->["mower", ["mowing", ""]] : [string, string[]] +>["mower", ["mowing", ""]] : ["mower", ("mowing" | "")[]] >"mower" : "mower" ->["mowing", ""] : string[] +>["mowing", ""] : ("mowing" | "")[] >"mowing" : "mowing" >"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, string[]] >MultiSkilledRobot : [string, string[]] ->["trimmer", ["trimming", "edging"]] : [string, string[]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >"trimmer" : "trimmer" ->["trimming", "edging"] : string[] +>["trimming", "edging"] : ("trimming" | "edging")[] >"trimming" : "trimming" >"edging" : "edging" @@ -47,7 +47,7 @@ let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] >"noSkill" : "noSkill" >secondarySkillA : string >"noSkill" : "noSkill" ->["noSkill", "noSkill"] : [string, string] +>["noSkill", "noSkill"] : ["noSkill", "noSkill"] >"noSkill" : "noSkill" >"noSkill" : "noSkill" >multiRobotA : [string, string[]] @@ -55,9 +55,9 @@ let [nameMA = "noName", [primarySkillA = "noSkill", secondarySkillA = "noSkill"] let [nameMC = "noName" ] = ["roomba", ["vaccum", "mopping"]]; >nameMC : string >"noName" : "noName" ->["roomba", ["vaccum", "mopping"]] : [string, string[]] +>["roomba", ["vaccum", "mopping"]] : ["roomba", ("vaccum" | "mopping")[]] >"roomba" : "roomba" ->["vaccum", "mopping"] : string[] +>["vaccum", "mopping"] : ("vaccum" | "mopping")[] >"vaccum" : "vaccum" >"mopping" : "mopping" @@ -68,12 +68,12 @@ let [nameMC2 = "noName", [primarySkillC = "noSkill", secondarySkillC = "noSkill" >"noSkill" : "noSkill" >secondarySkillC : string >"noSkill" : "noSkill" ->["noSkill", "noSkill"] : [string, string] +>["noSkill", "noSkill"] : ["noSkill", "noSkill"] >"noSkill" : "noSkill" >"noSkill" : "noSkill" ->["roomba", ["vaccum", "mopping"]] : [string, [string, string]] +>["roomba", ["vaccum", "mopping"]] : ["roomba", ["vaccum", "mopping"]] >"roomba" : "roomba" ->["vaccum", "mopping"] : [string, string] +>["vaccum", "mopping"] : ["vaccum", "mopping"] >"vaccum" : "vaccum" >"mopping" : "mopping" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types index 35c458f431066..fb59235b14221 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types @@ -15,7 +15,7 @@ type MultiSkilledRobot = [string, string[]]; var robotA: Robot = [1, "mower", "mowing"]; >robotA : [number, string, string] >Robot : [number, string, string] ->[1, "mower", "mowing"] : [number, string, string] +>[1, "mower", "mowing"] : [1, "mower", "mowing"] >1 : 1 >"mower" : "mower" >"mowing" : "mowing" @@ -23,7 +23,7 @@ var robotA: Robot = [1, "mower", "mowing"]; var robotB: Robot = [2, "trimmer", "trimming"]; >robotB : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -31,18 +31,18 @@ var robotB: Robot = [2, "trimmer", "trimming"]; var multiRobotA: MultiSkilledRobot = ["mower", ["mowing", ""]]; >multiRobotA : [string, string[]] >MultiSkilledRobot : [string, string[]] ->["mower", ["mowing", ""]] : [string, string[]] +>["mower", ["mowing", ""]] : ["mower", ("mowing" | "")[]] >"mower" : "mower" ->["mowing", ""] : string[] +>["mowing", ""] : ("mowing" | "")[] >"mowing" : "mowing" >"" : "" var multiRobotB: MultiSkilledRobot = ["trimmer", ["trimming", "edging"]]; >multiRobotB : [string, string[]] >MultiSkilledRobot : [string, string[]] ->["trimmer", ["trimming", "edging"]] : [string, string[]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >"trimmer" : "trimmer" ->["trimming", "edging"] : string[] +>["trimming", "edging"] : ("trimming" | "edging")[] >"trimming" : "trimming" >"edging" : "edging" @@ -84,13 +84,13 @@ let multiRobotAInfo: (string | string[])[]; >getRobotB : () => [number, string, string] [, nameB = "helloNoName"] = [2, "trimmer", "trimming"]; ->[, nameB = "helloNoName"] = [2, "trimmer", "trimming"] : [number, string, string] +>[, nameB = "helloNoName"] = [2, "trimmer", "trimming"] : [number, "trimmer", "trimming"] >[, nameB = "helloNoName"] : [undefined, string] > : undefined >nameB = "helloNoName" : "helloNoName" >nameB : string >"helloNoName" : "helloNoName" ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [number, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -147,13 +147,13 @@ let multiRobotAInfo: (string | string[])[]; >getRobotB : () => [number, string, string] [numberB = -1] = [2, "trimmer", "trimming"]; ->[numberB = -1] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1] = [2, "trimmer", "trimming"] : [2, string, string] >[numberB = -1] : [number] >numberB = -1 : -1 >numberB : number >-1 : -1 >1 : 1 ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, string, string] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -176,14 +176,14 @@ let multiRobotAInfo: (string | string[])[]; >getMultiRobotB : () => [string, string[]] [nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]]; ->[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]] : [string, string[]] +>[nameMB = "helloNoName"] = ["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >[nameMB = "helloNoName"] : [string] >nameMB = "helloNoName" : "helloNoName" >nameMB : string >"helloNoName" : "helloNoName" ->["trimmer", ["trimming", "edging"]] : [string, string[]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ("trimming" | "edging")[]] >"trimmer" : "trimmer" ->["trimming", "edging"] : string[] +>["trimming", "edging"] : ("trimming" | "edging")[] >"trimming" : "trimming" >"edging" : "edging" @@ -219,7 +219,7 @@ let multiRobotAInfo: (string | string[])[]; >getRobotB : () => [number, string, string] [numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"]; ->[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"] : [number, string, string] +>[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] = [2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >[numberB = -1, nameB = "helloNoName", skillB = "noSkill"] : [number, string, string] >numberB = -1 : -1 >numberB : number @@ -231,7 +231,7 @@ let multiRobotAInfo: (string | string[])[]; >skillB = "noSkill" : "noSkill" >skillB : string >"noSkill" : "noSkill" ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" @@ -272,7 +272,7 @@ let multiRobotAInfo: (string | string[])[]; >getMultiRobotB : () => [string, string[]] [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = ->[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = ["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string, string]] >nameMB = "helloNoName" : "helloNoName" >nameMB : string @@ -288,9 +288,9 @@ let multiRobotAInfo: (string | string[])[]; >[] : [string, string] ["trimmer", ["trimming", "edging"]]; ->["trimmer", ["trimming", "edging"]] : [string, [string, string]] +>["trimmer", ["trimming", "edging"]] : ["trimmer", ["trimming", "edging"]] >"trimmer" : "trimmer" ->["trimming", "edging"] : [string, string] +>["trimming", "edging"] : ["trimming", "edging"] >"trimming" : "trimming" >"edging" : "edging" @@ -328,7 +328,7 @@ let multiRobotAInfo: (string | string[])[]; >robotAInfo : (string | number)[] >[2, "trimmer", "trimming"] : [number, string, string] >Robot : [number, string, string] ->[2, "trimmer", "trimming"] : [number, string, string] +>[2, "trimmer", "trimming"] : [2, "trimmer", "trimming"] >2 : 2 >"trimmer" : "trimmer" >"trimming" : "trimming" diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types index fbce7dedef15a..67f17142a65ec 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementDefaultValues.types @@ -22,7 +22,7 @@ var hello = "hello"; var robotA: Robot = { name: "mower", skill: "mowing" }; >robotA : Robot >Robot : Robot ->{ name: "mower", skill: "mowing" } : { name: string; skill: string; } +>{ name: "mower", skill: "mowing" } : { name: "mower"; skill: "mowing"; } >name : string >"mower" : "mower" >skill : string @@ -31,7 +31,7 @@ var robotA: Robot = { name: "mower", skill: "mowing" }; var robotB: Robot = { name: "trimmer", skill: "trimming" }; >robotB : Robot >Robot : Robot ->{ name: "trimmer", skill: "trimming" } : { name: string; skill: string; } +>{ name: "trimmer", skill: "trimming" } : { name: "trimmer"; skill: "trimming"; } >name : string >"trimmer" : "trimmer" >skill : string @@ -59,7 +59,7 @@ var { name: nameC = "", skill: skillC = "" } = { name: >skill : any >skillC : string >"" : "" ->{ name: "Edger", skill: "cutting edges" } : { name?: string; skill?: string; } +>{ name: "Edger", skill: "cutting edges" } : { name?: "Edger"; skill?: "cutting edges"; } >name : string >"Edger" : "Edger" >skill : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types index cf60c4a515fb9..f56500687ca2c 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.types @@ -26,11 +26,11 @@ interface Robot { var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >robotA : Robot >Robot : Robot ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string @@ -39,11 +39,11 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; >robotB : Robot >Robot : Robot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types index fa007d9a2fc3b..9a4d06c7e2636 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.types @@ -26,11 +26,11 @@ interface Robot { var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "none" } }; >robotA : Robot >Robot : Robot ->{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "mower", skills: { primary: "mowing", secondary: "none" } } : { name: "mower"; skills: { primary: "mowing"; secondary: "none"; }; } >name : string >"mower" : "mower" ->skills : { primary: string; secondary: string; } ->{ primary: "mowing", secondary: "none" } : { primary: string; secondary: string; } +>skills : { primary: "mowing"; secondary: "none"; } +>{ primary: "mowing", secondary: "none" } : { primary: "mowing"; secondary: "none"; } >primary : string >"mowing" : "mowing" >secondary : string @@ -39,11 +39,11 @@ var robotA: Robot = { name: "mower", skills: { primary: "mowing", secondary: "no var robotB: Robot = { name: "trimmer", skills: { primary: "trimming", secondary: "edging" } }; >robotB : Robot >Robot : Robot ->{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "trimmer", skills: { primary: "trimming", secondary: "edging" } } : { name: "trimmer"; skills: { primary: "trimming"; secondary: "edging"; }; } >name : string >"trimmer" : "trimmer" ->skills : { primary: string; secondary: string; } ->{ primary: "trimming", secondary: "edging" } : { primary: string; secondary: string; } +>skills : { primary: "trimming"; secondary: "edging"; } +>{ primary: "trimming", secondary: "edging" } : { primary: "trimming"; secondary: "edging"; } >primary : string >"trimming" : "trimming" >secondary : string @@ -64,7 +64,7 @@ var { >"noSkill" : "noSkill" } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -93,7 +93,7 @@ var { >"noSkill" : "noSkill" } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -122,7 +122,7 @@ var { >"noSkill" : "noSkill" } = { primary: "noSkill", secondary: "noSkill" } ->{ primary: "noSkill", secondary: "noSkill" } : { primary?: string; secondary?: string; } +>{ primary: "noSkill", secondary: "noSkill" } : { primary?: "noSkill"; secondary?: "noSkill"; } >primary : string >"noSkill" : "noSkill" >secondary : string @@ -131,11 +131,11 @@ var { } = { name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } }; >{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : Robot >Robot : Robot ->{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: string; skills: { primary: string; secondary: string; }; } +>{ name: "Edger", skills: { primary: "edging", secondary: "branch trimming" } } : { name: "Edger"; skills: { primary: "edging"; secondary: "branch trimming"; }; } >name : string >"Edger" : "Edger" ->skills : { primary: string; secondary: string; } ->{ primary: "edging", secondary: "branch trimming" } : { primary: string; secondary: string; } +>skills : { primary: "edging"; secondary: "branch trimming"; } +>{ primary: "edging", secondary: "branch trimming" } : { primary: "edging"; secondary: "branch trimming"; } >primary : string >"edging" : "edging" >secondary : string diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types index c4ad284f293b0..61a69e9d81b96 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern3.types @@ -2,7 +2,7 @@ var {x = 500} = { x: 20 }; >x : number >500 : 500 ->{ x: 20 } : { x?: number; } +>{ x: 20 } : { x?: 20; } >x : number >20 : 20 diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types index 3952961897d87..8f8c87004728f 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementObjectBindingPattern4.types @@ -5,7 +5,7 @@ var {x = 500, y} = { x: 20, y: "hi" }; >y : string ->{ x: 20, y: "hi" } : { x?: number; y: string; } +>{ x: 20, y: "hi" } : { x?: 20; y: string; } >x : number >20 : 20 >y : string diff --git a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.types b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.types index 24f18fab3e393..a5b7e641e80cd 100644 --- a/tests/baselines/reference/specializedSignatureAsCallbackParameter1.types +++ b/tests/baselines/reference/specializedSignatureAsCallbackParameter1.types @@ -27,7 +27,7 @@ x3(1, (x: string) => 1); >x3(1, (x: string) => 1) : any >x3 : { (a: number, cb: (x: number) => number): any; (a: string, cb: (x: number) => number): any; } >1 : 1 ->(x: string) => 1 : (x: string) => number +>(x: string) => 1 : (x: string) => 1 >x : string >1 : 1 @@ -35,7 +35,7 @@ x3(1, (x: 'hm') => 1); >x3(1, (x: 'hm') => 1) : any >x3 : { (a: number, cb: (x: number) => number): any; (a: string, cb: (x: number) => number): any; } >1 : 1 ->(x: 'hm') => 1 : (x: "hm") => number +>(x: 'hm') => 1 : (x: "hm") => 1 >x : "hm" >1 : 1 diff --git a/tests/baselines/reference/spreadMethods.types b/tests/baselines/reference/spreadMethods.types index de48bedeffcec..8718c35a8c942 100644 --- a/tests/baselines/reference/spreadMethods.types +++ b/tests/baselines/reference/spreadMethods.types @@ -51,7 +51,7 @@ ssk.m(); // error let i: I = { p: 12, m() { } }; >i : I >I : I ->{ p: 12, m() { } } : { p: number; m(): void; } +>{ p: 12, m() { } } : { p: 12; m(): void; } >p : number >12 : 12 >m : () => void diff --git a/tests/baselines/reference/spreadTypeRemovesReadonly.types b/tests/baselines/reference/spreadTypeRemovesReadonly.types index 862cacb8a1b1a..22feaf54eb6c9 100644 --- a/tests/baselines/reference/spreadTypeRemovesReadonly.types +++ b/tests/baselines/reference/spreadTypeRemovesReadonly.types @@ -9,7 +9,7 @@ interface ReadonlyData { const data: ReadonlyData = { value: 'foo' }; >data : ReadonlyData >ReadonlyData : ReadonlyData ->{ value: 'foo' } : { value: string; } +>{ value: 'foo' } : { value: "foo"; } >value : string >'foo' : "foo" diff --git a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types index 9cd8571bf6129..0d5782f7fa731 100644 --- a/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types +++ b/tests/baselines/reference/staticAnonymousTypeNotReferencingTypeParameter.types @@ -756,7 +756,7 @@ let cloned = ListWrapper.clone(ListWrapper, [1,2,3,4]); >ListWrapper : typeof ListWrapper >clone : (dit: typeof ListWrapper, array: T[]) => T[] >ListWrapper : typeof ListWrapper ->[1,2,3,4] : number[] +>[1,2,3,4] : (1 | 3 | 2 | 4)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.types b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.types index fcbf7782fb35b..527fa6ce4db05 100644 --- a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.types +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.types @@ -34,11 +34,11 @@ class C { >x : number C.bar = (x: number) => 1; // ok ->C.bar = (x: number) => 1 : (x: number) => number +>C.bar = (x: number) => 1 : (x: number) => 1 >C.bar : (x: number) => number >C : typeof C >bar : (x: number) => number ->(x: number) => 1 : (x: number) => number +>(x: number) => 1 : (x: number) => 1 >x : number >1 : 1 diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt index 606cc39afef98..b41e7a4d2ac64 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.errors.txt @@ -22,7 +22,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(71,5): error TS2411: Property 'foo' of type '() => string' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(73,5): error TS2411: Property '"4.0"' of type 'number' is not assignable to string index type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(74,5): error TS2411: Property 'f' of type 'MyString' is not assignable to string index type 'string'. -tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'. +tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ a: ""; b: number; c: () => void; "d": ""; "e": number; 1.0: ""; 2.0: number; "3.0": ""; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'. Property 'b' is incompatible with index signature. Type 'number' is not assignable to type 'string'. tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. @@ -157,7 +157,7 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon // error var b: { [x: string]: string; } = { ~ -!!! error TS2322: Type '{ a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'. +!!! error TS2322: Type '{ a: ""; b: number; c: () => void; "d": ""; "e": number; 1.0: ""; 2.0: number; "3.0": ""; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'. !!! error TS2322: Property 'b' is incompatible with index signature. !!! error TS2322: Type 'number' is not assignable to type 'string'. a: '', diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.types b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.types index c6f3a412da1a5..c5a75391f450f 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.types +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations.types @@ -140,7 +140,7 @@ var a: { var b: { [x: string]: string; } = { >b : { [x: string]: string; } >x : string ->{ a: '', b: 1, c: () => { }, "d": '', "e": 1, 1.0: '', 2.0: 1, "3.0": '', "4.0": 1, f: null, get X() { return ''; }, set X(v) { }, foo() { return ''; }} : { a: string; b: number; c: () => void; "d": string; "e": number; 1.0: string; 2.0: number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; } +>{ a: '', b: 1, c: () => { }, "d": '', "e": 1, 1.0: '', 2.0: 1, "3.0": '', "4.0": 1, f: null, get X() { return ''; }, set X(v) { }, foo() { return ''; }} : { a: ""; b: number; c: () => void; "d": ""; "e": number; 1.0: ""; 2.0: number; "3.0": ""; "4.0": number; f: MyString; X: string; foo(): string; } a: '', >a : string diff --git a/tests/baselines/reference/stringIndexingResults.types b/tests/baselines/reference/stringIndexingResults.types index 9d7c19f49cc4a..bb0f025ed43f4 100644 --- a/tests/baselines/reference/stringIndexingResults.types +++ b/tests/baselines/reference/stringIndexingResults.types @@ -95,7 +95,7 @@ var r9 = a[1]; var b: { [x: string]: string } = { y: '' } >b : { [x: string]: string; } >x : string ->{ y: '' } : { y: string; } +>{ y: '' } : { y: ""; } >y : string >'' : "" diff --git a/tests/baselines/reference/stringLiteralTypesAsTags01.types b/tests/baselines/reference/stringLiteralTypesAsTags01.types index 6caf851a72648..792e3bae5e23c 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags01.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags01.types @@ -75,7 +75,7 @@ function hasKind(entity: Entity, kind: Kind): boolean { let x: A = { >x : A >A : A ->{ kind: "A", a: 100,} : { kind: "A"; a: number; } +>{ kind: "A", a: 100,} : { kind: "A"; a: 100; } kind: "A", >kind : string diff --git a/tests/baselines/reference/stringLiteralTypesAsTags02.types b/tests/baselines/reference/stringLiteralTypesAsTags02.types index f90ea6c6a0645..c287f7d81bae1 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags02.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags02.types @@ -69,7 +69,7 @@ function hasKind(entity: Entity, kind: Kind): entity is (A | B) { let x: A = { >x : A >A : A ->{ kind: "A", a: 100,} : { kind: "A"; a: number; } +>{ kind: "A", a: 100,} : { kind: "A"; a: 100; } kind: "A", >kind : string diff --git a/tests/baselines/reference/stringLiteralTypesAsTags03.types b/tests/baselines/reference/stringLiteralTypesAsTags03.types index 64622e28ac828..9ffe463022799 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags03.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags03.types @@ -72,7 +72,7 @@ function hasKind(entity: Entity, kind: Kind): entity is Entity { let x: A = { >x : A >A : A ->{ kind: "A", a: 100,} : { kind: "A"; a: number; } +>{ kind: "A", a: 100,} : { kind: "A"; a: 100; } kind: "A", >kind : string diff --git a/tests/baselines/reference/structural1.types b/tests/baselines/reference/structural1.types index 12dfb25d91dda..2f625238f7ba2 100644 --- a/tests/baselines/reference/structural1.types +++ b/tests/baselines/reference/structural1.types @@ -21,7 +21,7 @@ module M { f({salt:2,pepper:0}); >f({salt:2,pepper:0}) : void >f : (i: I) => void ->{salt:2,pepper:0} : { salt: number; pepper: number; } +>{salt:2,pepper:0} : { salt: 2; pepper: 0; } >salt : number >2 : 2 >pepper : number diff --git a/tests/baselines/reference/subtypeRelationForNever.types b/tests/baselines/reference/subtypeRelationForNever.types index 67c92b9b079e2..bbe5747fe0b49 100644 --- a/tests/baselines/reference/subtypeRelationForNever.types +++ b/tests/baselines/reference/subtypeRelationForNever.types @@ -47,7 +47,7 @@ const result = withFew([1, 2, 3], id, fail); // expected result is number[] >result : number[] >withFew([1, 2, 3], id, fail) : number[] >withFew : (values: a[], haveFew: (values: a[]) => r, haveNone: (reason: string) => r) => r ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/superPropertyAccess.types b/tests/baselines/reference/superPropertyAccess.types index 3d1161355a300..decca6e6e0947 100644 --- a/tests/baselines/reference/superPropertyAccess.types +++ b/tests/baselines/reference/superPropertyAccess.types @@ -91,11 +91,11 @@ class MyDerived extends MyBase { >d2 : number super.m1 = function (a: string) { return ""; }; // Should be allowed, we will not restrict assignment ->super.m1 = function (a: string) { return ""; } : (a: string) => string +>super.m1 = function (a: string) { return ""; } : (a: string) => "" >super.m1 : (a: string) => string >super : MyBase >m1 : (a: string) => string ->function (a: string) { return ""; } : (a: string) => string +>function (a: string) { return ""; } : (a: string) => "" >a : string >"" : "" diff --git a/tests/baselines/reference/symbolProperty21.errors.txt b/tests/baselines/reference/symbolProperty21.errors.txt index 766af0659e8a9..b9083d185d220 100644 --- a/tests/baselines/reference/symbolProperty21.errors.txt +++ b/tests/baselines/reference/symbolProperty21.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. +tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: ""; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. @@ -14,7 +14,7 @@ tests/cases/conformance/es6/Symbols/symbolProperty21.ts(10,5): error TS2345: Arg [Symbol.isConcatSpreadable]: "", [Symbol.toPrimitive]: 0, ~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: string; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. +!!! error TS2345: Argument of type '{ [Symbol.isConcatSpreadable]: ""; [Symbol.toPrimitive]: number; [Symbol.unscopables]: true; }' is not assignable to parameter of type 'I'. !!! error TS2345: Object literal may only specify known properties, and '[Symbol.toPrimitive]' does not exist in type 'I'. [Symbol.unscopables]: true }); \ No newline at end of file diff --git a/tests/baselines/reference/syntaxErrors.types b/tests/baselines/reference/syntaxErrors.types index e99e3b9b88ec2..db5ae9ac190a5 100644 --- a/tests/baselines/reference/syntaxErrors.types +++ b/tests/baselines/reference/syntaxErrors.types @@ -29,7 +29,7 @@ var x = f({ t: 1000 }, { t: 3000 }); >{ t: 1000 } : { t: number; } >t : number >1000 : 1000 ->{ t: 3000 } : { t: number; } +>{ t: 3000 } : { t: 3000; } >t : number >3000 : 3000 diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types index d1be9c77cb984..1a652fb5839ff 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types @@ -400,13 +400,13 @@ var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T >`${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : string >undefined : undefined ->{ x: 6, z: new Date() } : { x: number; z: Date; } +>{ x: 6, z: new Date() } : { x: 6; z: Date; } >x : number >6 : 6 >z : Date >new Date() : Date >Date : DateConstructor ->{ x: 6, y: '' } : { x: number; y: string; } +>{ x: 6, y: '' } : { x: 6; y: ""; } >x : number >6 : 6 >y : string @@ -421,13 +421,13 @@ var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; >someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }` : { x: number; } >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T >`${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }` : string ->{ x: 3 } : { x: number; } +>{ x: 3 } : { x: 3; } >x : number >3 : 3 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types index e0a1d33937655..e62ed33f99063 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types @@ -400,13 +400,13 @@ var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T >`${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : string >undefined : undefined ->{ x: 6, z: new Date() } : { x: number; z: Date; } +>{ x: 6, z: new Date() } : { x: 6; z: Date; } >x : number >6 : 6 >z : Date >new Date() : Date >Date : DateConstructor ->{ x: 6, y: '' } : { x: number; y: string; } +>{ x: 6, y: '' } : { x: 6; y: ""; } >x : number >6 : 6 >y : string @@ -421,13 +421,13 @@ var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; >someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }` : { x: number; } >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T >`${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }` : string ->{ x: 3 } : { x: number; } +>{ x: 3 } : { x: 3; } >x : number >3 : 3 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 diff --git a/tests/baselines/reference/targetTypeCastTest.types b/tests/baselines/reference/targetTypeCastTest.types index e2a7db86815f5..f6a657a208cb4 100644 --- a/tests/baselines/reference/targetTypeCastTest.types +++ b/tests/baselines/reference/targetTypeCastTest.types @@ -57,7 +57,7 @@ interface Adder2 { var add2: Adder2 = function(x,y) { >add2 : Adder2 >Adder2 : Adder2 ->function(x,y) { return 0;} : (x: number, y: number) => number +>function(x,y) { return 0;} : (x: number, y: number) => 0 >x : number >y : number diff --git a/tests/baselines/reference/targetTypeObjectLiteral.types b/tests/baselines/reference/targetTypeObjectLiteral.types index 5f80a01bf0cb9..673cdb83c32f0 100644 --- a/tests/baselines/reference/targetTypeObjectLiteral.types +++ b/tests/baselines/reference/targetTypeObjectLiteral.types @@ -4,15 +4,15 @@ var z: { x: number; y: (w:string)=>number;} = { >x : number >y : (w: string) => number >w : string ->{ x: 12, y: function(w) { return 0; }} : { x: number; y: (w: string) => number; } +>{ x: 12, y: function(w) { return 0; }} : { x: 12; y: (w: string) => 0; } x: 12, >x : number >12 : 12 y: function(w) { ->y : (w: string) => number ->function(w) { return 0; } : (w: string) => number +>y : (w: string) => 0 +>function(w) { return 0; } : (w: string) => 0 >w : string return 0; diff --git a/tests/baselines/reference/targetTypeTest1.types b/tests/baselines/reference/targetTypeTest1.types index d8f68f8fce1af..c672300f59467 100644 --- a/tests/baselines/reference/targetTypeTest1.types +++ b/tests/baselines/reference/targetTypeTest1.types @@ -116,11 +116,11 @@ var f : number = 5; // this in function add inferred to be type of object literal (i.e. Point) // dx, dy, and return type of add inferred using target typing Point.prototype = { ->Point.prototype = { x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: number, dy: number) => Point; } +>Point.prototype = { x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: 0; y: 0; add: (dx: number, dy: number) => Point; } >Point.prototype : Point >Point : typeof Point >prototype : Point ->{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: number; y: number; add: (dx: number, dy: number) => Point; } +>{ x: 0, y: 0, add: function(dx, dy) { return new Point(this.x + dx, this.y + dy); }} : { x: 0; y: 0; add: (dx: number, dy: number) => Point; } x: 0, >x : number @@ -205,13 +205,13 @@ function C(a,b) { } C.prototype = ->C.prototype = { a:0, b:0, C1M1: function(c,d) { return (this.a + c) + (this.b + d); } } : { a: number; b: number; C1M1: (c: number, d: number) => any; } +>C.prototype = { a:0, b:0, C1M1: function(c,d) { return (this.a + c) + (this.b + d); } } : { a: 0; b: 0; C1M1: (c: number, d: number) => any; } >C.prototype : C >C : typeof C >prototype : C { a:0, ->{ a:0, b:0, C1M1: function(c,d) { return (this.a + c) + (this.b + d); } } : { a: number; b: number; C1M1: (c: number, d: number) => any; } +>{ a:0, b:0, C1M1: function(c,d) { return (this.a + c) + (this.b + d); } } : { a: 0; b: 0; C1M1: (c: number, d: number) => any; } >a : number >0 : 0 diff --git a/tests/baselines/reference/targetTypeTest3.errors.txt b/tests/baselines/reference/targetTypeTest3.errors.txt index f5dab732ed346..4af159284eb98 100644 --- a/tests/baselines/reference/targetTypeTest3.errors.txt +++ b/tests/baselines/reference/targetTypeTest3.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | number)[]' is not assignable to type 'string[]'. - Type 'string | number' is not assignable to type 'string'. +tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(number | "3")[]' is not assignable to type 'string[]'. + Type 'number | "3"' is not assignable to type 'string'. Type 'number' is not assignable to type 'string'. @@ -9,8 +9,8 @@ tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | numb var a : string[] = [1,2,"3"]; // should produce an error ~ -!!! error TS2322: Type '(string | number)[]' is not assignable to type 'string[]'. -!!! error TS2322: Type 'string | number' is not assignable to type 'string'. +!!! error TS2322: Type '(number | "3")[]' is not assignable to type 'string[]'. +!!! error TS2322: Type 'number | "3"' is not assignable to type 'string'. !!! error TS2322: Type 'number' is not assignable to type 'string'. diff --git a/tests/baselines/reference/targetTypeTest3.types b/tests/baselines/reference/targetTypeTest3.types index b8e882fa6a438..12c7c61238f7b 100644 --- a/tests/baselines/reference/targetTypeTest3.types +++ b/tests/baselines/reference/targetTypeTest3.types @@ -4,7 +4,7 @@ var a : string[] = [1,2,"3"]; // should produce an error >a : string[] ->[1,2,"3"] : (string | number)[] +>[1,2,"3"] : (number | "3")[] >1 : 1 >2 : 2 >"3" : "3" diff --git a/tests/baselines/reference/thisTypeInAccessorsNegative.types b/tests/baselines/reference/thisTypeInAccessorsNegative.types index 3b307327c5e09..f28191bd75ef7 100644 --- a/tests/baselines/reference/thisTypeInAccessorsNegative.types +++ b/tests/baselines/reference/thisTypeInAccessorsNegative.types @@ -44,7 +44,7 @@ const mismatch = { const contextual: Foo = { >contextual : Foo >Foo : Foo ->{ n: 16, get x() { return this.n; }} : { n: number; readonly x: number; } +>{ n: 16, get x() { return this.n; }} : { n: 16; readonly x: number; } n: 16, >n : number diff --git a/tests/baselines/reference/thisTypeInFunctions.types b/tests/baselines/reference/thisTypeInFunctions.types index a2aaba4cdd736..5b8449086a27d 100644 --- a/tests/baselines/reference/thisTypeInFunctions.types +++ b/tests/baselines/reference/thisTypeInFunctions.types @@ -132,7 +132,7 @@ function implicitThis(n: number): number { let impl: I = { >impl : I >I : I ->{ a: 12, explicitVoid2: () => this.a, // ok, this: any because it refers to some outer object (window?) explicitVoid1() { return 12; }, explicitStructural() { return this.a; }, explicitInterface() { return this.a; }, explicitThis() { return this.a; },} : { a: number; explicitVoid2: () => any; explicitVoid1(this: void): number; explicitStructural(this: { a: number; }): number; explicitInterface(this: I): number; explicitThis(this: I): number; } +>{ a: 12, explicitVoid2: () => this.a, // ok, this: any because it refers to some outer object (window?) explicitVoid1() { return 12; }, explicitStructural() { return this.a; }, explicitInterface() { return this.a; }, explicitThis() { return this.a; },} : { a: 12; explicitVoid2: () => any; explicitVoid1(this: void): 12; explicitStructural(this: { a: number; }): number; explicitInterface(this: I): number; explicitThis(this: I): number; } a: 12, >a : number @@ -146,7 +146,7 @@ let impl: I = { >a : any explicitVoid1() { return 12; }, ->explicitVoid1 : (this: void) => number +>explicitVoid1 : (this: void) => 12 >12 : 12 explicitStructural() { @@ -178,19 +178,19 @@ let impl: I = { }, } impl.explicitVoid1 = function () { return 12; }; ->impl.explicitVoid1 = function () { return 12; } : (this: void) => number +>impl.explicitVoid1 = function () { return 12; } : (this: void) => 12 >impl.explicitVoid1 : (this: void) => number >impl : I >explicitVoid1 : (this: void) => number ->function () { return 12; } : (this: void) => number +>function () { return 12; } : (this: void) => 12 >12 : 12 impl.explicitVoid2 = () => 12; ->impl.explicitVoid2 = () => 12 : () => number +>impl.explicitVoid2 = () => 12 : () => 12 >impl.explicitVoid2 : (this: void) => number >impl : I >explicitVoid2 : (this: void) => number ->() => 12 : () => number +>() => 12 : () => 12 >12 : 12 impl.explicitStructural = function() { return this.a; }; @@ -214,19 +214,19 @@ impl.explicitInterface = function() { return this.a; }; >a : number impl.explicitStructural = () => 12; ->impl.explicitStructural = () => 12 : () => number +>impl.explicitStructural = () => 12 : () => 12 >impl.explicitStructural : (this: { a: number; }) => number >impl : I >explicitStructural : (this: { a: number; }) => number ->() => 12 : () => number +>() => 12 : () => 12 >12 : 12 impl.explicitInterface = () => 12; ->impl.explicitInterface = () => 12 : () => number +>impl.explicitInterface = () => 12 : () => 12 >impl.explicitInterface : (this: I) => number >impl : I >explicitInterface : (this: I) => number ->() => 12 : () => number +>() => 12 : () => 12 >12 : 12 impl.explicitThis = function () { return this.a; }; @@ -247,7 +247,7 @@ let ok: {y: number, f: (this: { y: number }, x: number) => number} = { y: 12, f: >this : { y: number; } >y : number >x : number ->{ y: 12, f: explicitStructural } : { y: number; f: (this: { y: number; }, x: number) => number; } +>{ y: 12, f: explicitStructural } : { y: 12; f: (this: { y: number; }, x: number) => number; } >y : number >12 : 12 >f : (this: { y: number; }, x: number) => number @@ -258,7 +258,7 @@ let implicitAnyOk: {notSpecified: number, f: (x: number) => number} = { notSpeci >notSpecified : number >f : (x: number) => number >x : number ->{ notSpecified: 12, f: implicitThis } : { notSpecified: number; f: (n: number) => number; } +>{ notSpecified: 12, f: implicitThis } : { notSpecified: 12; f: (n: number) => number; } >notSpecified : number >12 : 12 >f : (n: number) => number @@ -371,7 +371,7 @@ let reconstructed: { >m : number } = { ->{ n: 12, explicitThis: c.explicitThis, explicitC: c.explicitC, explicitProperty: c.explicitProperty, explicitVoid: c.explicitVoid} : { n: number; explicitThis: (this: C, m: number) => number; explicitC: (this: C, m: number) => number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid: (this: void, m: number) => number; } +>{ n: 12, explicitThis: c.explicitThis, explicitC: c.explicitC, explicitProperty: c.explicitProperty, explicitVoid: c.explicitVoid} : { n: 12; explicitThis: (this: C, m: number) => number; explicitC: (this: C, m: number) => number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid: (this: void, m: number) => number; } n: 12, >n : number diff --git a/tests/baselines/reference/thisTypeInFunctions2.types b/tests/baselines/reference/thisTypeInFunctions2.types index a527429ccd9ce..b70d19cf8dec1 100644 --- a/tests/baselines/reference/thisTypeInFunctions2.types +++ b/tests/baselines/reference/thisTypeInFunctions2.types @@ -128,7 +128,7 @@ extend2({ simple({ >simple({ foo(n) { return n.length + this.bar(); }, bar() { return 14; }}) : void >simple : (arg: SimpleInterface) => void ->{ foo(n) { return n.length + this.bar(); }, bar() { return 14; }} : { foo(n: string): number; bar(): number; } +>{ foo(n) { return n.length + this.bar(); }, bar() { return 14; }} : { foo(n: string): number; bar(): 14; } foo(n) { >foo : (n: string) => number @@ -146,7 +146,7 @@ simple({ }, bar() { ->bar : () => number +>bar : () => 14 return 14; >14 : 14 diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt index 56ac090c02c9f..e6d45c5825939 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.errors.txt @@ -4,11 +4,11 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(49,1): err tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(51,1): error TS2684: The 'this' context of type 'void' is not assignable to method's 'this' of type 'I'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(56,21): error TS2339: Property 'notFound' does not exist on type '{ y: number; }'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(59,21): error TS2339: Property 'notSpecified' does not exist on type 'void'. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(61,79): error TS2322: Type '{ y: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(61,79): error TS2322: Type '{ y: 12; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(62,97): error TS2322: Type '{ y: string; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(62,97): error TS2322: Type '{ y: "foo"; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. -tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(63,110): error TS2322: Type '{ wrongName: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. +tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(63,110): error TS2322: Type '{ wrongName: 12; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(65,1): error TS2554: Expected 1 arguments, but got 0. tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(66,6): error TS2345: Argument of type '"wrong type"' is not assignable to parameter of type 'number'. @@ -174,15 +174,15 @@ tests/cases/conformance/types/thisType/thisTypeInFunctionsNegative.ts(175,35): e } let ok: {y: number, f: (this: { y: number }, x: number) => number} = { y: 12, explicitStructural }; ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ y: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. +!!! error TS2322: Type '{ y: 12; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. !!! error TS2322: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: number; f: (this: { y: number; }, x: number) => number; }'. let wrongPropertyType: {y: string, f: (this: { y: number }, x: number) => number} = { y: 'foo', explicitStructural }; ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ y: string; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. +!!! error TS2322: Type '{ y: "foo"; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. !!! error TS2322: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ y: string; f: (this: { y: number; }, x: number) => number; }'. let wrongPropertyName: {wrongName: number, f: (this: { y: number }, x: number) => number} = { wrongName: 12, explicitStructural }; ~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ wrongName: number; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. +!!! error TS2322: Type '{ wrongName: 12; explicitStructural: (this: { y: number; }, x: number) => number; }' is not assignable to type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. !!! error TS2322: Object literal may only specify known properties, and 'explicitStructural' does not exist in type '{ wrongName: number; f: (this: { y: number; }, x: number) => number; }'. ok.f(); // not enough arguments diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.types b/tests/baselines/reference/thisTypeInFunctionsNegative.types index a5a8db3e2ee26..dff07a72305b3 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.types +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.types @@ -130,7 +130,7 @@ interface I { let impl: I = { >impl : I >I : I ->{ a: 12, explicitVoid1() { return this.a; // error, no 'a' in 'void' }, explicitVoid2: () => this.a, // ok, `this:any` because it refers to an outer object explicitStructural: () => 12, explicitInterface: () => 12, explicitThis() { return this.a; },} : { a: number; explicitVoid1(this: void): any; explicitVoid2: () => any; explicitStructural: () => number; explicitInterface: () => number; explicitThis(this: I): number; } +>{ a: 12, explicitVoid1() { return this.a; // error, no 'a' in 'void' }, explicitVoid2: () => this.a, // ok, `this:any` because it refers to an outer object explicitStructural: () => 12, explicitInterface: () => 12, explicitThis() { return this.a; },} : { a: 12; explicitVoid1(this: void): any; explicitVoid2: () => any; explicitStructural: () => 12; explicitInterface: () => 12; explicitThis(this: I): number; } a: 12, >a : number @@ -153,13 +153,13 @@ let impl: I = { >a : any explicitStructural: () => 12, ->explicitStructural : () => number ->() => 12 : () => number +>explicitStructural : () => 12 +>() => 12 : () => 12 >12 : 12 explicitInterface: () => 12, ->explicitInterface : () => number ->() => 12 : () => number +>explicitInterface : () => 12 +>() => 12 : () => 12 >12 : 12 explicitThis() { @@ -237,7 +237,7 @@ let ok: {y: number, f: (this: { y: number }, x: number) => number} = { y: 12, ex >this : { y: number; } >y : number >x : number ->{ y: 12, explicitStructural } : { y: number; explicitStructural: (this: { y: number; }, x: number) => number; } +>{ y: 12, explicitStructural } : { y: 12; explicitStructural: (this: { y: number; }, x: number) => number; } >y : number >12 : 12 >explicitStructural : (this: { y: number; }, x: number) => number @@ -249,7 +249,7 @@ let wrongPropertyType: {y: string, f: (this: { y: number }, x: number) => number >this : { y: number; } >y : number >x : number ->{ y: 'foo', explicitStructural } : { y: string; explicitStructural: (this: { y: number; }, x: number) => number; } +>{ y: 'foo', explicitStructural } : { y: "foo"; explicitStructural: (this: { y: number; }, x: number) => number; } >y : string >'foo' : "foo" >explicitStructural : (this: { y: number; }, x: number) => number @@ -261,7 +261,7 @@ let wrongPropertyName: {wrongName: number, f: (this: { y: number }, x: number) = >this : { y: number; } >y : number >x : number ->{ wrongName: 12, explicitStructural } : { wrongName: number; explicitStructural: (this: { y: number; }, x: number) => number; } +>{ wrongName: 12, explicitStructural } : { wrongName: 12; explicitStructural: (this: { y: number; }, x: number) => number; } >wrongName : number >12 : 12 >explicitStructural : (this: { y: number; }, x: number) => number @@ -427,7 +427,7 @@ let reconstructed: { >m : number } = { ->{ n: 12, explicitThis: c.explicitThis, explicitC: c.explicitC, explicitProperty: c.explicitProperty, explicitVoid: c.explicitVoid} : { n: number; explicitThis: (this: C, m: number) => number; explicitC: (this: C, m: number) => number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid: (this: void, m: number) => number; } +>{ n: 12, explicitThis: c.explicitThis, explicitC: c.explicitC, explicitProperty: c.explicitProperty, explicitVoid: c.explicitVoid} : { n: 12; explicitThis: (this: C, m: number) => number; explicitC: (this: C, m: number) => number; explicitProperty: (this: { n: number; }, m: number) => number; explicitVoid: (this: void, m: number) => number; } n: 12, >n : number diff --git a/tests/baselines/reference/thisTypeInObjectLiterals2.types b/tests/baselines/reference/thisTypeInObjectLiterals2.types index 746ca0eb264ac..dba7e9563cf63 100644 --- a/tests/baselines/reference/thisTypeInObjectLiterals2.types +++ b/tests/baselines/reference/thisTypeInObjectLiterals2.types @@ -93,7 +93,7 @@ type Point = { let p1: Point = { >p1 : Point >Point : Point ->{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: number; y: number; moveBy(dx: number, dy: number, dz: number | undefined): void; } +>{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: 10; y: 20; moveBy(dx: number, dy: number, dz: number | undefined): void; } x: 10, >x : number @@ -144,7 +144,7 @@ let p2: Point | null = { >p2 : Point | null >Point : Point >null : null ->{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: number; y: number; moveBy(dx: number, dy: number, dz: number | undefined): void; } +>{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: 10; y: 20; moveBy(dx: number, dy: number, dz: number | undefined): void; } x: 10, >x : number @@ -194,7 +194,7 @@ let p2: Point | null = { let p3: Point | undefined = { >p3 : Point | undefined >Point : Point ->{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: number; y: number; moveBy(dx: number, dy: number, dz: number | undefined): void; } +>{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: 10; y: 20; moveBy(dx: number, dy: number, dz: number | undefined): void; } x: 10, >x : number @@ -245,7 +245,7 @@ let p4: Point | null | undefined = { >p4 : Point | null | undefined >Point : Point >null : null ->{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: number; y: number; moveBy(dx: number, dy: number, dz: number | undefined): void; } +>{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: 10; y: 20; moveBy(dx: number, dy: number, dz: number | undefined): void; } x: 10, >x : number @@ -300,7 +300,7 @@ declare function f1(p: Point): void; f1({ >f1({ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }}) : void >f1 : (p: Point) => void ->{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: number; y: number; moveBy(dx: number, dy: number, dz: number | undefined): void; } +>{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: 10; y: 20; moveBy(dx: number, dy: number, dz: number | undefined): void; } x: 10, >x : number @@ -356,7 +356,7 @@ declare function f2(p: Point | null | undefined): void; f2({ >f2({ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }}) : void >f2 : (p: Point | null | undefined) => void ->{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: number; y: number; moveBy(dx: number, dy: number, dz: number | undefined): void; } +>{ x: 10, y: 20, moveBy(dx, dy, dz) { this.x += dx; this.y += dy; if (this.z && dz) { this.z += dz; } }} : { x: 10; y: 20; moveBy(dx: number, dy: number, dz: number | undefined): void; } x: 10, >x : number @@ -438,11 +438,11 @@ let x1 = makeObject({ >x1 : { x: number; y: number; } & { moveBy(dx: number, dy: number): void; } >makeObject({ data: { x: 0, y: 0 }, methods: { moveBy(dx: number, dy: number) { this.x += dx; // Strongly typed this this.y += dy; // Strongly typed this } }}) : { x: number; y: number; } & { moveBy(dx: number, dy: number): void; } >makeObject : (desc: ObjectDescriptor) => D & M ->{ data: { x: 0, y: 0 }, methods: { moveBy(dx: number, dy: number) { this.x += dx; // Strongly typed this this.y += dy; // Strongly typed this } }} : { data: { x: number; y: number; }; methods: { moveBy(dx: number, dy: number): void; }; } +>{ data: { x: 0, y: 0 }, methods: { moveBy(dx: number, dy: number) { this.x += dx; // Strongly typed this this.y += dy; // Strongly typed this } }} : { data: { x: 0; y: 0; }; methods: { moveBy(dx: number, dy: number): void; }; } data: { x: 0, y: 0 }, ->data : { x: number; y: number; } ->{ x: 0, y: 0 } : { x: number; y: number; } +>data : { x: 0; y: 0; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -509,11 +509,11 @@ let x2 = makeObject2({ >x2 : { x: number; y: number; } & { moveBy(dx: number, dy: number): void; } >makeObject2({ data: { x: 0, y: 0 }, methods: { moveBy(dx: number, dy: number) { this.x += dx; // Strongly typed this this.y += dy; // Strongly typed this } }}) : { x: number; y: number; } & { moveBy(dx: number, dy: number): void; } >makeObject2 : (desc: ObjectDescriptor) => D & M ->{ data: { x: 0, y: 0 }, methods: { moveBy(dx: number, dy: number) { this.x += dx; // Strongly typed this this.y += dy; // Strongly typed this } }} : { data: { x: number; y: number; }; methods: { moveBy(dx: number, dy: number): void; }; } +>{ data: { x: 0, y: 0 }, methods: { moveBy(dx: number, dy: number) { this.x += dx; // Strongly typed this this.y += dy; // Strongly typed this } }} : { data: { x: 0; y: 0; }; methods: { moveBy(dx: number, dy: number): void; }; } data: { x: 0, y: 0 }, ->data : { x: number; y: number; } ->{ x: 0, y: 0 } : { x: number; y: number; } +>data : { x: 0; y: 0; } +>{ x: 0, y: 0 } : { x: 0; y: 0; } >x : number >0 : 0 >y : number @@ -616,7 +616,7 @@ let p10 = defineProp(p1, "foo", { value: 42 }); >defineProp : (obj: T, name: K, desc: PropDesc & ThisType) => T & Record >p1 : Point >"foo" : "foo" ->{ value: 42 } : { value: number; } +>{ value: 42 } : { value: 42; } >value : number >42 : 42 @@ -676,11 +676,11 @@ let p12 = defineProps(p1, { >defineProps(p1, { foo: { value: 42 }, bar: { get(): number { return this.x; }, set(value: number) { this.x = value; } }}) : Point & { foo: number; bar: number; } >defineProps : (obj: T, descs: PropDescMap & ThisType) => T & U >p1 : Point ->{ foo: { value: 42 }, bar: { get(): number { return this.x; }, set(value: number) { this.x = value; } }} : { foo: { value: number; }; bar: { get(): number; set(value: number): void; }; } +>{ foo: { value: 42 }, bar: { get(): number { return this.x; }, set(value: number) { this.x = value; } }} : { foo: { value: 42; }; bar: { get(): number; set(value: number): void; }; } foo: { ->foo : { value: number; } ->{ value: 42 } : { value: number; } +>foo : { value: 42; } +>{ value: 42 } : { value: 42; } value: 42 >value : number @@ -816,8 +816,8 @@ let vue = new Vue({ data: () => ({ x: 1, y: 2 }), >data : () => { x: number; y: number; } >() => ({ x: 1, y: 2 }) : () => { x: number; y: number; } ->({ x: 1, y: 2 }) : { x: number; y: number; } ->{ x: 1, y: 2 } : { x: number; y: number; } +>({ x: 1, y: 2 }) : { x: 1; y: 2; } +>{ x: 1, y: 2 } : { x: 1; y: 2; } >x : number >1 : 1 >y : number diff --git a/tests/baselines/reference/thisTypeInTuples.types b/tests/baselines/reference/thisTypeInTuples.types index 3b6f995840ec6..b8b6b5a324838 100644 --- a/tests/baselines/reference/thisTypeInTuples.types +++ b/tests/baselines/reference/thisTypeInTuples.types @@ -9,7 +9,7 @@ interface Array { let t: [number, string] = [42, "hello"]; >t : [number, string] ->[42, "hello"] : [number, string] +>[42, "hello"] : [42, "hello"] >42 : 42 >"hello" : "hello" diff --git a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt index 32c1a470bc380..0009de85ff5d3 100644 --- a/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt +++ b/tests/baselines/reference/trailingCommaInHeterogenousArrayLiteral1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(5,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. - Type 'string | number' is not assignable to type 'number'. +tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(5,19): error TS2345: Argument of type '(string | 1 | 2 | 5)[]' is not assignable to parameter of type 'number[]'. + Type 'string | 1 | 2 | 5' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. +tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS2345: Argument of type '(string | 1 | 2 | 5)[]' is not assignable to parameter of type 'number[]'. ==== tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts (2 errors) ==== @@ -11,12 +11,12 @@ tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS // these two should give the same error this.test([1, 2, "hi", 5, ]); ~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. -!!! error TS2345: Type 'string | number' is not assignable to type 'number'. +!!! error TS2345: Argument of type '(string | 1 | 2 | 5)[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: Type 'string | 1 | 2 | 5' is not assignable to type 'number'. !!! error TS2345: Type 'string' is not assignable to type 'number'. this.test([1, 2, "hi", 5]); ~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'. +!!! error TS2345: Argument of type '(string | 1 | 2 | 5)[]' is not assignable to parameter of type 'number[]'. } } \ No newline at end of file diff --git a/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.types b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.types index 68ad55854a797..308af66de7986 100644 --- a/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.types +++ b/tests/baselines/reference/tsxInferenceShouldNotYieldAnyOnUnions.types @@ -52,27 +52,27 @@ function ShouldInferFromData(props: Props): JSX.Element { ShouldInferFromData({ data: "1" }); >ShouldInferFromData({ data: "1" }) : JSX.Element >ShouldInferFromData : (props: Props) => JSX.Element ->{ data: "1" } : { data: string; } +>{ data: "1" } : { data: "1"; } >data : string >"1" : "1" ShouldInferFromData({ data: "1", convert: n => "" + n }); >ShouldInferFromData({ data: "1", convert: n => "" + n }) : JSX.Element >ShouldInferFromData : (props: Props) => JSX.Element ->{ data: "1", convert: n => "" + n } : { data: string; convert: (n: string) => string; } +>{ data: "1", convert: n => "" + n } : { data: "1"; convert: (n: "1") => string; } >data : string >"1" : "1" ->convert : (n: string) => string ->n => "" + n : (n: string) => string ->n : string +>convert : (n: "1") => string +>n => "" + n : (n: "1") => string +>n : "1" >"" + n : string >"" : "" ->n : string +>n : "1" ShouldInferFromData({ data: 2, convert: n => "" + n }); >ShouldInferFromData({ data: 2, convert: n => "" + n }) : JSX.Element >ShouldInferFromData : (props: Props) => JSX.Element ->{ data: 2, convert: n => "" + n } : { data: number; convert: (n: number) => string; } +>{ data: 2, convert: n => "" + n } : { data: 2; convert: (n: number) => string; } >data : number >2 : 2 >convert : (n: number) => string diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution11.types b/tests/baselines/reference/tsxSpreadAttributesResolution11.types index bcf6690a60000..027dde56044af 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution11.types +++ b/tests/baselines/reference/tsxSpreadAttributesResolution11.types @@ -20,7 +20,7 @@ const obj3: {y: true, overwrite: string } = { >y : true >true : true >overwrite : string ->{ y: true, overwrite: "hi"} : { y: true; overwrite: string; } +>{ y: true, overwrite: "hi"} : { y: true; overwrite: "hi"; } y: true, >y : boolean @@ -102,7 +102,7 @@ let x3 = obj1 : { x: 2; } >x : number >3 : 3 ->{y: true, x: 2, overwrite:"world"} : { y: true; x: 2; overwrite: string; } +>{y: true, x: 2, overwrite:"world"} : { y: true; x: 2; overwrite: "world"; } >y : boolean >true : true >x : number @@ -117,7 +117,7 @@ let x4 = >{x: 2} : { x: 2; } >x : number >2 : 2 ->{overwrite: "world"} : { overwrite: string; } +>{overwrite: "world"} : { overwrite: "world"; } >overwrite : string >"world" : "world" >{y: true} : { y: true; } diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution12.types b/tests/baselines/reference/tsxSpreadAttributesResolution12.types index bbeeac5a07385..12ca337f325b6 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution12.types +++ b/tests/baselines/reference/tsxSpreadAttributesResolution12.types @@ -20,7 +20,7 @@ const obj3: {y: false, overwrite: string} = { >y : false >false : false >overwrite : string ->{ y: false, overwrite: "hi"} : { y: false; overwrite: string; } +>{ y: false, overwrite: "hi"} : { y: false; overwrite: "hi"; } y: false, >y : boolean diff --git a/tests/baselines/reference/tsxSpreadAttributesResolution4.types b/tests/baselines/reference/tsxSpreadAttributesResolution4.types index bf952a719f967..534d2f88b4fe2 100644 --- a/tests/baselines/reference/tsxSpreadAttributesResolution4.types +++ b/tests/baselines/reference/tsxSpreadAttributesResolution4.types @@ -32,7 +32,7 @@ class Poisoned extends React.Component { const obj: PoisonedProp = { >obj : PoisonedProp >PoisonedProp : PoisonedProp ->{ x: "hello world", y: 2} : { x: string; y: 2; } +>{ x: "hello world", y: 2} : { x: "hello world"; y: 2; } x: "hello world", >x : string diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.types b/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.types index d1cc5774447df..d104a27158329 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.types +++ b/tests/baselines/reference/tsxStatelessFunctionComponentOverload2.types @@ -84,7 +84,7 @@ const c5 = >obj1 : { yy: boolean; } >yy : number >42 : 42 ->{yy1: "hi"} : { yy1: string; } +>{yy1: "hi"} : { yy1: "hi"; } >yy1 : string >"hi" : "hi" @@ -93,7 +93,7 @@ const c6 = > : JSX.Element >OneThing : { (): JSX.Element; (l: { yy: number; yy1: string; }): JSX.Element; } >obj1 : { yy: boolean; } ->{yy: 10000, yy1: "true"} : { yy: number; yy1: string; } +>{yy: 10000, yy1: "true"} : { yy: 10000; yy1: "true"; } >yy : number >10000 : 10000 >yy1 : string diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.types b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.types index 2758ca7e0df1a..a2da2d883d96c 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.types +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments1.types @@ -110,8 +110,8 @@ let i = { }} >i : JSX.Element > { }} /> : JSX.Element >InferParamComponent : (attr: InferParamProp) => JSX.Element ->values : number[] ->[1, 2, 3, 4] : number[] +>values : (1 | 2 | 3 | 4)[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt index 3e256c0e3a6a7..8db758b9b6a61 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.errors.txt @@ -8,8 +8,8 @@ tests/cases/conformance/jsx/file.tsx(20,19): error TS2322: Type '{ func: (a: num Type '{ func: (a: number, b: string) => void; }' is not assignable to type '{ func: (arg: number) => void; }'. Types of property 'func' are incompatible. Type '(a: number, b: string) => void' is not assignable to type '(arg: number) => void'. -tests/cases/conformance/jsx/file.tsx(31,30): error TS2322: Type '{ values: number[]; selectHandler: (val: string) => void; }' is not assignable to type 'IntrinsicAttributes & InferParamProp'. - Type '{ values: number[]; selectHandler: (val: string) => void; }' is not assignable to type 'InferParamProp'. +tests/cases/conformance/jsx/file.tsx(31,30): error TS2322: Type '{ values: (1 | 2 | 3 | 4)[]; selectHandler: (val: string) => void; }' is not assignable to type 'IntrinsicAttributes & InferParamProp'. + Type '{ values: (1 | 2 | 3 | 4)[]; selectHandler: (val: string) => void; }' is not assignable to type 'InferParamProp'. Types of property 'selectHandler' are incompatible. Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. Types of parameters 'val' and 'selectedVal' are incompatible. @@ -62,8 +62,8 @@ tests/cases/conformance/jsx/file.tsx(31,30): error TS2322: Type '{ values: numbe // Error let i = { }} />; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2322: Type '{ values: number[]; selectHandler: (val: string) => void; }' is not assignable to type 'IntrinsicAttributes & InferParamProp'. -!!! error TS2322: Type '{ values: number[]; selectHandler: (val: string) => void; }' is not assignable to type 'InferParamProp'. +!!! error TS2322: Type '{ values: (1 | 2 | 3 | 4)[]; selectHandler: (val: string) => void; }' is not assignable to type 'IntrinsicAttributes & InferParamProp'. +!!! error TS2322: Type '{ values: (1 | 2 | 3 | 4)[]; selectHandler: (val: string) => void; }' is not assignable to type 'InferParamProp'. !!! error TS2322: Types of property 'selectHandler' are incompatible. !!! error TS2322: Type '(val: string) => void' is not assignable to type '(selectedVal: number) => void'. !!! error TS2322: Types of parameters 'val' and 'selectedVal' are incompatible. diff --git a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.types b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.types index 851839ea921b6..baa71e83c6706 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.types +++ b/tests/baselines/reference/tsxStatelessFunctionComponentsWithTypeArguments2.types @@ -105,8 +105,8 @@ let i = i : JSX.Element > { }} /> : JSX.Element >InferParamComponent : (attr: InferParamProp) => JSX.Element ->values : number[] ->[1, 2, 3, 4] : number[] +>values : (1 | 2 | 3 | 4)[] +>[1, 2, 3, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/tsxUnionSpread.types b/tests/baselines/reference/tsxUnionSpread.types index 11e6308fe18c4..715c0fb7b6a2f 100644 --- a/tests/baselines/reference/tsxUnionSpread.types +++ b/tests/baselines/reference/tsxUnionSpread.types @@ -38,7 +38,7 @@ function getProps(): AnimalInfo { // this may be from server or whatever ... return { type: 'Cat', subType: 'Large' }; ->{ type: 'Cat', subType: 'Large' } : { type: "Cat"; subType: string; } +>{ type: 'Cat', subType: 'Large' } : { type: "Cat"; subType: "Large"; } >type : string >'Cat' : "Cat" >subType : string @@ -60,7 +60,7 @@ var component = var props2:AnimalInfo = { type: 'Cat', subType: 'Large' }; >props2 : AnimalInfo >AnimalInfo : AnimalInfo ->{ type: 'Cat', subType: 'Large' } : { type: "Cat"; subType: string; } +>{ type: 'Cat', subType: 'Large' } : { type: "Cat"; subType: "Large"; } >type : string >'Cat' : "Cat" >subType : string diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index 16a8f66ba79a3..76af6c09d9d3d 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -1,11 +1,11 @@ tests/cases/compiler/tupleTypes.ts(1,9): error TS1122: A tuple type element list cannot be empty. tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. Property '0' is missing in type 'undefined[]'. -tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[number]' is not assignable to type '[number, string]'. - Property '1' is missing in type '[number]'. +tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[1]' is not assignable to type '[number, string]'. + Property '1' is missing in type '[1]'. tests/cases/compiler/tupleTypes.ts(17,1): error TS2322: Type '[string, number]' is not assignable to type '[number, string]'. Type 'string' is not assignable to type 'number'. -tests/cases/compiler/tupleTypes.ts(18,1): error TS2322: Type '[number, string, number]' is not assignable to type '[number, string]'. +tests/cases/compiler/tupleTypes.ts(18,1): error TS2322: Type '[1, "hello", 2]' is not assignable to type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type 'undefined[]' is not assignable to type '[number, string]'. @@ -47,8 +47,8 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n !!! error TS2322: Property '0' is missing in type 'undefined[]'. t = [1]; // Error ~ -!!! error TS2322: Type '[number]' is not assignable to type '[number, string]'. -!!! error TS2322: Property '1' is missing in type '[number]'. +!!! error TS2322: Type '[1]' is not assignable to type '[number, string]'. +!!! error TS2322: Property '1' is missing in type '[1]'. t = [1, "hello"]; // Ok t = ["hello", 1]; // Error ~ @@ -56,7 +56,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n !!! error TS2322: Type 'string' is not assignable to type 'number'. t = [1, "hello", 2]; // Error ~ -!!! error TS2322: Type '[number, string, number]' is not assignable to type '[number, string]'. +!!! error TS2322: Type '[1, "hello", 2]' is not assignable to type '[number, string]'. !!! error TS2322: Types of property 'length' are incompatible. !!! error TS2322: Type '3' is not assignable to type '2'. diff --git a/tests/baselines/reference/tupleTypes.types b/tests/baselines/reference/tupleTypes.types index 3f68d4c7e2d53..cbfae7cc6466b 100644 --- a/tests/baselines/reference/tupleTypes.types +++ b/tests/baselines/reference/tupleTypes.types @@ -47,15 +47,15 @@ t = []; // Error >[] : undefined[] t = [1]; // Error ->t = [1] : [number] +>t = [1] : [1] >t : [number, string] ->[1] : [number] +>[1] : [1] >1 : 1 t = [1, "hello"]; // Ok ->t = [1, "hello"] : [number, string] +>t = [1, "hello"] : [1, "hello"] >t : [number, string] ->[1, "hello"] : [number, string] +>[1, "hello"] : [1, "hello"] >1 : 1 >"hello" : "hello" @@ -67,9 +67,9 @@ t = ["hello", 1]; // Error >1 : 1 t = [1, "hello", 2]; // Error ->t = [1, "hello", 2] : [number, string, number] +>t = [1, "hello", 2] : [1, "hello", 2] >t : [number, string] ->[1, "hello", 2] : [number, string, number] +>[1, "hello", 2] : [1, "hello", 2] >1 : 1 >"hello" : "hello" >2 : 2 @@ -77,7 +77,7 @@ t = [1, "hello", 2]; // Error var tf: [string, (x: string) => number] = ["hello", x => x.length]; >tf : [string, (x: string) => number] >x : string ->["hello", x => x.length] : [string, (x: string) => number] +>["hello", x => x.length] : ["hello", (x: string) => number] >"hello" : "hello" >x => x.length : (x: string) => number >x : string @@ -103,7 +103,7 @@ var ff1 = ff("hello", ["foo", x => x.length]); >ff("hello", ["foo", x => x.length]) : number >ff : (a: T, b: [T, (x: T) => U]) => U >"hello" : "hello" ->["foo", x => x.length] : [string, (x: string) => number] +>["foo", x => x.length] : ["foo", (x: string) => number] >"foo" : "foo" >x => x.length : (x: string) => number >x : string @@ -174,9 +174,9 @@ tt = tuple2(1, undefined); >undefined : undefined tt = [1, undefined]; ->tt = [1, undefined] : [number, undefined] +>tt = [1, undefined] : [1, undefined] >tt : [number, string] ->[1, undefined] : [number, undefined] +>[1, undefined] : [1, undefined] >1 : 1 >undefined : undefined diff --git a/tests/baselines/reference/typeAliases.types b/tests/baselines/reference/typeAliases.types index 6c8e897480c8d..7da9d4051b421 100644 --- a/tests/baselines/reference/typeAliases.types +++ b/tests/baselines/reference/typeAliases.types @@ -231,7 +231,7 @@ f16(x); var y: StringAndBoolean = ["1", false]; >y : [string, boolean] >StringAndBoolean : [string, boolean] ->["1", false] : [string, false] +>["1", false] : ["1", false] >"1" : "1" >false : false diff --git a/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types b/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types index 66e35a5a5356d..18e16604d2ffc 100644 --- a/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types +++ b/tests/baselines/reference/typeAnnotationBestCommonTypeInArrayLiteral.types @@ -23,9 +23,9 @@ interface IMenuItem { var menuData: IMenuItem[] = [ >menuData : IMenuItem[] >IMenuItem : IMenuItem ->[ { "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" }, { "id": "productName", "type": "default", "link": "", "text": "Product Name" }] : ({ "id": string; "type": string; "link": string; "icon": string; } | { "id": string; "type": string; "link": string; "text": string; })[] +>[ { "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" }, { "id": "productName", "type": "default", "link": "", "text": "Product Name" }] : ({ "id": "ourLogo"; "type": "image"; "link": ""; "icon": "modules/menu/logo.svg"; } | { "id": "productName"; "type": "default"; "link": ""; "text": "Product Name"; })[] { ->{ "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" } : { "id": string; "type": string; "link": string; "icon": string; } +>{ "id": "ourLogo", "type": "image", "link": "", "icon": "modules/menu/logo.svg" } : { "id": "ourLogo"; "type": "image"; "link": ""; "icon": "modules/menu/logo.svg"; } "id": "ourLogo", >"ourLogo" : "ourLogo" @@ -40,7 +40,7 @@ var menuData: IMenuItem[] = [ >"modules/menu/logo.svg" : "modules/menu/logo.svg" }, { ->{ "id": "productName", "type": "default", "link": "", "text": "Product Name" } : { "id": string; "type": string; "link": string; "text": string; } +>{ "id": "productName", "type": "default", "link": "", "text": "Product Name" } : { "id": "productName"; "type": "default"; "link": ""; "text": "Product Name"; } "id": "productName", >"productName" : "productName" diff --git a/tests/baselines/reference/typeArgInference2.types b/tests/baselines/reference/typeArgInference2.types index 2b985a7c208b9..fc5cc252135a1 100644 --- a/tests/baselines/reference/typeArgInference2.types +++ b/tests/baselines/reference/typeArgInference2.types @@ -36,33 +36,33 @@ var z3 = foo({ name: null }); // { name: any } >null : null var z4 = foo({ name: "abc" }); // { name: string } ->z4 : { name: string; } ->foo({ name: "abc" }) : { name: string; } +>z4 : { name: "abc"; } +>foo({ name: "abc" }) : { name: "abc"; } >foo : (x?: T, y?: T) => T ->{ name: "abc" } : { name: string; } +>{ name: "abc" } : { name: "abc"; } >name : string >"abc" : "abc" var z5 = foo({ name: "abc", a: 5 }); // { name: string; a: number } ->z5 : { name: string; a: number; } ->foo({ name: "abc", a: 5 }) : { name: string; a: number; } +>z5 : { name: "abc"; a: number; } +>foo({ name: "abc", a: 5 }) : { name: "abc"; a: number; } >foo : (x?: T, y?: T) => T ->{ name: "abc", a: 5 } : { name: string; a: number; } +>{ name: "abc", a: 5 } : { name: "abc"; a: 5; } >name : string >"abc" : "abc" >a : number >5 : 5 var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 }); // error ->z6 : { name: string; a: number; b?: undefined; } | { name: string; b: number; a?: undefined; } ->foo({ name: "abc", a: 5 }, { name: "def", b: 5 }) : { name: string; a: number; b?: undefined; } | { name: string; b: number; a?: undefined; } +>z6 : { name: "abc"; a: number; b?: undefined; } | { name: "def"; b: number; a?: undefined; } +>foo({ name: "abc", a: 5 }, { name: "def", b: 5 }) : { name: "abc"; a: number; b?: undefined; } | { name: "def"; b: number; a?: undefined; } >foo : (x?: T, y?: T) => T ->{ name: "abc", a: 5 } : { name: string; a: number; } +>{ name: "abc", a: 5 } : { name: "abc"; a: 5; } >name : string >"abc" : "abc" >a : number >5 : 5 ->{ name: "def", b: 5 } : { name: string; b: number; } +>{ name: "def", b: 5 } : { name: "def"; b: 5; } >name : string >"def" : "def" >b : number diff --git a/tests/baselines/reference/typeArgInferenceWithNull.types b/tests/baselines/reference/typeArgInferenceWithNull.types index 52f656f689024..d0cf45da42b33 100644 --- a/tests/baselines/reference/typeArgInferenceWithNull.types +++ b/tests/baselines/reference/typeArgInferenceWithNull.types @@ -44,9 +44,9 @@ fn6({ x: null }, y => { }, { x: "" }); // y has type { x: any }, but ideally wou >{ x: null } : { x: null; } >x : null >null : null ->y => { } : (y: { x: string; }) => void ->y : { x: string; } ->{ x: "" } : { x: string; } +>y => { } : (y: { x: ""; }) => void +>y : { x: ""; } +>{ x: "" } : { x: ""; } >x : string >"" : "" diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index cfed6cc640bda..6ed03b4e48da5 100644 --- a/tests/baselines/reference/typeArgumentInference.errors.txt +++ b/tests/baselines/reference/typeArgumentInference.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(68,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(83,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts 81:4, but here has type '{}'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74): error TS2345: Argument of type '{ x: 6; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. @@ -94,7 +94,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74 !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts 81:4, but here has type '{}'. var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); ~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. +!!! error TS2345: Argument of type '{ x: 6; y: string; }' is not assignable to parameter of type 'A92'. !!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. var a9f: A92; diff --git a/tests/baselines/reference/typeArgumentInference.types b/tests/baselines/reference/typeArgumentInference.types index 1f39235ae36ff..a7b94897f1640 100644 --- a/tests/baselines/reference/typeArgumentInference.types +++ b/tests/baselines/reference/typeArgumentInference.types @@ -154,7 +154,7 @@ someGenerics3(() => undefined); someGenerics3(() => 3); >someGenerics3(() => 3) : void >someGenerics3 : (producer: () => T) => void ->() => 3 : () => number +>() => 3 : () => 3 >3 : 3 // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type @@ -387,10 +387,10 @@ var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); >someGenerics9 : (a: T, b: T, c: T) => T >a : number >b : string ->{ a: 0 } : { a: number; } +>{ a: 0 } : { a: 0; } >a : number >0 : 0 ->{ b: '' } : { b: string; } +>{ b: '' } : { b: ""; } >b : string >'' : "" >null : null @@ -425,13 +425,13 @@ var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); >someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }) : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : (a: T, b: T, c: T) => T >undefined : undefined ->{ x: 6, z: new Date() } : { x: number; z: Date; } +>{ x: 6, z: new Date() } : { x: 6; z: Date; } >x : number >6 : 6 >z : Date >new Date() : Date >Date : DateConstructor ->{ x: 6, y: '' } : { x: number; y: string; } +>{ x: 6, y: '' } : { x: 6; y: ""; } >x : number >6 : 6 >y : string @@ -467,13 +467,13 @@ var a9d = someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); >a9d : { x: number; } >someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }) : { x: number; } >someGenerics9 : (a: T, b: T, c: T) => T ->{ x: 3 } : { x: number; } +>{ x: 3 } : { x: 3; } >x : number >3 : 3 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index ef0c93f20cda5..1810f8acf4126 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -14,7 +14,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,51): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(121,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts 119:4, but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,56): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,74): error TS2345: Argument of type '{ x: 6; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. @@ -168,7 +168,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct ~~~~~~ !!! error TS2304: Cannot find name 'window'. ~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. +!!! error TS2345: Argument of type '{ x: 6; y: string; }' is not assignable to parameter of type 'A92'. !!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. var a9f: A92; diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types index 04dae1dafa758..6eeabe7393589 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types @@ -196,7 +196,7 @@ new someGenerics3(() => undefined); new someGenerics3(() => 3); >new someGenerics3(() => 3) : any >someGenerics3 : someGenerics3 ->() => 3 : () => number +>() => 3 : () => 3 >3 : 3 // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type @@ -490,10 +490,10 @@ var a9b = new someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, nu >someGenerics9 : someGenerics9 >a : number >b : string ->{ a: 0 } : { a: number; } +>{ a: 0 } : { a: 0; } >a : number >0 : 0 ->{ b: '' } : { b: string; } +>{ b: '' } : { b: ""; } >b : string >'' : "" >null : null @@ -528,12 +528,12 @@ var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : someGenerics9 >undefined : undefined ->{ x: 6, z: window } : { x: number; z: any; } +>{ x: 6, z: window } : { x: 6; z: any; } >x : number >6 : 6 >z : any >window : any ->{ x: 6, y: '' } : { x: number; y: string; } +>{ x: 6, y: '' } : { x: 6; y: ""; } >x : number >6 : 6 >y : string @@ -568,13 +568,13 @@ var a9d = new someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); >a9d : { x: number; } >new someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }) : { x: number; } >someGenerics9 : someGenerics9 ->{ x: 3 } : { x: number; } +>{ x: 3 } : { x: 3; } >x : number >3 : 3 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 2b3053906896d..fdf990b43c39a 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,47): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(88,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts 86:4, but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,52): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,70): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,70): error TS2345: Argument of type '{ x: 6; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. @@ -150,7 +150,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst ~~~~~~ !!! error TS2304: Cannot find name 'window'. ~~~~~ -!!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. +!!! error TS2345: Argument of type '{ x: 6; y: string; }' is not assignable to parameter of type 'A92'. !!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. var a9f: A92; diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types index 4ca65f02b02b8..b6ea681a8d60c 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types @@ -168,7 +168,7 @@ someGenerics3(() => undefined); someGenerics3(() => 3); // Error >someGenerics3(() => 3) : void >someGenerics3 : (producer: () => T) => void ->() => 3 : () => number +>() => 3 : () => 3 >3 : 3 // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type @@ -430,10 +430,10 @@ var a9b = someGenerics9<{ a?: number; b?: string; }>({ a: 0 }, { b: '' }, null); >someGenerics9 : (a: T, b: T, c: T) => T >a : number >b : string ->{ a: 0 } : { a: number; } +>{ a: 0 } : { a: 0; } >a : number >0 : 0 ->{ b: '' } : { b: string; } +>{ b: '' } : { b: ""; } >b : string >'' : "" >null : null @@ -468,12 +468,12 @@ var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : (a: T, b: T, c: T) => T >undefined : undefined ->{ x: 6, z: window } : { x: number; z: any; } +>{ x: 6, z: window } : { x: 6; z: any; } >x : number >6 : 6 >z : any >window : any ->{ x: 6, y: '' } : { x: number; y: string; } +>{ x: 6, y: '' } : { x: 6; y: ""; } >x : number >6 : 6 >y : string @@ -508,13 +508,13 @@ var a9d = someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }); >a9d : { x: number; } >someGenerics9({ x: 3 }, { x: 6 }, { x: 6 }) : { x: number; } >someGenerics9 : (a: T, b: T, c: T) => T ->{ x: 3 } : { x: number; } +>{ x: 3 } : { x: 3; } >x : number >3 : 3 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 ->{ x: 6 } : { x: number; } +>{ x: 6 } : { x: 6; } >x : number >6 : 6 diff --git a/tests/baselines/reference/typeGuardsAsAssertions.types b/tests/baselines/reference/typeGuardsAsAssertions.types index bd11b4a6f2057..3817e9416ec61 100644 --- a/tests/baselines/reference/typeGuardsAsAssertions.types +++ b/tests/baselines/reference/typeGuardsAsAssertions.types @@ -24,7 +24,7 @@ export interface Some { readonly some: a; } export const none : None = { none: '' }; >none : None >None : None ->{ none: '' } : { none: string; } +>{ none: '' } : { none: ""; } >none : string >'' : "" diff --git a/tests/baselines/reference/typeGuardsOnClassProperty.types b/tests/baselines/reference/typeGuardsOnClassProperty.types index f4c3542344f2f..c5bd40ad38516 100644 --- a/tests/baselines/reference/typeGuardsOnClassProperty.types +++ b/tests/baselines/reference/typeGuardsOnClassProperty.types @@ -67,7 +67,7 @@ var o: { >prop2 : string | boolean } = { ->{ prop1: "string" , prop2: true } : { prop1: string; prop2: true; } +>{ prop1: "string" , prop2: true } : { prop1: "string"; prop2: true; } prop1: "string" , >prop1 : string diff --git a/tests/baselines/reference/typeInferenceFBoundedTypeParams.types b/tests/baselines/reference/typeInferenceFBoundedTypeParams.types index a6d0a51dd45db..cd3d11d123922 100644 --- a/tests/baselines/reference/typeInferenceFBoundedTypeParams.types +++ b/tests/baselines/reference/typeInferenceFBoundedTypeParams.types @@ -60,7 +60,7 @@ fold( >fold : (values: a[], result: r, fold: (result: r, value: a) => r) => r [1, 2, 3], ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 @@ -80,7 +80,7 @@ fold( >result : [string, string][] ["", ""] ->["", ""] : [string, string] +>["", ""] : ["", ""] >"" : "" >"" : "" diff --git a/tests/baselines/reference/typeInferenceWithExcessProperties.types b/tests/baselines/reference/typeInferenceWithExcessProperties.types index af3e1baae90ab..eccc53840d6d6 100644 --- a/tests/baselines/reference/typeInferenceWithExcessProperties.types +++ b/tests/baselines/reference/typeInferenceWithExcessProperties.types @@ -22,9 +22,9 @@ function parrot(obj: T): T { parrot({ ->parrot({ name: "TypeScript",}) : { name: string; } +>parrot({ name: "TypeScript",}) : { name: "TypeScript"; } >parrot : (obj: T) => T ->{ name: "TypeScript",} : { name: string; } +>{ name: "TypeScript",} : { name: "TypeScript"; } name: "TypeScript", >name : string @@ -33,9 +33,9 @@ parrot({ }); parrot({ ->parrot({ name: "TypeScript", age: 5,}) : { name: string; age: number; } +>parrot({ name: "TypeScript", age: 5,}) : { name: "TypeScript"; age: number; } >parrot : (obj: T) => T ->{ name: "TypeScript", age: 5,} : { name: string; age: number; } +>{ name: "TypeScript", age: 5,} : { name: "TypeScript"; age: 5; } name: "TypeScript", >name : string @@ -48,9 +48,9 @@ parrot({ }); parrot({ ->parrot({ name: "TypeScript", age: function () { },}) : { name: string; age: () => void; } +>parrot({ name: "TypeScript", age: function () { },}) : { name: "TypeScript"; age: () => void; } >parrot : (obj: T) => T ->{ name: "TypeScript", age: function () { },} : { name: string; age: () => void; } +>{ name: "TypeScript", age: function () { },} : { name: "TypeScript"; age: () => void; } name: "TypeScript", >name : string @@ -63,9 +63,9 @@ parrot({ }); parrot({ ->parrot({ name: "TypeScript", sayHello() { },}) : { name: string; sayHello(): void; } +>parrot({ name: "TypeScript", sayHello() { },}) : { name: "TypeScript"; sayHello(): void; } >parrot : (obj: T) => T ->{ name: "TypeScript", sayHello() { },} : { name: string; sayHello(): void; } +>{ name: "TypeScript", sayHello() { },} : { name: "TypeScript"; sayHello(): void; } name: "TypeScript", >name : string diff --git a/tests/baselines/reference/typeInferenceWithTupleType.types b/tests/baselines/reference/typeInferenceWithTupleType.types index a7f8bff679815..e48d9cdcf0c33 100644 --- a/tests/baselines/reference/typeInferenceWithTupleType.types +++ b/tests/baselines/reference/typeInferenceWithTupleType.types @@ -102,10 +102,10 @@ var zipResult = zip(["foo", "bar"], [5, 6]); >zipResult : [[string, number]] >zip(["foo", "bar"], [5, 6]) : [[string, number]] >zip : (array1: T[], array2: U[]) => [[T, U]] ->["foo", "bar"] : string[] +>["foo", "bar"] : ("foo" | "bar")[] >"foo" : "foo" >"bar" : "bar" ->[5, 6] : number[] +>[5, 6] : (5 | 6)[] >5 : 5 >6 : 6 diff --git a/tests/baselines/reference/typeMatch2.errors.txt b/tests/baselines/reference/typeMatch2.errors.txt index 19ac6def2a9e7..c4caa329face7 100644 --- a/tests/baselines/reference/typeMatch2.errors.txt +++ b/tests/baselines/reference/typeMatch2.errors.txt @@ -1,10 +1,10 @@ tests/cases/compiler/typeMatch2.ts(3,2): error TS2322: Type '{}' is not assignable to type '{ x: number; y: number; }'. Property 'x' is missing in type '{}'. -tests/cases/compiler/typeMatch2.ts(4,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. - Property 'y' is missing in type '{ x: number; }'. -tests/cases/compiler/typeMatch2.ts(5,20): error TS2322: Type '{ x: number; y: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. +tests/cases/compiler/typeMatch2.ts(4,5): error TS2322: Type '{ x: 1; }' is not assignable to type '{ x: number; y: number; }'. + Property 'y' is missing in type '{ x: 1; }'. +tests/cases/compiler/typeMatch2.ts(5,20): error TS2322: Type '{ x: 1; y: 2; z: number; }' is not assignable to type '{ x: number; y: number; }'. Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. -tests/cases/compiler/typeMatch2.ts(6,17): error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. +tests/cases/compiler/typeMatch2.ts(6,17): error TS2322: Type '{ x: 1; z: number; }' is not assignable to type '{ x: number; y: number; }'. Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. tests/cases/compiler/typeMatch2.ts(18,5): error TS2322: Type 'Animal[]' is not assignable to type 'Giraffe[]'. Type 'Animal' is not assignable to type 'Giraffe'. @@ -12,10 +12,10 @@ tests/cases/compiler/typeMatch2.ts(18,5): error TS2322: Type 'Animal[]' is not a tests/cases/compiler/typeMatch2.ts(22,5): error TS2322: Type '{ f1: number; f2: Animal[]; }' is not assignable to type '{ f1: number; f2: Giraffe[]; }'. Types of property 'f2' are incompatible. Type 'Animal[]' is not assignable to type 'Giraffe[]'. -tests/cases/compiler/typeMatch2.ts(34,26): error TS2322: Type '{ x: number; y: any; z: number; }' is not assignable to type '{ x: number; y: number; }'. +tests/cases/compiler/typeMatch2.ts(34,26): error TS2322: Type '{ x: 1; y: any; z: number; }' is not assignable to type '{ x: number; y: number; }'. Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. -tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. - Property 'y' is missing in type '{ x: number; }'. +tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: 1; }' is not assignable to type '{ x: number; y: number; }'. + Property 'y' is missing in type '{ x: 1; }'. ==== tests/cases/compiler/typeMatch2.ts (8 errors) ==== @@ -27,15 +27,15 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is !!! error TS2322: Property 'x' is missing in type '{}'. a = { x: 1 }; // error ~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. -!!! error TS2322: Property 'y' is missing in type '{ x: number; }'. +!!! error TS2322: Type '{ x: 1; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Property 'y' is missing in type '{ x: 1; }'. a = { x: 1, y: 2, z: 3 }; ~~~~ -!!! error TS2322: Type '{ x: number; y: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Type '{ x: 1; y: 2; z: number; }' is not assignable to type '{ x: number; y: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. a = { x: 1, z: 3 }; // error ~~~~ -!!! error TS2322: Type '{ x: number; z: number; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Type '{ x: 1; z: number; }' is not assignable to type '{ x: number; y: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. } @@ -74,12 +74,12 @@ tests/cases/compiler/typeMatch2.ts(35,5): error TS2322: Type '{ x: number; }' is a = { x: 1, y: _any }; a = { x: 1, y: _any, z:1 }; ~~~ -!!! error TS2322: Type '{ x: number; y: any; z: number; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Type '{ x: 1; y: any; z: number; }' is not assignable to type '{ x: number; y: number; }'. !!! error TS2322: Object literal may only specify known properties, and 'z' does not exist in type '{ x: number; y: number; }'. a = { x: 1 }; // error ~ -!!! error TS2322: Type '{ x: number; }' is not assignable to type '{ x: number; y: number; }'. -!!! error TS2322: Property 'y' is missing in type '{ x: number; }'. +!!! error TS2322: Type '{ x: 1; }' is not assignable to type '{ x: number; y: number; }'. +!!! error TS2322: Property 'y' is missing in type '{ x: 1; }'. var mf = function m(n) { return false; }; var zf = function z(n: number) { return true; }; mf=zf; diff --git a/tests/baselines/reference/typeMatch2.types b/tests/baselines/reference/typeMatch2.types index 152e68bfcb7b7..48c9893b9aea8 100644 --- a/tests/baselines/reference/typeMatch2.types +++ b/tests/baselines/reference/typeMatch2.types @@ -16,16 +16,16 @@ function f1() { >{} : {} a = { x: 1 }; // error ->a = { x: 1 } : { x: number; } +>a = { x: 1 } : { x: 1; } >a : { x: number; y: number; } ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 a = { x: 1, y: 2, z: 3 }; ->a = { x: 1, y: 2, z: 3 } : { x: number; y: number; z: number; } +>a = { x: 1, y: 2, z: 3 } : { x: 1; y: 2; z: number; } >a : { x: number; y: number; } ->{ x: 1, y: 2, z: 3 } : { x: number; y: number; z: number; } +>{ x: 1, y: 2, z: 3 } : { x: 1; y: 2; z: number; } >x : number >1 : 1 >y : number @@ -34,9 +34,9 @@ function f1() { >3 : 3 a = { x: 1, z: 3 }; // error ->a = { x: 1, z: 3 } : { x: number; z: number; } +>a = { x: 1, z: 3 } : { x: 1; z: number; } >a : { x: number; y: number; } ->{ x: 1, z: 3 } : { x: number; z: number; } +>{ x: 1, z: 3 } : { x: 1; z: number; } >x : number >1 : 1 >z : number @@ -146,36 +146,36 @@ function f4() { >1 : 1 a = { x: 1, y: null }; ->a = { x: 1, y: null } : { x: number; y: null; } +>a = { x: 1, y: null } : { x: 1; y: null; } >a : { x: number; y: number; } ->{ x: 1, y: null } : { x: number; y: null; } +>{ x: 1, y: null } : { x: 1; y: null; } >x : number >1 : 1 >y : null >null : null a = { x: 1, y: undefined }; ->a = { x: 1, y: undefined } : { x: number; y: undefined; } +>a = { x: 1, y: undefined } : { x: 1; y: undefined; } >a : { x: number; y: number; } ->{ x: 1, y: undefined } : { x: number; y: undefined; } +>{ x: 1, y: undefined } : { x: 1; y: undefined; } >x : number >1 : 1 >y : undefined >undefined : undefined a = { x: 1, y: _any }; ->a = { x: 1, y: _any } : { x: number; y: any; } +>a = { x: 1, y: _any } : { x: 1; y: any; } >a : { x: number; y: number; } ->{ x: 1, y: _any } : { x: number; y: any; } +>{ x: 1, y: _any } : { x: 1; y: any; } >x : number >1 : 1 >y : any >_any : any a = { x: 1, y: _any, z:1 }; ->a = { x: 1, y: _any, z:1 } : { x: number; y: any; z: number; } +>a = { x: 1, y: _any, z:1 } : { x: 1; y: any; z: number; } >a : { x: number; y: number; } ->{ x: 1, y: _any, z:1 } : { x: number; y: any; z: number; } +>{ x: 1, y: _any, z:1 } : { x: 1; y: any; z: number; } >x : number >1 : 1 >y : any @@ -184,9 +184,9 @@ function f4() { >1 : 1 a = { x: 1 }; // error ->a = { x: 1 } : { x: number; } +>a = { x: 1 } : { x: 1; } >a : { x: number; y: number; } ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types index 885b655b74952..a9c17454832a5 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint.types @@ -60,10 +60,10 @@ var r3 = foo({ x: 1 }, { x: 2, y: 3 }); >r3 : { x: number; y: number; } >foo({ x: 1 }, { x: 2, y: 3 }) : { x: number; y: number; } >foo : (x: T, y: U) => U ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 ->{ x: 2, y: 3 } : { x: number; y: number; } +>{ x: 2, y: 3 } : { x: 2; y: 3; } >x : number >2 : 2 >y : number @@ -91,7 +91,7 @@ foo2({}, { length: 2 }); >foo2({}, { length: 2 }) : { length: number; } >foo2 : (x: T, y: U) => U >{} : {} ->{ length: 2 } : { length: number; } +>{ length: 2 } : { length: 2; } >length : number >2 : 2 @@ -99,7 +99,7 @@ foo2(1, { width: 3, length: 2 }); >foo2(1, { width: 3, length: 2 }) : { width: number; length: number; } >foo2 : (x: T, y: U) => U >1 : 1 ->{ width: 3, length: 2 } : { width: number; length: number; } +>{ width: 3, length: 2 } : { width: 3; length: 2; } >width : number >3 : 3 >length : number @@ -115,6 +115,6 @@ foo2(1, ['']); >foo2(1, ['']) : string[] >foo2 : (x: T, y: U) => U >1 : 1 ->[''] : string[] +>[''] : ""[] >'' : "" diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types index 8e5f04507bbdf..6890ebb6a4997 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively.types @@ -54,15 +54,15 @@ foo(1, 2, 3); foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: '', z: true }); >foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: '', z: true }) : { x: number; y: string; z: boolean; } >foo : (x: T, y: U, z: V) => V ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 ->{ x: 1, y: '' } : { x: number; y: string; } +>{ x: 1, y: '' } : { x: 1; y: ""; } >x : number >1 : 1 >y : string >'' : "" ->{ x: 2, y: '', z: true } : { x: number; y: string; z: true; } +>{ x: 2, y: '', z: true } : { x: 2; y: ""; z: true; } >x : number >2 : 2 >y : string @@ -82,7 +82,7 @@ foo(a, b, { foo: 1, bar: '', hm: true }); >foo : (x: T, y: U, z: V) => V >a : A >b : B ->{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: true; } +>{ foo: 1, bar: '', hm: true } : { foo: 1; bar: ""; hm: true; } >foo : number >1 : 1 >bar : string @@ -135,7 +135,7 @@ foo(b, b, { foo: 1, bar: '', hm: '' }); >foo : (x: T, y: U, z: V) => V >b : B >b : B ->{ foo: 1, bar: '', hm: '' } : { foo: number; bar: string; hm: string; } +>{ foo: 1, bar: '', hm: '' } : { foo: 1; bar: ""; hm: ""; } >foo : number >1 : 1 >bar : string diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types index 80e800cb1e052..a800078077321 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraintTransitively2.types @@ -54,15 +54,15 @@ foo(1, 2, ''); foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }); >foo({ x: 1 }, { x: 1, y: '' }, { x: 2, y: 2, z: true }) : { x: number; y: number; z: boolean; } >foo : (x: T, y: U, z: V) => V ->{ x: 1 } : { x: number; } +>{ x: 1 } : { x: 1; } >x : number >1 : 1 ->{ x: 1, y: '' } : { x: number; y: string; } +>{ x: 1, y: '' } : { x: 1; y: ""; } >x : number >1 : 1 >y : string >'' : "" ->{ x: 2, y: 2, z: true } : { x: number; y: number; z: true; } +>{ x: 2, y: 2, z: true } : { x: 2; y: 2; z: true; } >x : number >2 : 2 >y : number @@ -81,7 +81,7 @@ foo(a, { foo: 1, bar: '', hm: true }, b); >foo(a, { foo: 1, bar: '', hm: true }, b) : B >foo : (x: T, y: U, z: V) => V >a : A ->{ foo: 1, bar: '', hm: true } : { foo: number; bar: string; hm: true; } +>{ foo: 1, bar: '', hm: true } : { foo: 1; bar: ""; hm: true; } >foo : number >1 : 1 >bar : string diff --git a/tests/baselines/reference/typeVal.types b/tests/baselines/reference/typeVal.types index 26944f231b23a..fa7896e1fcb81 100644 --- a/tests/baselines/reference/typeVal.types +++ b/tests/baselines/reference/typeVal.types @@ -9,7 +9,7 @@ interface I { var I:I = { I: 3}; >I : I >I : I ->{ I: 3} : { I: number; } +>{ I: 3} : { I: 3; } >I : number >3 : 3 diff --git a/tests/baselines/reference/typeofInterface.types b/tests/baselines/reference/typeofInterface.types index fad9b02900444..b28fec874f534 100644 --- a/tests/baselines/reference/typeofInterface.types +++ b/tests/baselines/reference/typeofInterface.types @@ -23,7 +23,7 @@ var j: typeof k.foo = { a: "hello" }; >k.foo : { a: string; } >k : I >foo : { a: string; } ->{ a: "hello" } : { a: string; } +>{ a: "hello" } : { a: "hello"; } >a : string >"hello" : "hello" diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.types b/tests/baselines/reference/typeofOperatorWithNumberType.types index 918fe2dcc3d4f..cf34224dc0a01 100644 --- a/tests/baselines/reference/typeofOperatorWithNumberType.types +++ b/tests/baselines/reference/typeofOperatorWithNumberType.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/typeofOperatorWithStringType.types b/tests/baselines/reference/typeofOperatorWithStringType.types index ca4f445c9e613..ee0898dc15ede 100644 --- a/tests/baselines/reference/typeofOperatorWithStringType.types +++ b/tests/baselines/reference/typeofOperatorWithStringType.types @@ -5,7 +5,7 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] ->["", "abc"] : string[] +>["", "abc"] : ("" | "abc")[] >"" : "" >"abc" : "abc" diff --git a/tests/baselines/reference/types.asyncGenerators.esnext.1.types b/tests/baselines/reference/types.asyncGenerators.esnext.1.types index 6e29e9cc95cab..6be418c07b976 100644 --- a/tests/baselines/reference/types.asyncGenerators.esnext.1.types +++ b/tests/baselines/reference/types.asyncGenerators.esnext.1.types @@ -76,7 +76,7 @@ async function * inferReturnType8() { const assignability1: () => AsyncIterableIterator = async function * () { >assignability1 : () => AsyncIterableIterator >AsyncIterableIterator : AsyncIterableIterator ->async function * () { yield 1;} : () => AsyncIterableIterator +>async function * () { yield 1;} : () => AsyncIterableIterator<1> yield 1; >yield 1 : any @@ -141,7 +141,7 @@ const assignability5: () => AsyncIterableIterator = async function * () const assignability6: () => AsyncIterable = async function * () { >assignability6 : () => AsyncIterable >AsyncIterable : AsyncIterable ->async function * () { yield 1;} : () => AsyncIterableIterator +>async function * () { yield 1;} : () => AsyncIterableIterator<1> yield 1; >yield 1 : any @@ -206,7 +206,7 @@ const assignability10: () => AsyncIterable = async function * () { const assignability11: () => AsyncIterator = async function * () { >assignability11 : () => AsyncIterator >AsyncIterator : AsyncIterator ->async function * () { yield 1;} : () => AsyncIterableIterator +>async function * () { yield 1;} : () => AsyncIterableIterator<1> yield 1; >yield 1 : any diff --git a/tests/baselines/reference/types.asyncGenerators.esnext.2.types b/tests/baselines/reference/types.asyncGenerators.esnext.2.types index c9f8e9216c4a8..6ba5bd2776c27 100644 --- a/tests/baselines/reference/types.asyncGenerators.esnext.2.types +++ b/tests/baselines/reference/types.asyncGenerators.esnext.2.types @@ -23,7 +23,7 @@ async function * inferReturnType3() { >Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } >Promise : PromiseConstructor >resolve : { (value: T | PromiseLike): Promise; (): Promise; } ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 } diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index 4ab097e3316c9..f841321c6f6bc 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -13,7 +13,7 @@ _.each([1, 2, 3], (num) => alert(num.toString())); >_.each : { (list: T[], iterator: Iterator_, context?: any): void; (list: Dictionary, iterator: Iterator_, context?: any): void; } >_ : Underscore.Static >each : { (list: T[], iterator: Iterator_, context?: any): void; (list: Dictionary, iterator: Iterator_, context?: any): void; } ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 @@ -31,7 +31,7 @@ _.each({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => alert(valu >_.each : { (list: T[], iterator: Iterator_, context?: any): void; (list: Dictionary, iterator: Iterator_, context?: any): void; } >_ : Underscore.Static >each : { (list: T[], iterator: Iterator_, context?: any): void; (list: Dictionary, iterator: Iterator_, context?: any): void; } ->{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } +>{ one: 1, two: 2, three: 3 } : { one: 1; two: 2; three: 3; } >one : number >1 : 1 >two : number @@ -53,7 +53,7 @@ _.map([1, 2, 3], (num) => num * 3); >_.map : { (list: T[], iterator: Iterator_, context?: any): U[]; (list: Dictionary, iterator: Iterator_, context?: any): U[]; } >_ : Underscore.Static >map : { (list: T[], iterator: Iterator_, context?: any): U[]; (list: Dictionary, iterator: Iterator_, context?: any): U[]; } ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 @@ -68,7 +68,7 @@ _.map({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => value * 3); >_.map : { (list: T[], iterator: Iterator_, context?: any): U[]; (list: Dictionary, iterator: Iterator_, context?: any): U[]; } >_ : Underscore.Static >map : { (list: T[], iterator: Iterator_, context?: any): U[]; (list: Dictionary, iterator: Iterator_, context?: any): U[]; } ->{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } +>{ one: 1, two: 2, three: 3 } : { one: 1; two: 2; three: 3; } >one : number >1 : 1 >two : number @@ -88,7 +88,7 @@ var sum = _.reduce([1, 2, 3], (memo, num) => memo + num, 0); >_.reduce : { (list: T[], iterator: Reducer, initialValue?: T, context?: any): T; (list: T[], iterator: Reducer, initialValue: U, context?: any): U; (list: Dictionary, iterator: Reducer, initialValue?: T, context?: any): T; (list: Dictionary, iterator: Reducer, initialValue: U, context?: any): U; } >_ : Underscore.Static >reduce : { (list: T[], iterator: Reducer, initialValue?: T, context?: any): T; (list: T[], iterator: Reducer, initialValue: U, context?: any): U; (list: Dictionary, iterator: Reducer, initialValue?: T, context?: any): T; (list: Dictionary, iterator: Reducer, initialValue: U, context?: any): U; } ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 @@ -136,7 +136,7 @@ var even = _.find([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >_.find : { (list: T[], iterator: Iterator_, context?: any): T; (list: Dictionary, iterator: Iterator_, context?: any): T; } >_ : Underscore.Static >find : { (list: T[], iterator: Iterator_, context?: any): T; (list: Dictionary, iterator: Iterator_, context?: any): T; } ->[1, 2, 3, 4, 5, 6] : number[] +>[1, 2, 3, 4, 5, 6] : (1 | 2 | 3 | 4 | 5 | 6)[] >1 : 1 >2 : 2 >3 : 3 @@ -157,7 +157,7 @@ var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >_.filter : { (list: T[], iterator: Iterator_, context?: any): T[]; (list: Dictionary, iterator: Iterator_, context?: any): T[]; } >_ : Underscore.Static >filter : { (list: T[], iterator: Iterator_, context?: any): T[]; (list: Dictionary, iterator: Iterator_, context?: any): T[]; } ->[1, 2, 3, 4, 5, 6] : number[] +>[1, 2, 3, 4, 5, 6] : (1 | 2 | 3 | 4 | 5 | 6)[] >1 : 1 >2 : 2 >3 : 3 @@ -215,7 +215,7 @@ var odds = _.reject([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0); >_.reject : { (list: T[], iterator: Iterator_, context?: any): T[]; (list: Dictionary, iterator: Iterator_, context?: any): T[]; } >_ : Underscore.Static >reject : { (list: T[], iterator: Iterator_, context?: any): T[]; (list: Dictionary, iterator: Iterator_, context?: any): T[]; } ->[1, 2, 3, 4, 5, 6] : number[] +>[1, 2, 3, 4, 5, 6] : (1 | 2 | 3 | 4 | 5 | 6)[] >1 : 1 >2 : 2 >3 : 3 @@ -260,7 +260,7 @@ _.contains([1, 2, 3], 3); >_.contains : { (list: T[], value: T): boolean; (list: Dictionary, value: T): boolean; } >_ : Underscore.Static >contains : { (list: T[], value: T): boolean; (list: Dictionary, value: T): boolean; } ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 @@ -342,7 +342,7 @@ _.sortBy([1, 2, 3, 4, 5, 6], (num) => Math.sin(num)); >_.sortBy : { (list: T[], iterator: Iterator_, context?: any): T[]; (list: Dictionary, iterator: Iterator_, context?: any): T[]; (list: T[], propertyName: string): T[]; (list: Dictionary, propertyName: string): T[]; } >_ : Underscore.Static >sortBy : { (list: T[], iterator: Iterator_, context?: any): T[]; (list: Dictionary, iterator: Iterator_, context?: any): T[]; (list: T[], propertyName: string): T[]; (list: Dictionary, propertyName: string): T[]; } ->[1, 2, 3, 4, 5, 6] : number[] +>[1, 2, 3, 4, 5, 6] : (1 | 2 | 3 | 4 | 5 | 6)[] >1 : 1 >2 : 2 >3 : 3 @@ -364,7 +364,7 @@ _([1.3, 2.1, 2.4]).groupBy((e: number, i?: number, list?: number[]) => Math.floo >_([1.3, 2.1, 2.4]).groupBy : { (iterator?: Iterator_, context?: any): Dictionary; (propertyName: string): Dictionary; } >_([1.3, 2.1, 2.4]) : Underscore.WrappedArray >_ : Underscore.Static ->[1.3, 2.1, 2.4] : number[] +>[1.3, 2.1, 2.4] : (1.3 | 2.1 | 2.4)[] >1.3 : 1.3 >2.1 : 2.1 >2.4 : 2.4 @@ -384,7 +384,7 @@ _.groupBy([1.3, 2.1, 2.4], (num: number) => Math.floor(num)); >_.groupBy : { (list: T[], iterator?: Iterator_, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator_, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } >_ : Underscore.Static >groupBy : { (list: T[], iterator?: Iterator_, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator_, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } ->[1.3, 2.1, 2.4] : number[] +>[1.3, 2.1, 2.4] : (1.3 | 2.1 | 2.4)[] >1.3 : 1.3 >2.1 : 2.1 >2.4 : 2.4 @@ -401,7 +401,7 @@ _.groupBy(['one', 'two', 'three'], 'length'); >_.groupBy : { (list: T[], iterator?: Iterator_, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator_, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } >_ : Underscore.Static >groupBy : { (list: T[], iterator?: Iterator_, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator_, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } ->['one', 'two', 'three'] : string[] +>['one', 'two', 'three'] : ("one" | "two" | "three")[] >'one' : "one" >'two' : "two" >'three' : "three" @@ -412,7 +412,7 @@ _.countBy([1, 2, 3, 4, 5], (num) => num % 2 == 0 ? 'even' : 'odd'); >_.countBy : { (list: T[], iterator?: Iterator_, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator_, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } >_ : Underscore.Static >countBy : { (list: T[], iterator?: Iterator_, context?: any): Dictionary; (list: Dictionary, iterator?: Iterator_, context?: any): Dictionary; (list: T[], propertyName: string): Dictionary; (list: Dictionary, propertyName: string): Dictionary; } ->[1, 2, 3, 4, 5] : number[] +>[1, 2, 3, 4, 5] : (1 | 2 | 3 | 4 | 5)[] >1 : 1 >2 : 2 >3 : 3 @@ -434,7 +434,7 @@ _.shuffle([1, 2, 3, 4, 5, 6]); >_.shuffle : { (list: T[]): T[]; (list: Dictionary): T[]; } >_ : Underscore.Static >shuffle : { (list: T[]): T[]; (list: Dictionary): T[]; } ->[1, 2, 3, 4, 5, 6] : number[] +>[1, 2, 3, 4, 5, 6] : (1 | 2 | 3 | 4 | 5 | 6)[] >1 : 1 >2 : 2 >3 : 3 @@ -449,7 +449,7 @@ _.size({ one: 1, two: 2, three: 3 }); >_.size : { (list: T[]): number; (list: Dictionary): number; } >_ : Underscore.Static >size : { (list: T[]): number; (list: Dictionary): number; } ->{ one: 1, two: 2, three: 3 } : { one: number; two: number; three: number; } +>{ one: 1, two: 2, three: 3 } : { one: 1; two: 2; three: 3; } >one : number >1 : 1 >two : number @@ -464,7 +464,7 @@ _.first([5, 4, 3, 2, 1]); >_.first : { (list: T[]): T; (list: T[], count: number): T[]; } >_ : Underscore.Static >first : { (list: T[]): T; (list: T[], count: number): T[]; } ->[5, 4, 3, 2, 1] : number[] +>[5, 4, 3, 2, 1] : (1 | 2 | 3 | 4 | 5)[] >5 : 5 >4 : 4 >3 : 3 @@ -476,7 +476,7 @@ _.initial([5, 4, 3, 2, 1]); >_.initial : { (list: T[]): T; (list: T[], count: number): T[]; } >_ : Underscore.Static >initial : { (list: T[]): T; (list: T[], count: number): T[]; } ->[5, 4, 3, 2, 1] : number[] +>[5, 4, 3, 2, 1] : (1 | 2 | 3 | 4 | 5)[] >5 : 5 >4 : 4 >3 : 3 @@ -488,7 +488,7 @@ _.last([5, 4, 3, 2, 1]); >_.last : { (list: T[]): T; (list: T[], count: number): T[]; } >_ : Underscore.Static >last : { (list: T[]): T; (list: T[], count: number): T[]; } ->[5, 4, 3, 2, 1] : number[] +>[5, 4, 3, 2, 1] : (1 | 2 | 3 | 4 | 5)[] >5 : 5 >4 : 4 >3 : 3 @@ -500,7 +500,7 @@ _.rest([5, 4, 3, 2, 1]); >_.rest : (list: T[], index?: number) => T[] >_ : Underscore.Static >rest : (list: T[], index?: number) => T[] ->[5, 4, 3, 2, 1] : number[] +>[5, 4, 3, 2, 1] : (1 | 2 | 3 | 4 | 5)[] >5 : 5 >4 : 4 >3 : 3 @@ -578,7 +578,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); >_.without : (list: T[], ...values: T[]) => T[] >_ : Underscore.Static >without : (list: T[], ...values: T[]) => T[] ->[1, 2, 1, 0, 3, 1, 4] : number[] +>[1, 2, 1, 0, 3, 1, 4] : (1 | 2 | 3 | 0 | 4)[] >1 : 1 >2 : 2 >1 : 1 @@ -594,16 +594,16 @@ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_.union : (...arrays: T[][]) => T[] >_ : Underscore.Static >union : (...arrays: T[][]) => T[] ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 ->[101, 2, 1, 10] : number[] +>[101, 2, 1, 10] : (1 | 2 | 10 | 101)[] >101 : 101 >2 : 2 >1 : 1 >10 : 10 ->[2, 1] : number[] +>[2, 1] : (1 | 2)[] >2 : 2 >1 : 1 @@ -612,16 +612,16 @@ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); >_.intersection : (...arrays: T[][]) => T[] >_ : Underscore.Static >intersection : (...arrays: T[][]) => T[] ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 ->[101, 2, 1, 10] : number[] +>[101, 2, 1, 10] : (1 | 2 | 10 | 101)[] >101 : 101 >2 : 2 >1 : 1 >10 : 10 ->[2, 1] : number[] +>[2, 1] : (1 | 2)[] >2 : 2 >1 : 1 @@ -630,13 +630,13 @@ _.difference([1, 2, 3, 4, 5], [5, 2, 10]); >_.difference : (list: T[], ...others: T[][]) => T[] >_ : Underscore.Static >difference : (list: T[], ...others: T[][]) => T[] ->[1, 2, 3, 4, 5] : number[] +>[1, 2, 3, 4, 5] : (1 | 2 | 3 | 4 | 5)[] >1 : 1 >2 : 2 >3 : 3 >4 : 4 >5 : 5 ->[5, 2, 10] : number[] +>[5, 2, 10] : (2 | 5 | 10)[] >5 : 5 >2 : 2 >10 : 10 @@ -646,7 +646,7 @@ _.uniq([1, 2, 1, 3, 1, 4]); >_.uniq : { (list: T[], isSorted?: boolean): T[]; (list: T[], isSorted: boolean, iterator: Iterator_, context?: any): U[]; } >_ : Underscore.Static >uniq : { (list: T[], isSorted?: boolean): T[]; (list: T[], isSorted: boolean, iterator: Iterator_, context?: any): U[]; } ->[1, 2, 1, 3, 1, 4] : number[] +>[1, 2, 1, 3, 1, 4] : (1 | 2 | 3 | 4)[] >1 : 1 >2 : 2 >1 : 1 @@ -659,11 +659,11 @@ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); >_.zip : { (a0: T0[], a1: T1[]): Tuple2[]; (a0: T0[], a1: T1[], a2: T2[]): Tuple3[]; (a0: T0[], a1: T1[], a2: T2[], a3: T3[]): Tuple4[]; (...arrays: any[][]): any[][]; } >_ : Underscore.Static >zip : { (a0: T0[], a1: T1[]): Tuple2[]; (a0: T0[], a1: T1[], a2: T2[]): Tuple3[]; (a0: T0[], a1: T1[], a2: T2[], a3: T3[]): Tuple4[]; (...arrays: any[][]): any[][]; } ->['moe', 'larry', 'curly'] : string[] +>['moe', 'larry', 'curly'] : ("moe" | "larry" | "curly")[] >'moe' : "moe" >'larry' : "larry" >'curly' : "curly" ->[30, 40, 50] : number[] +>[30, 40, 50] : (40 | 50 | 30)[] >30 : 30 >40 : 40 >50 : 50 @@ -677,7 +677,7 @@ _.object(['moe', 'larry', 'curly'], [30, 40, 50]); >_.object : { (list: any[][]): any; (keys: string[], values: any[]): any; } >_ : Underscore.Static >object : { (list: any[][]): any; (keys: string[], values: any[]): any; } ->['moe', 'larry', 'curly'] : string[] +>['moe', 'larry', 'curly'] : ("moe" | "larry" | "curly")[] >'moe' : "moe" >'larry' : "larry" >'curly' : "curly" @@ -707,7 +707,7 @@ _.indexOf([1, 2, 3], 2); >_.indexOf : (list: T[], value: T, isSorted?: boolean) => number >_ : Underscore.Static >indexOf : (list: T[], value: T, isSorted?: boolean) => number ->[1, 2, 3] : number[] +>[1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 @@ -718,7 +718,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); >_.lastIndexOf : (list: T[], value: T, fromIndex?: number) => number >_ : Underscore.Static >lastIndexOf : (list: T[], value: T, fromIndex?: number) => number ->[1, 2, 3, 1, 2, 3] : number[] +>[1, 2, 3, 1, 2, 3] : (1 | 2 | 3)[] >1 : 1 >2 : 2 >3 : 3 @@ -732,7 +732,7 @@ _.sortedIndex([10, 20, 30, 40, 50], 35); >_.sortedIndex : { (list: T[], obj: T, propertyName: string): number; (list: T[], obj: T, iterator?: Iterator_, context?: any): number; } >_ : Underscore.Static >sortedIndex : { (list: T[], obj: T, propertyName: string): number; (list: T[], obj: T, iterator?: Iterator_, context?: any): number; } ->[10, 20, 30, 40, 50] : number[] +>[10, 20, 30, 40, 50] : (40 | 50 | 10 | 30 | 20)[] >10 : 10 >20 : 20 >30 : 30 @@ -1159,7 +1159,7 @@ _.extend({ name: 'moe' }, { age: 50 }); >_.extend : (destination: T, ...sources: any[]) => T >_ : Underscore.Static >extend : (destination: T, ...sources: any[]) => T ->{ name: 'moe' } : { name: string; } +>{ name: 'moe' } : { name: "moe"; } >name : string >'moe' : "moe" >{ age: 50 } : { age: number; } @@ -1171,7 +1171,7 @@ _.pick({ name: 'moe', age: 50, userid: 'moe1' }, 'name', 'age'); >_.pick : (object: T, ...keys: string[]) => T >_ : Underscore.Static >pick : (object: T, ...keys: string[]) => T ->{ name: 'moe', age: 50, userid: 'moe1' } : { name: string; age: number; userid: string; } +>{ name: 'moe', age: 50, userid: 'moe1' } : { name: "moe"; age: 50; userid: "moe1"; } >name : string >'moe' : "moe" >age : number @@ -1186,7 +1186,7 @@ _.omit({ name: 'moe', age: 50, userid: 'moe1' }, 'userid'); >_.omit : (object: T, ...keys: string[]) => T >_ : Underscore.Static >omit : (object: T, ...keys: string[]) => T ->{ name: 'moe', age: 50, userid: 'moe1' } : { name: string; age: number; userid: string; } +>{ name: 'moe', age: 50, userid: 'moe1' } : { name: "moe"; age: 50; userid: "moe1"; } >name : string >'moe' : "moe" >age : number @@ -1218,7 +1218,7 @@ _.clone({ name: 'moe' }); >_.clone : (object: T) => T >_ : Underscore.Static >clone : (object: T) => T ->{ name: 'moe' } : { name: string; } +>{ name: 'moe' } : { name: "moe"; } >name : string >'moe' : "moe" @@ -1235,7 +1235,7 @@ _.chain([1, 2, 3, 200]) >_.chain : { (list: T[]): Underscore.ChainedArray; (list: Dictionary): Underscore.ChainedDictionary; (obj: T): Underscore.ChainedObject; } >_ : Underscore.Static >chain : { (list: T[]): Underscore.ChainedArray; (list: Dictionary): Underscore.ChainedDictionary; (obj: T): Underscore.ChainedObject; } ->[1, 2, 3, 200] : number[] +>[1, 2, 3, 200] : (1 | 2 | 3 | 200)[] >1 : 1 >2 : 2 >3 : 3 @@ -1723,7 +1723,7 @@ _.template("Using 'with': <%= data.answer %>", { answer: 'no' }, { variable: 'da >{ answer: 'no' } : { answer: string; } >answer : string >'no' : "no" ->{ variable: 'data' } : { variable: string; } +>{ variable: 'data' } : { variable: "data"; } >variable : string >'data' : "data" diff --git a/tests/baselines/reference/unionTypeFromArrayLiteral.errors.txt b/tests/baselines/reference/unionTypeFromArrayLiteral.errors.txt index 2ecce8a802ea6..47157b453b130 100644 --- a/tests/baselines/reference/unionTypeFromArrayLiteral.errors.txt +++ b/tests/baselines/reference/unionTypeFromArrayLiteral.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/union/unionTypeFromArrayLiteral.ts(9,5): error TS2322: Type '[number, string, string]' is not assignable to type '[number, string]'. +tests/cases/conformance/types/union/unionTypeFromArrayLiteral.ts(9,5): error TS2322: Type '[3, "three", "hello"]' is not assignable to type '[number, string]'. Types of property 'length' are incompatible. Type '3' is not assignable to type '2'. @@ -14,7 +14,7 @@ tests/cases/conformance/types/union/unionTypeFromArrayLiteral.ts(9,5): error TS2 var arr3Tuple: [number, string] = [3, "three"]; // [number, string] var arr4Tuple: [number, string] = [3, "three", "hello"]; // [number, string, string] ~~~~~~~~~ -!!! error TS2322: Type '[number, string, string]' is not assignable to type '[number, string]'. +!!! error TS2322: Type '[3, "three", "hello"]' is not assignable to type '[number, string]'. !!! error TS2322: Types of property 'length' are incompatible. !!! error TS2322: Type '3' is not assignable to type '2'. var arrEmpty = []; diff --git a/tests/baselines/reference/unionTypeFromArrayLiteral.types b/tests/baselines/reference/unionTypeFromArrayLiteral.types index efff5e5e21909..16a3f326244b4 100644 --- a/tests/baselines/reference/unionTypeFromArrayLiteral.types +++ b/tests/baselines/reference/unionTypeFromArrayLiteral.types @@ -18,13 +18,13 @@ var arr2 = ["hello", true]; // (string | number)[] var arr3Tuple: [number, string] = [3, "three"]; // [number, string] >arr3Tuple : [number, string] ->[3, "three"] : [number, string] +>[3, "three"] : [3, "three"] >3 : 3 >"three" : "three" var arr4Tuple: [number, string] = [3, "three", "hello"]; // [number, string, string] >arr4Tuple : [number, string] ->[3, "three", "hello"] : [number, string, string] +>[3, "three", "hello"] : [3, "three", "hello"] >3 : 3 >"three" : "three" >"hello" : "hello" @@ -39,7 +39,7 @@ var arr5Tuple: { 0: string; 5: number; } = ["hello", true, false, " hello", true, 10, "any"]; // Tuple ->["hello", true, false, " hello", true, 10, "any"] : [string, boolean, boolean, string, boolean, number, string] +>["hello", true, false, " hello", true, 10, "any"] : ["hello", boolean, boolean, string, boolean, 10, string] >"hello" : "hello" >true : true >false : false diff --git a/tests/baselines/reference/unionTypeInference.types b/tests/baselines/reference/unionTypeInference.types index ebaf8c014026e..eec9e6a25bcfa 100644 --- a/tests/baselines/reference/unionTypeInference.types +++ b/tests/baselines/reference/unionTypeInference.types @@ -77,7 +77,7 @@ var b1 = g(["string", true]); >b1 : boolean >g(["string", true]) : boolean >g : (value: [string, T]) => T ->["string", true] : [string, true] +>["string", true] : ["string", true] >"string" : "string" >true : true diff --git a/tests/baselines/reference/unusedImportDeclaration.types b/tests/baselines/reference/unusedImportDeclaration.types index e5fc93940c70b..196835e0f57b0 100644 --- a/tests/baselines/reference/unusedImportDeclaration.types +++ b/tests/baselines/reference/unusedImportDeclaration.types @@ -5,7 +5,7 @@ import B = require("./unusedImportDeclaration_testerB"); var thingy: B = { >thingy : B >B : B ->{ me: "A"} : { me: string; } +>{ me: "A"} : { me: "A"; } me: "A" >me : string diff --git a/tests/baselines/reference/useBeforeDeclaration.types b/tests/baselines/reference/useBeforeDeclaration.types index 9875379e5c98b..ad4444c830764 100644 --- a/tests/baselines/reference/useBeforeDeclaration.types +++ b/tests/baselines/reference/useBeforeDeclaration.types @@ -29,7 +29,7 @@ namespace ts { export let sys:{version:string} = {version: "2.0.5"}; >sys : { version: string; } >version : string ->{version: "2.0.5"} : { version: string; } +>{version: "2.0.5"} : { version: "2.0.5"; } >version : string >"2.0.5" : "2.0.5" diff --git a/tests/baselines/reference/validMultipleVariableDeclarations.types b/tests/baselines/reference/validMultipleVariableDeclarations.types index fcd17cb4b142b..7a8a49182fc55 100644 --- a/tests/baselines/reference/validMultipleVariableDeclarations.types +++ b/tests/baselines/reference/validMultipleVariableDeclarations.types @@ -53,7 +53,7 @@ var p = { x: 1, y: 2 }; var p: Point = { x: 0, y: undefined }; >p : Point >Point : Point ->{ x: 0, y: undefined } : { x: number; y: undefined; } +>{ x: 0, y: undefined } : { x: 0; y: undefined; } >x : number >0 : 0 >y : undefined @@ -72,7 +72,7 @@ var p: { x: number; y: number; } = { x: 1, y: 2 }; >p : Point >x : number >y : number ->{ x: 1, y: 2 } : { x: number; y: number; } +>{ x: 1, y: 2 } : { x: 1; y: 2; } >x : number >1 : 1 >y : number @@ -83,7 +83,7 @@ var p = <{ x: number; y: number; }>{ x: 0, y: undefined }; ><{ x: number; y: number; }>{ x: 0, y: undefined } : { x: number; y: number; } >x : number >y : number ->{ x: 0, y: undefined } : { x: number; y: undefined; } +>{ x: 0, y: undefined } : { x: 0; y: undefined; } >x : number >0 : 0 >y : undefined diff --git a/tests/baselines/reference/vardecl.types b/tests/baselines/reference/vardecl.types index 4a72683a35b5f..765b93c1f20d2 100644 --- a/tests/baselines/reference/vardecl.types +++ b/tests/baselines/reference/vardecl.types @@ -39,7 +39,7 @@ declare var deckareVarWithType: number; var arrayVar: string[] = ['a', 'b']; >arrayVar : string[] ->['a', 'b'] : string[] +>['a', 'b'] : ("a" | "b")[] >'a' : "a" >'b' : "b" @@ -53,7 +53,7 @@ complicatedArrayVar.push({ x: 30, y : 'hello world' }); >complicatedArrayVar.push : (...items: { x: number; y: string; }[]) => number >complicatedArrayVar : { x: number; y: string; }[] >push : (...items: { x: number; y: string; }[]) => number ->{ x: 30, y : 'hello world' } : { x: number; y: string; } +>{ x: 30, y : 'hello world' } : { x: 30; y: "hello world"; } >x : number >30 : 30 >y : string diff --git a/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.types b/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.types index ffc5dafed2032..fd493dd01a511 100644 --- a/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.types +++ b/tests/baselines/reference/variableDeclaratorResolvedDuringContextualTyping.types @@ -376,7 +376,7 @@ class FileService { >this : this >requestService : Services.IRequestService >makeRequest : (options: WinJS.IXHROptions) => WinJS.Promise ->{ url: this.requestService.getRequestUrl('root', path), type: 'POST', headers: {}, data: "someData" } : { url: string; type: string; headers: {}; data: string; } +>{ url: this.requestService.getRequestUrl('root', path), type: 'POST', headers: {}, data: "someData" } : { url: string; type: "POST"; headers: {}; data: string; } url: this.requestService.getRequestUrl('root', path), >url : string diff --git a/tests/baselines/reference/voidOperatorWithNumberType.types b/tests/baselines/reference/voidOperatorWithNumberType.types index ff9e66d554cc6..a01b5e2f98308 100644 --- a/tests/baselines/reference/voidOperatorWithNumberType.types +++ b/tests/baselines/reference/voidOperatorWithNumberType.types @@ -5,7 +5,7 @@ var NUMBER: number; var NUMBER1: number[] = [1, 2]; >NUMBER1 : number[] ->[1, 2] : number[] +>[1, 2] : (1 | 2)[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/voidOperatorWithStringType.types b/tests/baselines/reference/voidOperatorWithStringType.types index 1e3751a3a0f52..f6dc730ae39d5 100644 --- a/tests/baselines/reference/voidOperatorWithStringType.types +++ b/tests/baselines/reference/voidOperatorWithStringType.types @@ -5,7 +5,7 @@ var STRING: string; var STRING1: string[] = ["", "abc"]; >STRING1 : string[] ->["", "abc"] : string[] +>["", "abc"] : ("" | "abc")[] >"" : "" >"abc" : "abc" diff --git a/tests/baselines/reference/widenToAny1.types b/tests/baselines/reference/widenToAny1.types index ad36713fad449..f4788ecf45468 100644 --- a/tests/baselines/reference/widenToAny1.types +++ b/tests/baselines/reference/widenToAny1.types @@ -16,7 +16,7 @@ var z1: number = foo1({ x: undefined, y: "def" }); // Best common type is any >z1 : number >foo1({ x: undefined, y: "def" }) : string >foo1 : (f1: { x: T; y: T; }) => T ->{ x: undefined, y: "def" } : { x: undefined; y: string; } +>{ x: undefined, y: "def" } : { x: undefined; y: "def"; } >x : undefined >undefined : undefined >y : string diff --git a/tests/baselines/reference/widenToAny2.types b/tests/baselines/reference/widenToAny2.types index 243a4f1419e35..ca58c49e3186f 100644 --- a/tests/baselines/reference/widenToAny2.types +++ b/tests/baselines/reference/widenToAny2.types @@ -13,7 +13,7 @@ var z3:number = foo3([undefined, "def"]); // Type is any, but should be string >z3 : number >foo3([undefined, "def"]) : string >foo3 : (x: T[]) => T ->[undefined, "def"] : string[] +>[undefined, "def"] : "def"[] >undefined : undefined >"def" : "def" diff --git a/tests/baselines/reference/withExportDecl.types b/tests/baselines/reference/withExportDecl.types index b94409bfcc9f5..c41571c441cf1 100644 --- a/tests/baselines/reference/withExportDecl.types +++ b/tests/baselines/reference/withExportDecl.types @@ -59,7 +59,7 @@ export declare var exportedDeclaredVar: number; var arrayVar: string[] = ['a', 'b']; >arrayVar : string[] ->['a', 'b'] : string[] +>['a', 'b'] : ("a" | "b")[] >'a' : "a" >'b' : "b" @@ -73,7 +73,7 @@ exportedArrayVar.push({ x: 30, y : 'hello world' }); >exportedArrayVar.push : (...items: { x: number; y: string; }[]) => number >exportedArrayVar : { x: number; y: string; }[] >push : (...items: { x: number; y: string; }[]) => number ->{ x: 30, y : 'hello world' } : { x: number; y: string; } +>{ x: 30, y : 'hello world' } : { x: 30; y: "hello world"; } >x : number >30 : 30 >y : string diff --git a/tests/baselines/reference/withImportDecl.types b/tests/baselines/reference/withImportDecl.types index 3dabc64db266c..d4bd6c8a81a11 100644 --- a/tests/baselines/reference/withImportDecl.types +++ b/tests/baselines/reference/withImportDecl.types @@ -40,7 +40,7 @@ declare var deckareVarWithType: number; var arrayVar: string[] = ['a', 'b']; >arrayVar : string[] ->['a', 'b'] : string[] +>['a', 'b'] : ("a" | "b")[] >'a' : "a" >'b' : "b" diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints3.errors.txt b/tests/baselines/reference/wrappedAndRecursiveConstraints3.errors.txt new file mode 100644 index 0000000000000..a3060ccc2cb0c --- /dev/null +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints3.errors.txt @@ -0,0 +1,23 @@ +tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints3.ts(14,28): error TS2345: Argument of type '{ length: 3; charAt: (x: number) => void; }' is not assignable to parameter of type '{ length: 2; }'. + Object literal may only specify known properties, and 'charAt' does not exist in type '{ length: 2; }'. + + +==== tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints3.ts (1 errors) ==== + // no errors expected + + class C { + constructor(x: T) { } + foo(x: U) { + function bar(x: V) { + return x; + } + return bar; + } + } + + var c = new C({ length: 2 }); + var r = c.foo({ length: 3, charAt: (x: number) => { '' } }); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '{ length: 3; charAt: (x: number) => void; }' is not assignable to parameter of type '{ length: 2; }'. +!!! error TS2345: Object literal may only specify known properties, and 'charAt' does not exist in type '{ length: 2; }'. + var r2 = r(''); \ No newline at end of file diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints3.types b/tests/baselines/reference/wrappedAndRecursiveConstraints3.types index 2c4b5727abe83..a31c66300784a 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints3.types +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints3.types @@ -33,19 +33,19 @@ class C { } var c = new C({ length: 2 }); ->c : C<{ length: number; }> ->new C({ length: 2 }) : C<{ length: number; }> +>c : C<{ length: 2; }> +>new C({ length: 2 }) : C<{ length: 2; }> >C : typeof C ->{ length: 2 } : { length: number; } +>{ length: 2 } : { length: 2; } >length : number >2 : 2 var r = c.foo({ length: 3, charAt: (x: number) => { '' } }); ->r : void; }>(x: V) => V ->c.foo({ length: 3, charAt: (x: number) => { '' } }) : void; }>(x: V) => V ->c.foo : (x: U) => (x: V) => V ->c : C<{ length: number; }> ->foo : (x: U) => (x: V) => V +>r : any +>c.foo({ length: 3, charAt: (x: number) => { '' } }) : any +>c.foo : (x: U) => (x: V) => V +>c : C<{ length: 2; }> +>foo : (x: U) => (x: V) => V >{ length: 3, charAt: (x: number) => { '' } } : { length: number; charAt: (x: number) => void; } >length : number >3 : 3 @@ -55,8 +55,8 @@ var r = c.foo({ length: 3, charAt: (x: number) => { '' } }); >'' : "" var r2 = r(''); ->r2 : string ->r('') : "" ->r : void; }>(x: V) => V +>r2 : any +>r('') : any +>r : any >'' : "" diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt index 47e8e6ff4f295..db2544e35b023 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints4.ts(13,12): error TS2345: Argument of type '{ length: number; charAt: (x: number) => void; }' is not assignable to parameter of type 'string'. +tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints4.ts(12,15): error TS2345: Argument of type '""' is not assignable to parameter of type '{ length: 2; }'. ==== tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursiveConstraints4.ts (1 errors) ==== @@ -14,6 +14,6 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursi var c = new C({ length: 2 }); var r = c.foo(''); - var r2 = r({ length: 3, charAt: (x: number) => { '' } }); // error - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '{ length: number; charAt: (x: number) => void; }' is not assignable to parameter of type 'string'. \ No newline at end of file + ~~ +!!! error TS2345: Argument of type '""' is not assignable to parameter of type '{ length: 2; }'. + var r2 = r({ length: 3, charAt: (x: number) => { '' } }); // error \ No newline at end of file diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.types b/tests/baselines/reference/wrappedAndRecursiveConstraints4.types index 84fa3d53ad262..22ed9e1390c70 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.types +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.types @@ -31,25 +31,25 @@ class C { } var c = new C({ length: 2 }); ->c : C<{ length: number; }> ->new C({ length: 2 }) : C<{ length: number; }> +>c : C<{ length: 2; }> +>new C({ length: 2 }) : C<{ length: 2; }> >C : typeof C ->{ length: 2 } : { length: number; } +>{ length: 2 } : { length: 2; } >length : number >2 : 2 var r = c.foo(''); ->r : (x: V) => V ->c.foo('') : (x: V) => V ->c.foo : (x: U) => (x: V) => V ->c : C<{ length: number; }> ->foo : (x: U) => (x: V) => V +>r : any +>c.foo('') : any +>c.foo : (x: U) => (x: V) => V +>c : C<{ length: 2; }> +>foo : (x: U) => (x: V) => V >'' : "" var r2 = r({ length: 3, charAt: (x: number) => { '' } }); // error >r2 : any >r({ length: 3, charAt: (x: number) => { '' } }) : any ->r : (x: V) => V +>r : any >{ length: 3, charAt: (x: number) => { '' } } : { length: number; charAt: (x: number) => void; } >length : number >3 : 3 diff --git a/tests/cases/compiler/contextualTypeShouldBeLiteral.ts b/tests/cases/compiler/contextualTypeShouldBeLiteral.ts new file mode 100644 index 0000000000000..1012c567a71b5 --- /dev/null +++ b/tests/cases/compiler/contextualTypeShouldBeLiteral.ts @@ -0,0 +1,96 @@ +// @strict: true +interface X { + type: 'x'; + value: string; + method(): void; +} + +interface Y { + type: 'y'; + value: 'none' | 'done'; + method(): void; +} + +function foo(bar: X | Y) { } + +foo({ + type: 'y', + value: 'done', + method() { + this; + this.type; + this.value; + } +}); + +interface X2 { + type1: 'x'; + value: string; + method(): void; +} + +interface Y2 { + type2: 'y'; + value: 'none' | 'done'; + method(): void; +} + +function foo2(bar: X2 | Y2) { } + +foo2({ + type2: 'y', + value: 'done', + method() { + this; + this.value; + } +}); + +interface X3 { + type: 'x'; + value: 1 | 2 | 3; + xtra: number; +} + +interface Y3 { + type: 'y'; + value: 11 | 12 | 13; + ytra: number; +} + +let xy: X3 | Y3 = { + type: 'y', + value: 11, + ytra: 12 +}; + +xy; + + +interface LikeA { + x: 'x'; + y: 'y'; + value: string; + method(): void; +} + +interface LikeB { + x: 'xx'; + y: 'yy'; + value: number; + method(): void; +} + +let xyz: LikeA | LikeB = { + x: 'x', + y: 'y', + value: "foo", + method() { + this; + this.x; + this.y; + this.value; + } +}; + +xyz; \ No newline at end of file diff --git a/tests/cases/compiler/nestedTypeVariableInfersLiteral.ts b/tests/cases/compiler/nestedTypeVariableInfersLiteral.ts new file mode 100644 index 0000000000000..697e2227da40f --- /dev/null +++ b/tests/cases/compiler/nestedTypeVariableInfersLiteral.ts @@ -0,0 +1,18 @@ +// https://github.com/Microsoft/TypeScript/issues/19632 +declare function direct(a: A | A[]): Record +declare function nested(a: { fields: A }): Record +declare function nestedUnion(a: { fields: A | A[] }): Record + +const directUnionSingle = direct("z") +const directUnionArray = direct(["z", "y"]) +const nestedSingle = nested({fields: "z"}) +const nestedUnionSingle = nestedUnion({fields: "z"}) +const nestedUnionArray = nestedUnion({fields: ["z", "y"]}) + +declare function hasZField(arg: { z: string }): void + +hasZField(directUnionSingle) // ok +hasZField(directUnionArray) // ok +hasZField(nestedSingle) // ok +hasZField(nestedUnionSingle) // ok +hasZField(nestedUnionArray) // ok \ No newline at end of file