From cc20bb19d00fb05101fab6327874dea279b251b1 Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Thu, 21 Aug 2014 18:39:46 -0700 Subject: [PATCH 01/11] Baseline and harness changes --- src/harness/compilerRunner.ts | 2 +- src/harness/typeWriter.ts | 4 +- ...1.errors.txt => ArrowFunction1.errors.txt} | 2 +- ...2.errors.txt => ArrowFunction2.errors.txt} | 2 +- ...3.errors.txt => ArrowFunction3.errors.txt} | 2 +- tests/baselines/reference/ArrowFunction4.js | 8 + ...owFunction4.types => ArrowFunction4.types} | 6 +- ...AndNonExportedFunctionThatShareAName.types | 8 +- ...essibleTypeInTypeParameterConstraint.types | 2 +- ...esInParameterAndReturnTypeAnnotation.types | 2 +- ...ssibleTypesInParameterTypeAnnotation.types | 2 +- ...ccessibleTypesInReturnTypeAnnotation.types | 2 +- ...hAccessibleTypesOnItsExportedMembers.types | 2 +- ...leWithSameNameAndDifferentCommonRoot.types | 6 +- ...AndNonExportedLocalVarsOfTheSameName.types | 6 +- ...ithTheSameNameAndDifferentCommonRoot.types | 2 +- ...ulesWithTheSameNameAndSameCommonRoot.types | 6 +- ...rrors.txt => TypeArgumentList1.errors.txt} | 2 +- ...rParameterAccessibilityModifier.errors.txt | 5 +- .../baselines/reference/accessorWithES5.types | 8 +- .../accessorWithInitializer.errors.txt | 5 +- .../accessorWithRestParam.errors.txt | 5 +- .../additionOperatorWithAnyAndEveryType.types | 8 +- .../aliasInaccessibleModule.errors.txt | 8 - .../reference/aliasInaccessibleModule.types | 11 + .../aliasInaccessibleModule2.errors.txt | 12 - .../reference/aliasInaccessibleModule2.types | 20 + .../aliasUsageInAccessorsOfClass.errors.txt | 30 + .../reference/aliasUsageInAccessorsOfClass.js | 69 - .../aliasUsageInAccessorsOfClass.types | 60 - .../aliasUsageInGenericFunction.types | 6 +- .../reference/aliasUsedAsNameValue.types | 11 +- .../reference/ambientDeclarations.types | 30 +- ...nalModuleWithRelativeModuleName.errors.txt | 8 +- ...entExternalModuleWithRelativeModuleName.js | 4 - .../reference/ambientGetters.errors.txt | 5 +- .../reference/ambientModuleExports.types | 12 +- .../ambiguousOverloadResolution.types | 6 +- .../amdDependencyComment2.errors.txt | 7 - .../anyAsReturnTypeForNewOnCall.types | 4 +- .../anyAssignabilityInInheritance.types | 102 +- .../reference/anyAssignableToEveryType.types | 2 +- .../anyInferenceAnonymousFunctions.types | 22 +- tests/baselines/reference/arguments.types | 2 +- ...argumentsUsedInObjectLiteralProperty.types | 6 +- .../baselines/reference/arrayConcatMap.types | 6 +- .../arrayLiteralInNonVarArgParameter.types | 4 +- .../reference/arrayLiteralTypeInference.types | 32 +- tests/baselines/reference/arrayconcat.types | 39 +- .../reference/arrowFunctionExpressions.types | 26 +- ...nctionMissingCurlyWithSemicolon.errors.txt | 7 - .../arrowFunctionsMissingTokens.errors.txt | 115 - .../asiAmbientFunctionDeclaration.js | 4 - .../asiAmbientFunctionDeclaration.types | 4 - tests/baselines/reference/asiArith.types | 40 +- tests/baselines/reference/asiBreak.js | 6 - tests/baselines/reference/asiBreak.types | 3 - tests/baselines/reference/asiContinue.js | 6 - tests/baselines/reference/asiContinue.types | 3 - .../baselines/reference/asiInES6Classes.types | 6 +- .../baselines/reference/asiReturn.errors.txt | 5 - .../reference/assignEveryTypeToAny.types | 2 +- .../reference/assignToPrototype1.types | 6 +- .../reference/assignmentCompatForEnums.types | 6 +- .../reference/assignmentCompatOnNew.types | 4 +- .../assignmentCompatWithObjectMembers.js | 168 + .../assignmentCompatWithObjectMembers.types | 310 ++ .../assignmentCompatability24.errors.txt | 8 +- .../reference/assignmentCompatability24.js | 2 +- .../assignmentCompatability33.errors.txt | 8 +- .../reference/assignmentCompatability33.js | 2 +- .../assignmentCompatability34.errors.txt | 8 +- .../reference/assignmentCompatability34.js | 2 +- .../assignmentCompatability37.errors.txt | 8 +- .../reference/assignmentCompatability37.js | 2 +- .../assignmentCompatability38.errors.txt | 8 +- .../reference/assignmentCompatability38.js | 2 +- ...tibilityForConstrainedTypeParameters.types | 2 +- .../reference/assignmentLHSIsReference.types | 4 +- tests/baselines/reference/augmentArray.js | 6 - tests/baselines/reference/augmentArray.types | 7 - .../autoAsiForStaticsInClassDeclaration.js | 12 - .../autoAsiForStaticsInClassDeclaration.types | 10 - tests/baselines/reference/avoid.types | 10 +- .../reference/badArraySyntax.errors.txt | 8 +- .../reference/badOverloadError.types | 2 +- .../baselines/reference/badThisBinding.types | 28 +- ...stCommonTypeOfConditionalExpressions.types | 2 +- .../bestCommonTypeReturnStatement.types | 10 +- .../bitwiseNotOperatorWithBooleanType.types | 12 +- .../bitwiseNotOperatorWithNumberType.types | 12 +- .../bitwiseNotOperatorWithStringType.types | 12 +- .../breakInIterationOrSwitchStatement1.js | 9 + .../breakInIterationOrSwitchStatement1.types | 5 + .../breakInIterationOrSwitchStatement2.js | 10 + .../breakInIterationOrSwitchStatement2.types | 6 + .../breakInIterationOrSwitchStatement3.js | 9 + .../breakInIterationOrSwitchStatement3.types | 5 + ...akInIterationOrSwitchStatement4.errors.txt | 6 + .../breakInIterationOrSwitchStatement4.js | 9 + ...otInIterationOrSwitchStatement1.errors.txt | 4 + ...otInIterationOrSwitchStatement2.errors.txt | 8 + tests/baselines/reference/breakTarget1.js | 6 + tests/baselines/reference/breakTarget1.types | 4 + tests/baselines/reference/breakTarget2.js | 10 + tests/baselines/reference/breakTarget2.types | 6 + tests/baselines/reference/breakTarget3.js | 11 + tests/baselines/reference/breakTarget3.types | 7 + tests/baselines/reference/breakTarget4.js | 11 + tests/baselines/reference/breakTarget4.types | 7 + .../reference/breakTarget5.errors.txt | 11 + .../reference/breakTarget6.errors.txt | 6 + ...GenericFunctionWithZeroTypeArguments.types | 4 +- ...allSignatureWithoutAnnotationsOrBody.types | 4 +- ...WithoutReturnTypeAnnotationInference.types | 64 +- ...callSignaturesWithOptionalParameters.types | 12 +- ...allSignaturesWithOptionalParameters2.types | 18 +- .../reference/captureThisInSuperCall.js | 32 - .../reference/captureThisInSuperCall.types | 25 - .../castExpressionParentheses.errors.txt | 42 + .../reference/castExpressionParentheses.js | 2 +- .../reference/castExpressionParentheses.types | 170 - tests/baselines/reference/castTest.types | 31 +- tests/baselines/reference/catch.types | 2 +- tests/baselines/reference/cf.types | 2 +- .../baselines/reference/chainedImportAlias.js | 18 +- .../reference/chainedImportAlias.types | 33 +- .../reference/classExtendingClass.types | 12 +- .../classExtendingPrimitive2.errors.txt | 11 - .../classExtendsEveryObjectType2.errors.txt | 10 - .../classImplementsImportedInterface.js | 25 - .../classImplementsImportedInterface.types | 28 - ...ssMemberInitializerWithLamdaScoping5.types | 4 +- .../classMethodWithKeywordName1.types | 2 +- ...licMembersEquivalentToInterface.errors.txt | 30 + ...lyPublicMembersEquivalentToInterface.types | 73 - ...icMembersEquivalentToInterface2.errors.txt | 32 + ...yPublicMembersEquivalentToInterface2.types | 76 - .../reference/classWithPublicProperty.types | 6 +- .../cloduleAcrossModuleDefinitions.types | 2 +- tests/baselines/reference/cloduleTest1.types | 2 +- ...ionCodeGenModuleWithFunctionChildren.types | 6 +- ...isionCodeGenModuleWithModuleChildren.types | 4 +- .../collisionExportsRequireAndFunction.types | 4 +- .../collisionExportsRequireAndModule.types | 4 +- ...xportsRequireAndUninstantiatedModule.types | 4 +- .../collisionExportsRequireAndVar.types | 2 +- .../baselines/reference/commaOperator1.types | 2 +- .../commaOperatorOtherValidOperation.types | 6 +- .../commentBeforeStaticMethod1.types | 2 +- .../commentInEmptyParameterList1.types | 2 +- .../reference/commentInMethodCall.types | 3 +- .../reference/commentOnSignature1.types | 6 +- .../commentOnSimpleArrowFunctionBody1.types | 12 +- .../reference/commentOnStaticMember1.types | 2 +- .../commentsBeforeFunctionExpression1.types | 4 +- .../reference/commentsClassMembers.types | 60 +- .../reference/commentsCommentParsing.types | 76 +- .../reference/commentsDottedModuleName.types | 12 - .../reference/commentsExternalModules.types | 28 +- .../reference/commentsExternalModules2.types | 28 +- .../reference/commentsExternalModules3.types | 28 +- .../reference/commentsFunction.types | 24 +- .../reference/commentsInterface.types | 20 +- .../baselines/reference/commentsModules.types | 16 +- .../commentsMultiModuleMultiFile.errors.txt | 41 + .../reference/commentsMultiModuleMultiFile.js | 12 +- .../commentsMultiModuleMultiFile.types | 62 - .../reference/commentsOnObjectLiteral3.types | 21 +- .../reference/commentsOnObjectLiteral4.types | 9 +- .../commentsOnReturnStatement1.types | 2 +- .../reference/commentsOverloads.types | 40 +- .../commentsPropertySignature1.types | 5 +- .../reference/commentsTypeParameters.types | 6 +- .../reference/commentsdoNotEmitComments.types | 4 +- .../reference/commentsemitComments.types | 4 +- ...onOperatorWithIdenticalTypeParameter.types | 2 +- ...omparisonOperatorWithOneOperandIsAny.types | 2 +- ...mparisonOperatorWithOneOperandIsNull.types | 2 +- ...sonOperatorWithOneOperandIsUndefined.types | 2 +- .../reference/complexClassRelationships.types | 8 +- .../reference/complicatedPrivacy.errors.txt | 6 +- .../reference/compositeGenericFunction.types | 12 +- .../compoundAssignmentLHSIsReference.types | 4 +- .../reference/conditionalExpressions2.types | 2 +- ...itionalOperatorConditionIsNumberType.types | 10 +- ...itionalOperatorConditionIsObjectType.types | 6 +- ...itionalOperatorConditoinIsStringType.types | 6 +- ...eOverloadsCausedByOverloadResolution.types | 42 +- .../reference/constantOverloadFunction.types | 10 +- ...straintPropagationThroughReturnTypes.types | 6 +- .../constraintSatisfactionWithAny.types | 18 +- ...onstraintSatisfactionWithEmptyObject.types | 12 +- ...nstructorArgWithGenericCallSignature.types | 6 +- .../constructorArgsErrors3.errors.txt | 8 - .../constructorArgsErrors4.errors.txt | 8 - .../constructorArgsErrors5.errors.txt | 8 - ...uctorsWithSpecializedSignatures.errors.txt | 60 - ...contextualSigInstantiationRestParams.types | 10 +- .../contextualSignatureInstantiation1.types | 8 +- .../contextualSignatureInstantiation3.types | 83 - ...meterConstrainedToOuterTypeParameter.types | 4 +- .../contextualTypeAppliedToVarArgs.types | 16 +- .../contextualTypeArrayReturnType.types | 18 +- .../reference/contextualTyping.errors.txt | 4 +- tests/baselines/reference/contextualTyping.js | 197 +- .../reference/contextualTyping25.types | 4 +- .../reference/contextualTyping26.types | 4 +- .../reference/contextualTyping27.types | 4 +- .../reference/contextualTyping28.types | 4 +- .../reference/contextualTyping29.types | 4 +- .../reference/contextualTyping31.types | 4 +- .../reference/contextualTyping32.types | 4 +- ...ypingTwoInstancesOfSameTypeParameter.types | 6 +- .../continueInIterationStatement1.js | 9 + .../continueInIterationStatement1.types | 5 + .../continueInIterationStatement2.js | 10 + .../continueInIterationStatement2.types | 6 + .../continueInIterationStatement3.js | 9 + .../continueInIterationStatement3.types | 5 + .../continueInIterationStatement4.errors.txt | 6 + .../continueInIterationStatement4.js | 9 + tests/baselines/reference/continueLabel.js | 9 + tests/baselines/reference/continueLabel.types | 10 + ...ontinueNotInIterationStatement1.errors.txt | 4 + ...ontinueNotInIterationStatement2.errors.txt | 8 + ...ontinueNotInIterationStatement3.errors.txt | 7 + ...ontinueNotInIterationStatement4.errors.txt | 10 + .../reference/continueTarget1.errors.txt | 5 + tests/baselines/reference/continueTarget2.js | 10 + .../baselines/reference/continueTarget2.types | 6 + tests/baselines/reference/continueTarget3.js | 11 + .../baselines/reference/continueTarget3.types | 7 + tests/baselines/reference/continueTarget4.js | 11 + .../baselines/reference/continueTarget4.types | 7 + .../reference/continueTarget5.errors.txt | 11 + .../reference/continueTarget6.errors.txt | 6 + .../reference/convertKeywordsYes.errors.txt | 330 ++ .../baselines/reference/convertKeywordsYes.js | 28 + .../reference/convertKeywordsYes.types | 936 ----- tests/baselines/reference/covariance1.types | 6 +- .../crashInresolveReturnStatement.types | 10 +- .../baselines/reference/cyclicModuleImport.js | 21 - tests/baselines/reference/debugger.types | 2 +- .../reference/declFileAccessors.types | 160 - .../reference/declFileCallSignatures.types | 117 - ...WithStaticMethodReturningConstructor.types | 2 +- .../declFileConstructSignatures.types | 121 - .../reference/declFileConstructors.types | 176 - .../reference/declFileFunctions.types | 142 - .../reference/declFileGenericType.types | 48 +- .../declFileImportChainInExportAssignment.js | 39 - ...eclFileImportChainInExportAssignment.types | 24 - .../reference/declFileIndexSignatures.js | 69 - .../reference/declFileIndexSignatures.types | 66 - .../baselines/reference/declFileMethods.types | 447 --- ...uleAssignmentInObjectLiteralProperty.types | 5 +- ...tParametersOfFunctionAndFunctionType.types | 10 +- .../reference/declFileTypeofFunction.types | 54 +- .../declFileTypeofInAnonymousType.types | 12 +- .../declarationEmit_nameConflicts.errors.txt | 53 + .../declarationEmit_nameConflicts.types | 148 - .../declarationEmit_nameConflicts2.js | 1 + .../declarationEmit_nameConflicts2.types | 9 +- .../declarationEmit_nameConflicts3.js | 1 + .../declarationEmit_nameConflicts3.types | 27 +- ...tionEmit_nameConflictsWithAlias.errors.txt | 10 + ...clarationEmit_nameConflictsWithAlias.types | 21 - ...tAssignmentWithVarFromVariableStatement.js | 41 - ...signmentWithVarFromVariableStatement.types | 51 - .../deleteOperatorWithBooleanType.types | 12 +- .../deleteOperatorWithNumberType.types | 12 +- .../deleteOperatorWithStringType.types | 12 +- ...achedCommentAtStartOfLambdaFunction1.types | 6 +- ...achedCommentAtStartOfLambdaFunction2.types | 7 +- .../reference/dottedSymbolResolution1.types | 20 +- .../reference/duplicateLabel1.errors.txt | 7 + .../reference/duplicateLabel2.errors.txt | 9 + tests/baselines/reference/duplicateLabel3.js | 17 + .../baselines/reference/duplicateLabel3.types | 11 + tests/baselines/reference/duplicateLabel4.js | 14 + .../baselines/reference/duplicateLabel4.types | 9 + ...duplicatePropertiesInStrictMode.errors.txt | 10 - .../duplicateStringIndexers.errors.txt | 47 - .../reference/duplicateStringIndexers.js | 74 +- .../reference/duplicateVarAndImport.types | 13 - .../duplicateVarAndImport2.errors.txt | 7 - .../reference/duplicateVariablesByScope.types | 2 +- tests/baselines/reference/emitBOM.types | 6 - .../emptyTypeArgumentList.errors.txt | 7 - .../emptyTypeArgumentListWithNew.errors.txt | 7 - tests/baselines/reference/enumBasics.types | 8 +- .../reference/enumBasics1.errors.txt | 2 +- tests/baselines/reference/enumBasics1.js | 2 +- .../enumInitializersWithExponents.errors.txt | 14 - tests/baselines/reference/es6ClassTest5.types | 4 +- tests/baselines/reference/es6ClassTest8.types | 56 +- .../reference/everyTypeAssignableToAny.types | 2 +- ...veryTypeWithAnnotationAndInitializer.types | 20 +- .../reference/everyTypeWithInitializer.types | 14 +- .../reference/exportAssignmentFunction.types | 8 +- .../exportAssignmentMergedModule.types | 12 +- ...ntWithDeclareAndExportModifiers.errors.txt | 7 - ...rtAssignmentWithDeclareModifier.errors.txt | 7 - ...ortAssignmentWithExportModifier.errors.txt | 7 - tests/baselines/reference/exportCodeGen.types | 12 +- tests/baselines/reference/exportImport.types | 2 +- .../reference/exportImportMultipleFiles.types | 10 +- .../exportImportNonInstantiatedModule2.types | 2 +- .../reference/exportVisibility.types | 2 +- ...ndingClassFromAliasAndUsageInIndexer.types | 5 +- tests/baselines/reference/externFunc.types | 4 +- ...fImportDeclarationWithExportModifier.types | 6 +- tests/baselines/reference/fatArrowSelf.types | 8 +- .../reference/fatarrowfunctions.types | 47 +- ...functionsInFunctionParameterDefaults.types | 4 +- .../fatarrowfunctionsInFunctions.types | 29 +- .../fileReferencesWithNoExtensions.types | 32 - ...rameterInSignatureWithRestParameters.types | 4 +- .../baselines/reference/forInStatement3.types | 2 +- tests/baselines/reference/forStatements.types | 20 +- .../forStatementsMultipleValidDecl.types | 2 +- tests/baselines/reference/funcdecl.types | 94 +- ...nAndInterfaceWithSeparateErrors.errors.txt | 12 - .../functionAndInterfaceWithSeparateErrors.js | 12 - tests/baselines/reference/functionCall1.types | 4 +- tests/baselines/reference/functionCall2.types | 4 +- tests/baselines/reference/functionCall3.types | 4 +- tests/baselines/reference/functionCall4.types | 8 +- tests/baselines/reference/functionCall5.types | 4 +- .../functionConstraintSatisfaction.types | 44 +- .../functionConstraintSatisfaction3.types | 22 +- ...nWithArgumentOfTypeFunctionTypeArray.types | 2 +- .../reference/functionImplementations.types | 121 +- .../reference/functionMergedWithModule.types | 8 +- .../reference/functionOnlyHasThrow.types | 2 +- .../reference/functionOverloads10.types | 6 +- .../reference/functionOverloads12.types | 6 +- .../reference/functionOverloads13.types | 6 +- .../reference/functionOverloads14.types | 6 +- .../reference/functionOverloads15.types | 6 +- .../reference/functionOverloads16.types | 6 +- .../reference/functionOverloads21.types | 6 +- .../reference/functionOverloads23.types | 6 +- .../reference/functionOverloads24.types | 6 +- .../reference/functionOverloads25.types | 8 +- .../reference/functionOverloads26.types | 8 +- .../reference/functionOverloads28.types | 8 +- .../reference/functionOverloads30.types | 8 +- .../reference/functionOverloads31.types | 8 +- .../reference/functionOverloads32.types | 8 +- .../reference/functionOverloads33.types | 8 +- .../reference/functionOverloads35.types | 8 +- .../reference/functionOverloads36.types | 8 +- .../reference/functionOverloads38.types | 8 +- .../reference/functionOverloads39.types | 8 +- .../reference/functionOverloads42.types | 8 +- .../reference/functionOverloads6.types | 6 +- .../reference/functionOverloads8.types | 6 +- .../reference/functionOverloads9.types | 6 +- ...nOverloadsRecursiveGenericReturnType.types | 6 +- .../baselines/reference/functionReturn.types | 14 +- .../reference/functionReturningItself.types | 4 +- tests/baselines/reference/functionType.types | 4 +- ...thAnyReturnTypeAndNoReturnExpression.types | 2 +- ...unctionWithMultipleReturnStatements2.types | 18 +- ...gReturnStatementsAndExpressions.errors.txt | 129 - .../funduleUsedAcrossFileBoundary.types | 8 +- .../reference/generatedContextualTyping.types | 120 +- .../generativeRecursionWithTypeOf.types | 4 +- tests/baselines/reference/genericArray0.types | 2 +- .../genericArrayPropertyAssignment.types | 4 +- .../genericCallTypeArgumentInference.types | 12 +- .../genericCallWithArrayLiteralArgs.types | 18 +- ...WithConstraintsTypeArgumentInference.types | 16 +- .../genericCallWithFixedArguments.types | 4 +- ...enericCallWithFunctionTypedArguments.types | 36 +- ...nericCallWithFunctionTypedArguments2.types | 30 +- ...nericCallWithFunctionTypedArguments3.types | 6 +- ...nericCallWithFunctionTypedArguments4.types | 6 +- ...ricCallWithGenericSignatureArguments.types | 32 +- ...icCallWithGenericSignatureArguments3.types | 28 +- .../genericCallWithNonGenericArgs1.types | 4 +- .../genericCallWithNonSymmetricSubtypes.types | 22 +- .../genericCallWithObjectLiteralArgs.types | 20 +- .../genericCallWithObjectTypeArgs.types | 6 +- .../genericCallWithObjectTypeArgs2.types | 12 +- ...CallWithObjectTypeArgsAndConstraints.types | 12 +- ...allWithObjectTypeArgsAndConstraints2.types | 20 +- ...ricCallWithObjectTypeArgsAndIndexers.types | 8 +- ...lWithObjectTypeArgsAndNumericIndexer.types | 16 +- ...llWithObjectTypeArgsAndStringIndexer.types | 16 +- ...hOverloadedConstructorTypedArguments.types | 26 +- ...WithOverloadedFunctionTypedArguments.types | 30 +- .../reference/genericClassStaticMethod.types | 4 +- ...lassWithFunctionTypedMemberArguments.types | 2 +- .../reference/genericCloduleInModule.types | 2 +- .../genericConstraintDeclaration.types | 2 +- .../genericFunctionHasFreshTypeArgs.types | 6 +- .../genericFunctionSpecializations1.types | 8 +- .../reference/genericFunctions0.types | 4 +- .../reference/genericFunctions1.types | 4 +- .../reference/genericFunctions2.types | 4 +- .../reference/genericFunctions3.types | 4 +- .../reference/genericInference2.types | 15 +- ...stantiationEquivalentToObjectLiteral.types | 12 +- ...enericInterfaceFunctionTypeParameter.types | 4 +- .../genericMethodOverspecialization.types | 24 +- .../reference/genericOverloadSignatures.types | 6 +- .../genericParameterAssignability1.types | 6 +- .../genericStaticAnyTypeFunction.types | 10 +- .../genericTypeParameterEquivalence2.types | 54 +- .../genericTypeWithCallableMembers.js | 2 +- .../genericTypeWithCallableMembers.types | 2 +- .../genericTypeWithCallableMembers2.types | 4 +- .../genericsAndHigherOrderFunctions.types | 14 +- .../genericsManyTypeParameters.types | 21 +- .../reference/getterSetterNonAccessor.types | 32 +- tests/baselines/reference/global.types | 6 +- .../heterogeneousArrayLiterals.types | 8 +- tests/baselines/reference/icomparable.types | 4 +- tests/baselines/reference/idInProp.types | 2 +- .../reference/ifDoWhileStatements.types | 28 +- ...ementGenericWithMismatchedTypes.errors.txt | 11 +- .../implementGenericWithMismatchedTypes.js | 2 +- .../implicitAnyAnyReturningFunction.types | 4 +- ...AnyDeclareFunctionWithoutFormalType2.types | 6 +- .../reference/implicitAnyGenerics.types | 6 +- .../baselines/reference/importDecl.errors.txt | 83 + tests/baselines/reference/importDecl.js | 56 +- tests/baselines/reference/importDecl.types | 228 -- .../reference/importStatements.types | 2 +- .../inOperatorWithValidOperands.types | 2 +- .../indexSignatureTypeInference.errors.txt | 23 - .../indexSignaturesInferentialTyping.types | 12 +- .../reference/inferSecondaryParameter.types | 8 +- ...gumentsInSignatureWithRestParameters.types | 16 +- .../inferentialTypingWithFunctionType.types | 8 +- .../inferentialTypingWithFunctionType2.types | 4 +- ...erentialTypingWithFunctionTypeNested.types | 12 +- ...ngWithFunctionTypeSyntacticScenarios.types | 68 +- .../inferentiallyTypingAnEmptyArray.types | 4 +- ...nfiniteExpansionThroughTypeInference.types | 4 +- .../reference/infinitelyExpandingTypes5.types | 6 +- ...finitelyExpandingTypesNonGenericBase.types | 4 +- ...nheritanceStaticFuncOverridingMethod.types | 4 +- ...aticFuncOverridingPropertyOfFuncType.types | 2 +- ...icFunctionOverridingInstanceProperty.types | 2 +- ...ritedFunctionAssignmentCompatibility.types | 6 +- ...ritedOverloadedSpecializedSignatures.types | 90 - tests/baselines/reference/innerAliases2.types | 2 +- tests/baselines/reference/innerFunc.types | 4 +- .../baselines/reference/innerOverloads.types | 4 +- .../innerTypeArgumentInference.types | 4 +- .../innerTypeParameterShadowingOuterOne.types | 4 +- .../instanceAndStaticDeclarations1.types | 2 +- .../instanceOfInExternalModules.types | 2 +- ...anceofOperatorWithLHSIsTypeParameter.types | 2 +- .../reference/instantiatedModule.types | 6 +- .../interMixingModulesInterfaces0.types | 6 +- .../interMixingModulesInterfaces1.types | 6 +- .../interMixingModulesInterfaces2.types | 2 +- .../interMixingModulesInterfaces3.types | 2 +- .../interMixingModulesInterfaces4.types | 6 +- .../interMixingModulesInterfaces5.types | 6 +- .../reference/interfaceContextualType.types | 8 +- .../interfaceWithPropertyOfEveryType.types | 26 +- .../reference/internalAliasFunction.types | 12 +- ...sFunctionInsideLocalModuleWithExport.types | 12 +- ...nctionInsideLocalModuleWithoutExport.types | 12 +- ...nctionInsideTopLevelModuleWithExport.types | 12 +- ...ionInsideTopLevelModuleWithoutExport.types | 12 +- .../internalAliasWithDottedNameEmit.js | 8 - .../invalidTryStatements2.errors.txt | 31 +- .../reference/invalidUndefinedValues.types | 6 +- tests/baselines/reference/ipromise2.types | 8 +- tests/baselines/reference/ipromise3.types | 8 +- tests/baselines/reference/lambdaASIEmit.types | 12 +- tests/baselines/reference/listFailure.types | 12 +- tests/baselines/reference/literals1.types | 3 - .../localImportNameVsGlobalName.types | 8 +- ...ocalVariablesReturnedFromCatchBlocks.types | 2 +- ...logicalAndOperatorWithTypeParameters.types | 2 +- .../logicalNotOperatorWithBooleanType.types | 12 +- .../logicalNotOperatorWithNumberType.types | 12 +- .../logicalNotOperatorWithStringType.types | 12 +- .../logicalOrOperatorWithTypeParameters.types | 6 +- .../memberAccessMustUseModuleInstances.types | 6 +- .../memberFunctionsWithPublicOverloads.types | 28 +- .../reference/mergedDeclarations1.types | 6 +- .../mergedModuleDeclarationCodeGen2.types | 8 +- .../mergedModuleDeclarationCodeGen3.types | 6 +- .../mergedModuleDeclarationCodeGen4.types | 6 +- .../mergedModuleDeclarationCodeGen5.types | 24 +- .../methodContainingLocalFunction.types | 23 +- .../missingRequiredDeclare.d.errors.txt | 6 + tests/baselines/reference/mixedExports.js | 19 - tests/baselines/reference/mixedExports.types | 38 - .../reference/modFunctionCrash.types | 6 +- .../moduleAliasAsFunctionArgument.types | 4 +- .../reference/moduleCodeGenTest5.types | 4 +- .../moduleMemberWithoutTypeAnnotation1.types | 6 +- .../moduleMemberWithoutTypeAnnotation2.types | 2 +- .../reference/moduleScopingBug.types | 2 +- .../reference/moduleSymbolMerging.types | 21 - .../reference/moduleUnassignedVariable.types | 4 +- .../reference/moduleVisibilityTest1.types | 20 +- .../moduleWithStatementsOfEveryKind.types | 12 +- .../reference/multiCallOverloads.types | 10 +- .../reference/multiImportExport.errors.txt | 26 + .../baselines/reference/multiImportExport.js | 63 - .../reference/multiImportExport.types | 51 - .../reference/multiModuleClodule1.types | 12 +- .../reference/multiModuleFundule1.types | 6 +- tests/baselines/reference/mutrec.types | 12 +- .../nameCollisionsInPropertyAssignments.js | 9 - .../nameCollisionsInPropertyAssignments.types | 12 - .../reference/nameWithRelativePaths.types | 6 +- ...ionExpressionAssignedToClassProperty.types | 4 +- .../namedFunctionExpressionCall.types | 16 +- .../namedFunctionExpressionInModule.types | 3 +- .../negateOperatorWithAnyOtherType.types | 10 +- .../negateOperatorWithBooleanType.types | 12 +- .../negateOperatorWithNumberType.types | 12 +- .../negateOperatorWithStringType.types | 12 +- tests/baselines/reference/nestedIndexer.types | 2 +- .../reference/nestedRecursiveLambda.types | 4 +- .../reference/newOperatorConformance.types | 8 +- tests/baselines/reference/noCatchBlock.js | 14 - tests/baselines/reference/noCatchBlock.js.map | 2 - .../reference/noCatchBlock.sourcemap.txt | 53 - tests/baselines/reference/noCatchBlock.types | 8 - ...isExpressionAndLocalVarInConstructor.types | 31 +- ...nThisExpressionAndLocalVarInFunction.types | 2 +- ...ionThisExpressionAndLocalVarInLambda.types | 23 +- ...ionThisExpressionAndLocalVarInMethod.types | 31 +- ...nThisExpressionAndLocalVarInProperty.types | 31 +- ...isExpressionInFunctionAndVarInGlobal.types | 2 +- .../reference/noConstraintInReturnType1.types | 2 +- .../reference/noImplicitAnyForIn.errors.txt | 42 - .../noImplicitAnyIndexing.errors.txt | 58 - ...icitAnyParametersInAmbientClass.errors.txt | 155 - .../noImplicitAnyParametersInAmbientClass.js | 95 - ...AnyParametersInAmbientFunctions.errors.txt | 89 - ...ImplicitAnyParametersInAmbientFunctions.js | 47 - ...citAnyParametersInAmbientModule.errors.txt | 91 - .../noImplicitAnyParametersInAmbientModule.js | 49 - ...citAnyParametersInBareFunctions.errors.txt | 89 - .../noImplicitAnyParametersInClass.errors.txt | 181 - ...mplicitAnyParametersInInterface.errors.txt | 106 - .../noImplicitAnyParametersInInterface.js | 54 - ...noImplicitAnyParametersInModule.errors.txt | 91 - tests/baselines/reference/noSelfOnVars.types | 2 +- .../reference/nonInstantiatedModule.types | 2 +- tests/baselines/reference/null.types | 4 +- .../reference/nullAssignableToEveryType.types | 2 +- ...ullIsSubtypeOfEverythingButUndefined.types | 6 +- .../reference/objectLitGetterSetter.types | 46 +- .../objectLiteralArraySpecialization.types | 4 +- .../reference/objectLiteralWidened.types | 18 +- .../objectTypeHidingMembersOfObject.types | 4 +- .../reference/objectTypePropertyAccess.types | 4 +- .../objectTypeWithNumericProperty.types | 5 +- ...ctTypeWithStringNamedNumericProperty.types | 13 +- ...ringNamedPropertyOfIllegalCharacters.types | 6 +- .../reference/objectTypesIdentity.types | 102 +- .../reference/objectTypesIdentity2.types | 66 +- ...bjectTypesIdentityWithCallSignatures.types | 114 +- ...jectTypesIdentityWithCallSignatures2.types | 114 +- ...thCallSignaturesDifferingParamCounts.types | 114 +- ...hCallSignaturesDifferingParamCounts2.types | 48 +- ...ntityWithCallSignaturesWithOverloads.types | 118 +- ...TypesIdentityWithConstructSignatures.types | 96 +- ...ypesIdentityWithConstructSignatures2.types | 84 +- ...structSignaturesDifferingParamCounts.types | 84 +- ...pesIdentityWithGenericCallSignatures.types | 114 +- ...esIdentityWithGenericCallSignatures2.types | 114 +- ...CallSignaturesDifferingByConstraints.types | 114 +- ...cCallSignaturesDifferingByReturnType.types | 114 +- ...CallSignaturesDifferingByReturnType2.types | 114 +- ...gnaturesDifferingTypeParameterCounts.types | 114 +- ...naturesDifferingTypeParameterCounts2.types | 42 +- ...ignaturesDifferingTypeParameterNames.types | 114 +- ...hGenericCallSignaturesOptionalParams.types | 114 +- ...GenericCallSignaturesOptionalParams2.types | 114 +- ...GenericCallSignaturesOptionalParams3.types | 114 +- ...ructSignaturesDifferingByConstraints.types | 78 +- ...tructSignaturesDifferingByReturnType.types | 90 +- ...ructSignaturesDifferingByReturnType2.types | 84 +- ...gnaturesDifferingTypeParameterCounts.types | 78 +- ...ignaturesDifferingTypeParameterNames.types | 78 +- ...ricConstructSignaturesOptionalParams.types | 78 +- ...icConstructSignaturesOptionalParams2.types | 78 +- ...icConstructSignaturesOptionalParams3.types | 78 +- ...ectTypesIdentityWithNumericIndexers1.types | 138 +- ...ectTypesIdentityWithNumericIndexers2.types | 138 +- ...ectTypesIdentityWithNumericIndexers3.types | 138 +- .../objectTypesIdentityWithOptionality.types | 54 +- .../objectTypesIdentityWithPrivates.types | 138 +- .../objectTypesIdentityWithPrivates2.types | 40 +- .../objectTypesIdentityWithPublics.types | 102 +- ...bjectTypesIdentityWithStringIndexers.types | 138 +- ...jectTypesIdentityWithStringIndexers2.types | 138 +- .../octalLiteralInStrictModeES3.errors.txt | 5 - .../optionalAccessorsInInterface1.types | 8 +- ...optionalParamReferencingOtherParams1.types | 2 +- tests/baselines/reference/overload2.types | 12 +- tests/baselines/reference/overloadCrash.types | 6 +- .../overloadEquivalenceWithStatics.types | 6 +- .../overloadGenericFunctionWithRestArgs.types | 4 +- .../overloadOnConstConstraintChecks2.types | 8 +- .../overloadOnConstConstraintChecks3.types | 8 +- ...loadOnGenericClassAndNonGenericClass.types | 8 +- .../overloadResolutionOverNonCTLambdas.types | 31 +- ...overloadResolutionOverNonCTObjectLit.types | 2 +- .../reference/overloadReturnTypes.types | 8 +- ...lbacksWithDifferingOptionalityOnArgs.types | 10 +- ...overloadedStaticMethodSpecialization.types | 6 +- .../overloadsAndTypeArgumentArity.types | 12 +- ...rentContainersDisagreeOnAmbient.errors.txt | 11 - ...sInDifferentContainersDisagreeOnAmbient.js | 17 - .../parametersWithNoAnnotationAreAny.types | 20 +- tests/baselines/reference/parser579071.types | 1 - tests/baselines/reference/parser596700.types | 1 - tests/baselines/reference/parser630933.types | 1 - .../baselines/reference/parser645086_3.types | 1 - .../baselines/reference/parser645086_4.types | 1 - tests/baselines/reference/parser768531.types | 5 +- .../parserAccessibilityAfterStatic11.types | 2 +- .../parserAccessibilityAfterStatic14.types | 2 +- .../reference/parserAccessors1.errors.txt | 4 +- tests/baselines/reference/parserAccessors1.js | 17 - ...errors.txt => parserAccessors2.errors.txt} | 2 +- tests/baselines/reference/parserAccessors2.js | 17 - .../reference/parserAccessors2.types | 8 - .../reference/parserAccessors3.errors.txt | 4 +- tests/baselines/reference/parserAccessors3.js | 6 - ...errors.txt => parserAccessors4.errors.txt} | 2 +- tests/baselines/reference/parserAccessors4.js | 6 - .../reference/parserAccessors4.types | 7 - .../reference/parserAccessors5.errors.txt | 2 +- .../reference/parserAccessors6.errors.txt | 2 +- .../reference/parserAccessors7.errors.txt | 2 +- .../reference/parserAccessors8.errors.txt | 2 +- .../reference/parserAccessors9.errors.txt | 2 +- .../parserAssignmentExpression1.errors.txt | 8 - .../reference/parserAssignmentExpression1.js | 5 - .../parserConstructorDeclaration11.errors.txt | 8 - .../baselines/reference/parserDoStatement2.js | 8 - .../reference/parserDoStatement2.types | 3 - .../reference/parserES3Accessors1.errors.txt | 8 - .../reference/parserES3Accessors3.errors.txt | 6 - ...very_ExtendsOrImplementsClause6.errors.txt | 4 - .../reference/parserForStatement4.errors.txt | 9 - .../reference/parserForStatement4.js | 7 - .../reference/parserForStatement5.errors.txt | 7 - .../reference/parserForStatement5.js | 7 - .../reference/parserForStatement6.errors.txt | 9 - .../reference/parserForStatement6.js | 7 - .../reference/parserForStatement7.errors.txt | 9 - .../reference/parserForStatement7.js | 7 - .../reference/parserForStatement8.errors.txt | 7 - .../reference/parserForStatement8.js | 7 - .../parserFunctionDeclaration1.d.types | 2 +- .../parserFunctionDeclaration5.types | 4 +- .../parserFunctionDeclaration8.types | 2 +- ...rGetAccessorWithTypeParameters1.errors.txt | 2 +- .../parserGreaterThanTokenAmbiguity10.types | 5 +- .../parserGreaterThanTokenAmbiguity5.types | 5 +- .../parserKeywordsAsIdentifierName1.types | 6 +- ...parserKeywordsAsIdentifierName2.errors.txt | 2 +- .../parserMemberAccessor1.errors.txt | 6 +- .../reference/parserMemberAccessor1.js | 20 - ...arserMemberAccessorDeclaration1.errors.txt | 4 +- .../parserMemberAccessorDeclaration1.js | 17 - ...rserMemberAccessorDeclaration10.errors.txt | 4 +- ...rserMemberAccessorDeclaration11.errors.txt | 4 +- ...rserMemberAccessorDeclaration12.errors.txt | 2 +- ...rserMemberAccessorDeclaration13.errors.txt | 2 +- ...rserMemberAccessorDeclaration14.errors.txt | 2 +- ...rserMemberAccessorDeclaration15.errors.txt | 2 +- ...rserMemberAccessorDeclaration16.errors.txt | 2 +- ...rserMemberAccessorDeclaration17.errors.txt | 2 +- ...rserMemberAccessorDeclaration18.errors.txt | 2 +- ...arserMemberAccessorDeclaration2.errors.txt | 4 +- .../parserMemberAccessorDeclaration2.js | 17 - ...arserMemberAccessorDeclaration3.errors.txt | 4 +- .../parserMemberAccessorDeclaration3.js | 17 - ...arserMemberAccessorDeclaration4.errors.txt | 6 + .../parserMemberAccessorDeclaration4.js | 17 - .../parserMemberAccessorDeclaration4.types | 8 - ...arserMemberAccessorDeclaration5.errors.txt | 6 + .../parserMemberAccessorDeclaration5.js | 17 - .../parserMemberAccessorDeclaration5.types | 7 - ...arserMemberAccessorDeclaration6.errors.txt | 6 + .../parserMemberAccessorDeclaration6.js | 17 - .../parserMemberAccessorDeclaration6.types | 7 - ...arserMemberAccessorDeclaration7.errors.txt | 4 +- ...arserMemberAccessorDeclaration8.errors.txt | 4 +- ...arserMemberAccessorDeclaration9.errors.txt | 4 +- .../reference/parserModuleDeclaration11.types | 6 +- .../parserObjectCreation2.errors.txt | 4 - .../reference/parserObjectCreation2.js | 5 - .../reference/parserObjectLiterals1.js | 5 - .../reference/parserObjectLiterals1.types | 7 - .../reference/parserObjectType5.errors.txt | 9 - .../reference/parserObjectType6.errors.txt | 9 - .../parserPostfixUnaryExpression1.errors.txt | 10 - .../reference/parserReturnStatement3.types | 2 +- .../reference/parserS7.6.1.1_A1.10.errors.txt | 21 + .../reference/parserS7.6.1.1_A1.10.types | 16 - ...rSetAccessorWithTypeAnnotation1.errors.txt | 2 +- ...rSetAccessorWithTypeParameters1.errors.txt | 2 +- .../parserSyntaxWalker.generated.errors.txt | 334 ++ .../parserSyntaxWalker.generated.types | 281 -- .../parserUnaryExpression1.errors.txt | 4 - .../reference/parserUnaryExpression1.js | 5 - .../parserUnaryExpression2.errors.txt | 4 - .../reference/parserUnaryExpression2.js | 6 - .../parserUnaryExpression3.errors.txt | 4 - .../reference/parserUnaryExpression3.js | 5 - .../parserUnaryExpression4.errors.txt | 4 - .../reference/parserUnaryExpression4.js | 5 - .../parserUnaryExpression5.errors.txt | 6 - .../reference/parserUnaryExpression5.js | 5 - .../reference/parserUnaryExpression6.js | 4 - .../reference/parserUnaryExpression6.types | 3 - .../parserUnaryExpression7.errors.txt | 6 - .../reference/parserUnaryExpression7.js | 5 - .../parserUnicodeWhitespaceCharacter1.types | 2 +- .../reference/parserX_ArrowFunction4.js | 8 - ...sWhenHittingUnexpectedSemicolon.errors.txt | 8 - .../reference/partiallyAmbientClodule.types | 2 +- .../reference/partiallyAmbientFundule.types | 2 +- .../plusOperatorWithBooleanType.types | 12 +- .../plusOperatorWithNumberType.types | 12 +- .../plusOperatorWithStringType.types | 12 +- ...refixIncrementAsOperandOfPlusExpression.js | 11 - ...ixIncrementAsOperandOfPlusExpression.types | 17 - .../prespecializedGenericMembers1.types | 4 +- .../reference/primtiveTypesAreIdentical.types | 44 +- .../privacyAccessorDeclFile.errors.txt | 1130 ------ .../reference/privacyAccessorDeclFile.js | 3555 ----------------- ...ivacyCannotNameAccessorDeclFile.errors.txt | 151 - ...rivacyCannotNameVarTypeDeclFile.errors.txt | 123 - .../privacyCheckAnonymousFunctionParameter.js | 4 - ...ivacyCheckAnonymousFunctionParameter.types | 14 +- ...privacyCheckAnonymousFunctionParameter2.js | 4 - ...vacyCheckAnonymousFunctionParameter2.types | 6 +- ...lbackOfInterfaceMethodWithTypeParameter.js | 8 - ...rtAssignmentOnExportedGenericInterface1.js | 11 - ...rtAssignmentOnExportedGenericInterface2.js | 10 - ...nalModuleExportAssignmentOfGenericClass.js | 14 - ...arameterReferenceInConstructorParameter.js | 9 - .../privacyCheckTypeOfFunction.errors.txt | 8 +- .../reference/privacyCheckTypeOfFunction.js | 12 - ...CheckTypeOfInvisibleModuleError.errors.txt | 11 - ...ivacyCheckTypeOfInvisibleModuleError.types | 17 + ...ivacyClassExtendsClauseDeclFile.errors.txt | 106 - .../privacyClassExtendsClauseDeclFile.js | 351 -- ...cyClassImplementsClauseDeclFile.errors.txt | 105 - .../privacyClassImplementsClauseDeclFile.js | 239 -- tests/baselines/reference/privacyFunc.types | 30 +- ...CannotNameParameterTypeDeclFile.errors.txt | 203 - ...ionCannotNameReturnTypeDeclFile.errors.txt | 186 - ...rivacyFunctionParameterDeclFile.errors.txt | 805 ---- .../privacyFunctionParameterDeclFile.js | 1279 ------ ...ivacyFunctionReturnTypeDeclFile.errors.txt | 1324 ------ .../privacyFunctionReturnTypeDeclFile.js | 2279 ----------- .../reference/privacyGetter.errors.txt | 304 ++ tests/baselines/reference/privacyGetter.types | 410 -- .../baselines/reference/privacyGloFunc.types | 72 +- .../reference/privacyGloGetter.errors.txt | 129 + .../reference/privacyGloGetter.types | 174 - .../reference/privacyGloImport.errors.txt | 145 +- .../privacyGloImportParseErrors.errors.txt | 185 - .../reference/privacyImport.errors.txt | 460 ++- .../privacyImportParseErrors.errors.txt | 455 --- ...yInterfaceExtendsClauseDeclFile.errors.txt | 105 - .../privacyInterfaceExtendsClauseDeclFile.js | 98 - ...ternalReferenceImportWithExport.errors.txt | 167 - ...calInternalReferenceImportWithExport.types | 537 +++ ...nalReferenceImportWithoutExport.errors.txt | 163 - ...InternalReferenceImportWithoutExport.types | 537 +++ ...tExternalModuleImportWithExport.errors.txt | 57 + ...elAmbientExternalModuleImportWithExport.js | 70 +- ...mbientExternalModuleImportWithExport.types | 113 - ...ternalModuleImportWithoutExport.errors.txt | 49 + ...mbientExternalModuleImportWithoutExport.js | 36 - ...entExternalModuleImportWithoutExport.types | 113 - ...ternalReferenceImportWithExport.errors.txt | 114 - ...velInternalReferenceImportWithExport.types | 312 ++ ...nalReferenceImportWithoutExport.errors.txt | 111 - ...velInternalReferenceImportWithoutExport.js | 1 - ...InternalReferenceImportWithoutExport.types | 312 ++ .../privacyTypeParameterOfFunction.errors.txt | 135 + .../privacyTypeParameterOfFunction.types | 303 -- ...TypeParameterOfFunctionDeclFile.errors.txt | 511 --- .../privacyTypeParameterOfFunctionDeclFile.js | 816 ---- .../privacyTypeParametersOfClass.errors.txt | 46 + .../privacyTypeParametersOfClass.types | 104 - ...cyTypeParametersOfClassDeclFile.errors.txt | 163 - .../privacyTypeParametersOfClassDeclFile.js | 383 -- ...rivacyTypeParametersOfInterface.errors.txt | 61 + .../privacyTypeParametersOfInterface.js | 83 - .../privacyTypeParametersOfInterface.types | 199 - ...peParametersOfInterfaceDeclFile.errors.txt | 231 -- ...rivacyTypeParametersOfInterfaceDeclFile.js | 265 -- .../reference/privacyVarDeclFile.errors.txt | 484 --- .../reference/promiseChaining.errors.txt | 136 + .../baselines/reference/promiseChaining.types | 59 - .../reference/promiseChaining2.errors.txt | 13 - tests/baselines/reference/promiseChaining2.js | 24 +- .../reference/promiseChaining2.types | 3 + tests/baselines/reference/promiseTest.types | 8 +- .../reference/promiseTypeInference.types | 8 +- .../propagationOfPromiseInitialization.types | 30 +- ...AccessOnTypeParameterWithConstraints.types | 12 +- ...ccessOnTypeParameterWithConstraints2.types | 12 +- ...essOnTypeParameterWithoutConstraints.types | 12 +- .../propertyNameWithoutTypeAnnotation.types | 4 +- ...opertyParameterWithQuestionMark.errors.txt | 16 - .../protoAsIndexInIndexExpression.types | 12 +- tests/baselines/reference/rectype.types | 30 +- .../recursiveComplicatedClasses.types | 4 +- .../reference/recursiveFunctionTypes1.types | 6 +- .../recursiveGenericMethodCall.types | 4 +- ...cursiveGenericSignatureInstantiation.types | 4 +- ...recursiveIdenticalOverloadResolution.types | 30 +- .../reference/recursiveInference1.types | 8 +- tests/baselines/reference/recursiveMods.types | 14 +- .../reference/recursiveReturns.types | 12 +- .../reference/regExpWithSlashInCharClass.js | 10 - .../regExpWithSlashInCharClass.types | 22 - .../reservedNameOnInterfaceImport.errors.txt | 10 - .../reservedNameOnInterfaceImport.js | 10 - .../reference/reservedNameOnModuleImport.js | 10 - .../reservedNameOnModuleImport.types | 13 - ...NameOnModuleImportWithInterface.errors.txt | 11 - ...reservedNameOnModuleImportWithInterface.js | 11 - tests/baselines/reference/reservedWords.types | 15 +- .../restParameterNoTypeAnnotation.types | 2 +- .../baselines/reference/restParameters.types | 8 +- .../reference/returnStatement1.types | 6 +- .../reference/returnStatements.types | 24 +- .../returnTypeParameterWithModules.types | 12 +- ...seInferenceInContextualInstantiation.types | 4 +- .../reference/scannerES3NumericLiteral1.js | 5 - .../reference/scannerES3NumericLiteral1.types | 3 - .../reference/scannerES3NumericLiteral2.js | 5 - .../reference/scannerES3NumericLiteral2.types | 3 - .../scannerES3NumericLiteral3.errors.txt | 4 - .../scannerES3NumericLiteral4.errors.txt | 4 - .../reference/scannerES3NumericLiteral5.js | 5 - .../reference/scannerES3NumericLiteral5.types | 3 - .../scannerES3NumericLiteral6.errors.txt | 4 - .../reference/scannerES3NumericLiteral7.js | 5 - .../reference/scannerES3NumericLiteral7.types | 3 - .../scannerNumericLiteral2.errors.txt | 4 - .../reference/scannerNumericLiteral2.js | 5 + .../reference/scannerNumericLiteral2.types | 3 + .../scannerNumericLiteral3.errors.txt | 4 +- .../scannerNumericLiteral8.errors.txt | 4 - .../scannerNumericLiteral9.errors.txt | 6 - .../scopeResolutionIdentifiers.types | 2 +- tests/baselines/reference/selfInLambdas.types | 52 +- tests/baselines/reference/separate1-2.types | 2 +- .../sourceMap-FileWithComments.types | 2 +- .../reference/sourceMap-SkippedNode.js | 13 - .../reference/sourceMap-SkippedNode.js.map | 2 - .../sourceMap-SkippedNode.sourcemap.txt | 52 - .../reference/sourceMap-SkippedNode.types | 7 - .../sourceMapValidationClass.errors.txt | 23 + .../reference/sourceMapValidationClass.js | 49 - .../reference/sourceMapValidationClass.js.map | 2 - .../sourceMapValidationClass.sourcemap.txt | 388 -- .../reference/sourceMapValidationClass.types | 52 - .../sourceMapValidationClasses.types | 6 +- ...ceMapValidationExportAssignmentCommonjs.js | 14 - ...pValidationExportAssignmentCommonjs.js.map | 2 - ...tionExportAssignmentCommonjs.sourcemap.txt | 89 - ...apValidationExportAssignmentCommonjs.types | 10 - ...urceMapValidationFunctionExpressions.types | 5 +- .../sourceMapValidationFunctions.types | 6 +- .../reference/sourceMapValidationModule.types | 2 +- .../sourceMapValidationWithComments.types | 2 +- ...rceMapWithMultipleFilesWithCopyright.types | 5 +- ...cializationsShouldNotAffectEachOther.types | 2 +- .../reference/specializeVarArgs1.types | 4 +- .../specializedLambdaTypeArguments.errors.txt | 9 + .../specializedLambdaTypeArguments.js | 2 +- .../specializedLambdaTypeArguments.types | 16 - .../specializedSignatureInInterface.js | 11 - .../specializedSignatureInInterface.types | 18 - ...reIsSubtypeOfNonSpecializedSignature.types | 6 +- .../reference/staticAndMemberFunctions.types | 2 +- ...staticAndNonStaticPropertiesSameName.types | 2 +- .../baselines/reference/staticFactory1.types | 6 +- tests/baselines/reference/staticGetter2.types | 2 +- .../reference/staticInheritance.types | 10 +- .../reference/staticInstanceResolution.types | 2 +- .../reference/staticInstanceResolution3.types | 6 +- .../staticInterfaceAssignmentCompat.types | 2 +- .../staticMemberAccessOffDerivedType1.types | 6 +- ...dWithTypeParameterExtendsClauseDeclFile.js | 66 - ...thTypeParameterExtendsClauseDeclFile.types | 44 - tests/baselines/reference/stradac.types | 2 +- tests/baselines/reference/strictMode2.types | 2 +- tests/baselines/reference/strictMode3.types | 2 +- tests/baselines/reference/strictMode5.js | 46 - tests/baselines/reference/strictMode5.types | 40 - ...ralPropertyNameWithLineContinuation1.types | 3 +- .../reference/stringNamedPropertyAccess.types | 4 +- .../reference/stringPropCodeGen.types | 7 +- tests/baselines/reference/structural1.types | 4 +- .../subtypingWithCallSignatures.types | 16 +- .../subtypingWithCallSignatures2.types | 108 +- .../subtypingWithCallSignatures3.types | 68 +- .../subtypingWithCallSignatures4.types | 66 +- .../subtypingWithConstructSignatures.types | 16 +- .../subtypingWithConstructSignatures2.types | 108 +- .../subtypingWithConstructSignatures3.types | 68 +- .../subtypingWithConstructSignatures4.types | 66 +- .../subtypingWithOptionalProperties.types | 4 +- .../reference/superAccessInFatArrow1.types | 8 +- ...FromClassThatDerivesFromGenericType1.types | 2 +- tests/baselines/reference/superCalls.types | 4 +- .../reference/superWithGenerics.types | 2 +- .../reference/switchFallThroughs.types | 2 +- .../reference/switchStatements.types | 10 +- ...hStatementsWithMultipleDefaults.errors.txt | 50 - .../baselines/reference/targetTypeArgs.types | 4 +- .../reference/targetTypeObjectLiteral.types | 18 +- .../targetTypeObjectLiteralToAny.types | 10 +- .../baselines/reference/targetTypeTest2.types | 6 +- .../reference/testContainerList.types | 13 - tests/baselines/reference/thisBinding2.types | 50 +- tests/baselines/reference/thisCapture1.types | 16 +- .../thisExpressionInIndexExpression.types | 2 +- .../thisInGenericStaticMembers.types | 16 +- .../reference/thisInInnerFunctions.types | 7 +- tests/baselines/reference/thisInLambda.types | 26 +- .../reference/thisInModuleFunction1.types | 6 +- .../reference/thisInObjectLiterals.types | 10 +- .../thisInPropertyBoundDeclarations.types | 73 +- .../reference/thisInStaticMethod1.types | 6 +- ...rencedInFunctionInsideArrowFunction1.types | 9 +- .../throwInEnclosingStatements.types | 13 +- .../baselines/reference/throwStatements.types | 22 +- .../baselines/reference/topLevelExports.types | 4 +- .../baselines/reference/topLevelLambda2.types | 4 +- .../baselines/reference/trailingCommasES3.js | 25 - .../reference/trailingCommasES3.types | 47 - .../baselines/reference/trailingCommasES5.js | 25 - .../reference/trailingCommasES5.types | 47 - tests/baselines/reference/tryStatements.types | 2 +- ...notationBestCommonTypeInArrayLiteral.types | 28 +- .../reference/typeArgInference2.types | 14 +- .../reference/typeArgInferenceWithNull.types | 12 +- .../reference/typeArgumentInference.types | 106 +- .../typeArgumentInferenceOrdering.types | 4 +- ...tInferenceWithConstraintAsCommonRoot.types | 4 +- .../typeArgumentsInFunctionExpressions.types | 10 +- ...ssionWithUndefinedCallResolutionData.types | 6 +- .../typeInferenceConflictingCandidates.types | 4 +- .../reference/typeInferenceFixEarly.types | 4 +- .../typeInferenceReturnTypeCallback.types | 8 +- .../typeInferenceWithTypeAnnotation.types | 4 +- .../typeOfThisInFunctionExpression.types | 34 +- .../typeOfThisInMemberFunctions.types | 6 +- .../reference/typeOfThisInStaticMembers.types | 20 +- .../typeParameterAndArgumentOfSameName1.types | 2 +- .../typeParameterAsElementType.types | 2 +- .../typeParameterAsTypeArgument.types | 4 +- ...sTypeParameterConstraintTransitively.types | 20 +- ...TypeParameterConstraintTransitively2.types | 18 +- ...eterCompatibilityAccrossDeclarations.types | 8 +- ...ameterWithInvalidConstraintType.errors.txt | 13 - ...peParametersAreIdenticalToThemselves.types | 14 +- ...typeParametersAvailableInNestedScope.types | 5 +- ...ypeParametersAvailableInNestedScope2.types | 2 +- .../reference/typeQueryWithReservedWords.js | 29 - .../typeQueryWithReservedWords.types | 37 - tests/baselines/reference/typeofClass2.types | 10 +- .../typeofOperatorWithBooleanType.types | 18 +- .../typeofOperatorWithNumberType.types | 18 +- .../typeofOperatorWithStringType.types | 18 +- .../reference/uncaughtCompilerError1.types | 2 +- .../undefinedArgumentInference.types | 4 +- .../undefinedAssignableToEveryType.types | 2 +- .../undefinedInferentialTyping.types | 4 +- .../reference/underscoreMapFirst.types | 18 +- .../baselines/reference/underscoreTest1.types | 102 +- .../untypedArgumentInLambdaExpression.types | 12 +- .../reference/unusedImportDeclaration.js | 8 - .../reference/unusedImportDeclaration.types | 8 +- .../validMultipleVariableDeclarations.types | 2 +- .../reference/validUndefinedAssignments.types | 2 +- .../reference/varArgParamTypeCheck.types | 56 +- .../varInFunctionInVarInitializer.types | 5 +- tests/baselines/reference/vardecl.types | 2 +- .../reference/variableDeclarator1.types | 5 +- .../visibilityOfCrossModuleTypeUsage.types | 2 +- .../voidFunctionAssignmentCompat.types | 8 +- .../voidOperatorWithBooleanType.types | 12 +- .../voidOperatorWithNumberType.types | 12 +- .../voidOperatorWithStringType.types | 12 +- .../reference/voidReturnLambdaValue.types | 2 +- .../baselines/reference/withImportDecl.types | 10 +- .../accessorParameterAccessibilityModifier.ts | 2 +- .../cases/compiler/accessorWithInitializer.ts | 2 +- tests/cases/compiler/accessorWithRestParam.ts | 2 - .../cases/compiler/aliasInaccessibleModule.ts | 1 - .../compiler/aliasInaccessibleModule2.ts | 1 - .../compiler/aliasUsageInAccessorsOfClass.ts | 1 - ...entExternalModuleWithRelativeModuleName.ts | 4 - tests/cases/compiler/ambientGetters.ts | 2 - tests/cases/compiler/amdDependencyComment2.ts | 5 - .../arrowFunctionMissingCurlyWithSemicolon.ts | 4 - .../compiler/arrowFunctionsMissingTokens.ts | 66 - .../compiler/asiAmbientFunctionDeclaration.ts | 1 - tests/cases/compiler/asiBreak.ts | 1 - tests/cases/compiler/asiContinue.ts | 1 - tests/cases/compiler/asiReturn.ts | 2 - .../compiler/assignmentCompatability24.ts | 2 +- .../compiler/assignmentCompatability33.ts | 2 +- .../compiler/assignmentCompatability34.ts | 2 +- .../compiler/assignmentCompatability37.ts | 2 +- .../compiler/assignmentCompatability38.ts | 2 +- tests/cases/compiler/augmentArray.ts | 3 - .../autoAsiForStaticsInClassDeclaration.ts | 4 - tests/cases/compiler/badArraySyntax.ts | 2 +- .../breakInIterationOrSwitchStatement1.ts | 3 + .../breakInIterationOrSwitchStatement2.ts | 4 + .../breakInIterationOrSwitchStatement3.ts | 3 + .../breakInIterationOrSwitchStatement4.ts | 3 + .../breakNotInIterationOrSwitchStatement1.ts | 1 + .../breakNotInIterationOrSwitchStatement2.ts | 5 + tests/cases/compiler/breakTarget1.ts | 2 + tests/cases/compiler/breakTarget2.ts | 4 + tests/cases/compiler/breakTarget3.ts | 5 + tests/cases/compiler/breakTarget4.ts | 5 + tests/cases/compiler/breakTarget5.ts | 8 + tests/cases/compiler/breakTarget6.ts | 3 + .../cases/compiler/captureThisInSuperCall.ts | 8 - .../compiler/castExpressionParentheses.ts | 2 +- tests/cases/compiler/chainedImportAlias.ts | 7 +- .../classImplementsImportedInterface.ts | 12 - .../compiler/commentsDottedModuleName.ts | 11 - .../compiler/commentsMultiModuleMultiFile.ts | 4 +- tests/cases/compiler/complicatedPrivacy.ts | 1 - .../cases/compiler/constructorArgsErrors3.ts | 4 - .../cases/compiler/constructorArgsErrors4.ts | 4 - .../cases/compiler/constructorArgsErrors5.ts | 4 - .../constructorsWithSpecializedSignatures.ts | 43 - .../contextualSignatureInstantiation3.ts | 22 - tests/cases/compiler/contextualTyping.ts | 3 +- .../compiler/continueInIterationStatement1.ts | 3 + .../compiler/continueInIterationStatement2.ts | 4 + .../compiler/continueInIterationStatement3.ts | 3 + .../compiler/continueInIterationStatement4.ts | 3 + tests/cases/compiler/continueLabel.ts | 3 + .../continueNotInIterationStatement1.ts | 1 + .../continueNotInIterationStatement2.ts | 5 + .../continueNotInIterationStatement3.ts | 4 + .../continueNotInIterationStatement4.ts | 6 + tests/cases/compiler/continueTarget1.ts | 2 + tests/cases/compiler/continueTarget2.ts | 4 + tests/cases/compiler/continueTarget3.ts | 5 + tests/cases/compiler/continueTarget4.ts | 5 + tests/cases/compiler/continueTarget5.ts | 8 + tests/cases/compiler/continueTarget6.ts | 3 + tests/cases/compiler/convertKeywordsYes.ts | 8 + tests/cases/compiler/cyclicModuleImport.ts | 1 - tests/cases/compiler/declFileAccessors.ts | 104 - .../cases/compiler/declFileCallSignatures.ts | 68 - .../compiler/declFileConstructSignatures.ts | 68 - tests/cases/compiler/declFileConstructors.ts | 100 - tests/cases/compiler/declFileFunctions.ts | 62 - .../declFileImportChainInExportAssignment.ts | 11 - .../cases/compiler/declFileIndexSignatures.ts | 38 - tests/cases/compiler/declFileMethods.ts | 192 - .../compiler/declarationEmit_nameConflicts.ts | 4 +- .../declarationEmit_nameConflicts2.ts | 1 + .../declarationEmit_nameConflicts3.ts | 2 +- .../declarationEmit_nameConflictsWithAlias.ts | 2 +- ...tAssignmentWithVarFromVariableStatement.ts | 20 - tests/cases/compiler/duplicateLabel1.ts | 4 + tests/cases/compiler/duplicateLabel2.ts | 6 + tests/cases/compiler/duplicateLabel3.ts | 8 + tests/cases/compiler/duplicateLabel4.ts | 7 + .../duplicatePropertiesInStrictMode.ts | 5 - tests/cases/compiler/duplicateVarAndImport.ts | 5 - .../cases/compiler/duplicateVarAndImport2.ts | 4 - tests/cases/compiler/emitBOM.ts | 6 - tests/cases/compiler/emptyTypeArgumentList.ts | 2 - .../compiler/emptyTypeArgumentListWithNew.ts | 2 - tests/cases/compiler/enumBasics1.ts | 2 +- .../compiler/enumInitializersWithExponents.ts | 9 - ...AssignmentWithDeclareAndExportModifiers.ts | 2 - .../exportAssignmentWithDeclareModifier.ts | 2 - .../exportAssignmentWithExportModifier.ts | 2 - .../fileReferencesWithNoExtensions.ts | 19 - .../functionAndInterfaceWithSeparateErrors.ts | 7 - ...nsMissingReturnStatementsAndExpressions.ts | 119 - .../genericTypeWithCallableMembers.ts | 2 +- .../implementGenericWithMismatchedTypes.ts | 2 +- tests/cases/compiler/importDecl.ts | 1 + .../compiler/indexSignatureTypeInference.ts | 19 - ...nheritedOverloadedSpecializedSignatures.ts | 36 - .../internalAliasWithDottedNameEmit.ts | 1 - .../compiler/missingRequiredDeclare.d.ts | 1 + tests/cases/compiler/mixedExports.ts | 16 - tests/cases/compiler/moduleSymbolMerging.ts | 12 - tests/cases/compiler/multiImportExport.ts | 2 - .../nameCollisionsInPropertyAssignments.ts | 2 - tests/cases/compiler/noCatchBlock.ts | 7 - tests/cases/compiler/noImplicitAnyForIn.ts | 32 - tests/cases/compiler/noImplicitAnyIndexing.ts | 49 - .../noImplicitAnyParametersInAmbientClass.ts | 93 - ...ImplicitAnyParametersInAmbientFunctions.ts | 45 - .../noImplicitAnyParametersInAmbientModule.ts | 47 - .../noImplicitAnyParametersInBareFunctions.ts | 45 - .../noImplicitAnyParametersInClass.ts | 93 - .../noImplicitAnyParametersInInterface.ts | 52 - .../noImplicitAnyParametersInModule.ts | 47 - ...sInDifferentContainersDisagreeOnAmbient.ts | 8 - ...sRecoversWhenHittingUnexpectedSemicolon.ts | 4 - ...refixIncrementAsOperandOfPlusExpression.ts | 4 - .../cases/compiler/privacyAccessorDeclFile.ts | 1061 ----- .../privacyCannotNameAccessorDeclFile.ts | 138 - .../privacyCannotNameVarTypeDeclFile.ts | 101 - .../privacyCheckAnonymousFunctionParameter.ts | 1 - ...privacyCheckAnonymousFunctionParameter2.ts | 1 - ...lbackOfInterfaceMethodWithTypeParameter.ts | 1 - ...rtAssignmentOnExportedGenericInterface1.ts | 1 - ...rtAssignmentOnExportedGenericInterface2.ts | 1 - ...nalModuleExportAssignmentOfGenericClass.ts | 1 - ...arameterReferenceInConstructorParameter.ts | 1 - .../compiler/privacyCheckTypeOfFunction.ts | 2 - .../privacyCheckTypeOfInvisibleModuleError.ts | 1 - .../privacyClassExtendsClauseDeclFile.ts | 97 - .../privacyClassImplementsClauseDeclFile.ts | 94 - ...FunctionCannotNameParameterTypeDeclFile.ts | 157 - ...acyFunctionCannotNameReturnTypeDeclFile.ts | 163 - .../privacyFunctionParameterDeclFile.ts | 687 ---- .../privacyFunctionReturnTypeDeclFile.ts | 1194 ------ tests/cases/compiler/privacyGetter.ts | 1 - tests/cases/compiler/privacyGloGetter.ts | 1 - tests/cases/compiler/privacyGloImport.ts | 98 +- .../compiler/privacyGloImportParseErrors.ts | 153 - tests/cases/compiler/privacyImport.ts | 357 +- .../compiler/privacyImportParseErrors.ts | 357 -- .../privacyInterfaceExtendsClauseDeclFile.ts | 94 - ...yLocalInternalReferenceImportWithExport.ts | 1 - ...calInternalReferenceImportWithoutExport.ts | 1 - ...elAmbientExternalModuleImportWithExport.ts | 19 +- ...mbientExternalModuleImportWithoutExport.ts | 3 - ...pLevelInternalReferenceImportWithExport.ts | 1 - ...velInternalReferenceImportWithoutExport.ts | 2 - .../privacyTypeParameterOfFunction.ts | 1 - .../privacyTypeParameterOfFunctionDeclFile.ts | 440 -- .../compiler/privacyTypeParametersOfClass.ts | 1 - .../privacyTypeParametersOfClassDeclFile.ts | 155 - .../privacyTypeParametersOfInterface.ts | 1 - ...rivacyTypeParametersOfInterfaceDeclFile.ts | 192 - tests/cases/compiler/privacyVarDeclFile.ts | 426 -- tests/cases/compiler/promiseChaining.ts | 24 + tests/cases/compiler/promiseChaining2.ts | 10 - .../propertyParameterWithQuestionMark.ts | 9 - .../compiler/regExpWithSlashInCharClass.ts | 3 - .../compiler/reservedNameOnInterfaceImport.ts | 6 - .../compiler/reservedNameOnModuleImport.ts | 6 - ...reservedNameOnModuleImportWithInterface.ts | 7 - tests/cases/compiler/sourceMap-SkippedNode.ts | 6 - .../compiler/sourceMapValidationClass.ts | 1 - ...ceMapValidationExportAssignmentCommonjs.ts | 6 - .../specializedLambdaTypeArguments.ts | 2 +- .../specializedSignatureInInterface.ts | 8 - ...dWithTypeParameterExtendsClauseDeclFile.ts | 22 - tests/cases/compiler/strictMode5.ts | 18 - .../switchStatementsWithMultipleDefaults.ts | 31 - tests/cases/compiler/testContainerList.ts | 6 - tests/cases/compiler/trailingCommasES3.ts | 13 - tests/cases/compiler/trailingCommasES5.ts | 13 - .../typeParameterWithInvalidConstraintType.ts | 10 - .../cases/compiler/unusedImportDeclaration.ts | 1 - .../classExtendingPrimitive2.ts | 4 - .../classExtendsEveryObjectType2.ts | 3 - .../Accessors/parserES3Accessors1.ts | 3 - .../Accessors/parserES3Accessors2.ts | 3 - .../Accessors/parserES3Accessors3.ts | 1 - .../Accessors/parserES3Accessors4.ts | 1 - .../ecmascript5/Accessors/parserAccessors1.ts | 1 - .../Accessors/parserAccessors10.ts | 1 - .../ecmascript5/Accessors/parserAccessors2.ts | 1 - .../ecmascript5/Accessors/parserAccessors3.ts | 1 - .../ecmascript5/Accessors/parserAccessors4.ts | 1 - .../ecmascript5/Accessors/parserAccessors5.ts | 1 - .../ecmascript5/Accessors/parserAccessors6.ts | 1 - .../ecmascript5/Accessors/parserAccessors7.ts | 1 - .../ecmascript5/Accessors/parserAccessors8.ts | 1 - .../ecmascript5/Accessors/parserAccessors9.ts | 1 - .../parserGetAccessorWithTypeParameters1.ts | 1 - .../parserSetAccessorWithTypeAnnotation1.ts | 1 - .../parserSetAccessorWithTypeParameters1.ts | 1 - .../parserConstructorDeclaration11.ts | 3 - ...rX_ArrowFunction1.ts => ArrowFunction1.ts} | 0 ...rX_ArrowFunction2.ts => ArrowFunction2.ts} | 0 ...rX_ArrowFunction3.ts => ArrowFunction3.ts} | 0 ...rX_ArrowFunction4.ts => ArrowFunction4.ts} | 0 ...rrorRecovery_ExtendsOrImplementsClause6.ts | 1 - ...eArgumentList1.ts => TypeArgumentList1.ts} | 0 .../parserAssignmentExpression1.ts | 1 - .../Expressions/parserObjectCreation2.ts | 1 - .../parserPostfixUnaryExpression1.ts | 1 - .../Expressions/parserUnaryExpression1.ts | 1 - .../Expressions/parserUnaryExpression2.ts | 1 - .../Expressions/parserUnaryExpression3.ts | 1 - .../Expressions/parserUnaryExpression4.ts | 1 - .../Expressions/parserUnaryExpression5.ts | 1 - .../Expressions/parserUnaryExpression6.ts | 0 .../Expressions/parserUnaryExpression7.ts | 1 - .../parserMemberAccessor1.ts | 1 - .../parserMemberAccessorDeclaration1.ts | 1 - .../parserMemberAccessorDeclaration10.ts | 1 - .../parserMemberAccessorDeclaration11.ts | 1 - .../parserMemberAccessorDeclaration12.ts | 1 - .../parserMemberAccessorDeclaration13.ts | 1 - .../parserMemberAccessorDeclaration14.ts | 1 - .../parserMemberAccessorDeclaration15.ts | 1 - .../parserMemberAccessorDeclaration16.ts | 1 - .../parserMemberAccessorDeclaration17.ts | 1 - .../parserMemberAccessorDeclaration18.ts | 1 - .../parserMemberAccessorDeclaration2.ts | 1 - .../parserMemberAccessorDeclaration3.ts | 1 - .../parserMemberAccessorDeclaration4.ts | 1 - .../parserMemberAccessorDeclaration5.ts | 1 - .../parserMemberAccessorDeclaration6.ts | 1 - .../parserMemberAccessorDeclaration7.ts | 1 - .../parserMemberAccessorDeclaration8.ts | 1 - .../parserMemberAccessorDeclaration9.ts | 1 - .../ObjectLiterals/parserObjectLiterals1.ts | 1 - .../ObjectTypes/parserObjectType5.ts | 4 - .../ObjectTypes/parserObjectType6.ts | 4 - .../parserReturnStatement4.js | 3 - .../Statements/parserDoStatement2.ts | 1 - .../Statements/parserForStatement4.ts | 2 - .../Statements/parserForStatement5.ts | 2 - .../Statements/parserForStatement6.ts | 2 - .../Statements/parserForStatement7.ts | 2 - .../Statements/parserForStatement8.ts | 2 - .../StrictMode/octalLiteralInStrictModeES3.ts | 2 - .../parserKeywordsAsIdentifierName2.ts | 2 +- .../ecmascript5/parserS7.6.1.1_A1.10.ts | 2 +- .../parserSyntaxWalker.generated.ts | 452 +-- .../ecmascript3/scannerES3NumericLiteral1.ts | 1 - .../ecmascript3/scannerES3NumericLiteral2.ts | 1 - .../ecmascript3/scannerES3NumericLiteral3.ts | 1 - .../ecmascript3/scannerES3NumericLiteral4.ts | 1 - .../ecmascript3/scannerES3NumericLiteral5.ts | 1 - .../ecmascript3/scannerES3NumericLiteral6.ts | 1 - .../ecmascript3/scannerES3NumericLiteral7.ts | 1 - .../ecmascript5/scannerNumericLiteral1.ts | 1 - .../ecmascript5/scannerNumericLiteral2.ts | 1 - .../ecmascript5/scannerNumericLiteral3.ts | 1 - .../ecmascript5/scannerNumericLiteral4.ts | 1 - .../ecmascript5/scannerNumericLiteral5.ts | 1 - .../ecmascript5/scannerNumericLiteral6.ts | 1 - .../ecmascript5/scannerNumericLiteral7.ts | 1 - .../ecmascript5/scannerNumericLiteral8.ts | 2 - .../ecmascript5/scannerNumericLiteral9.ts | 2 - .../tryStatements/invalidTryStatements2.ts | 21 +- .../types/members/duplicateStringIndexers.ts | 59 +- ...hOnlyPublicMembersEquivalentToInterface.ts | 1 - ...OnlyPublicMembersEquivalentToInterface2.ts | 1 - .../typeQueries/typeQueryWithReservedWords.ts | 14 - .../assignmentCompatWithObjectMembers.ts | 85 + 1278 files changed, 10852 insertions(+), 40071 deletions(-) rename tests/baselines/reference/{parserX_ArrowFunction1.errors.txt => ArrowFunction1.errors.txt} (66%) rename tests/baselines/reference/{parserX_ArrowFunction2.errors.txt => ArrowFunction2.errors.txt} (73%) rename tests/baselines/reference/{parserX_ArrowFunction3.errors.txt => ArrowFunction3.errors.txt} (74%) create mode 100644 tests/baselines/reference/ArrowFunction4.js rename tests/baselines/reference/{parserX_ArrowFunction4.types => ArrowFunction4.types} (59%) rename tests/baselines/reference/{parserX_TypeArgumentList1.errors.txt => TypeArgumentList1.errors.txt} (72%) delete mode 100644 tests/baselines/reference/aliasInaccessibleModule.errors.txt create mode 100644 tests/baselines/reference/aliasInaccessibleModule.types delete mode 100644 tests/baselines/reference/aliasInaccessibleModule2.errors.txt create mode 100644 tests/baselines/reference/aliasInaccessibleModule2.types create mode 100644 tests/baselines/reference/aliasUsageInAccessorsOfClass.errors.txt delete mode 100644 tests/baselines/reference/aliasUsageInAccessorsOfClass.js delete mode 100644 tests/baselines/reference/aliasUsageInAccessorsOfClass.types delete mode 100644 tests/baselines/reference/amdDependencyComment2.errors.txt delete mode 100644 tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.errors.txt delete mode 100644 tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt delete mode 100644 tests/baselines/reference/asiAmbientFunctionDeclaration.js delete mode 100644 tests/baselines/reference/asiAmbientFunctionDeclaration.types delete mode 100644 tests/baselines/reference/asiBreak.js delete mode 100644 tests/baselines/reference/asiBreak.types delete mode 100644 tests/baselines/reference/asiContinue.js delete mode 100644 tests/baselines/reference/asiContinue.types delete mode 100644 tests/baselines/reference/asiReturn.errors.txt create mode 100644 tests/baselines/reference/assignmentCompatWithObjectMembers.js create mode 100644 tests/baselines/reference/assignmentCompatWithObjectMembers.types delete mode 100644 tests/baselines/reference/augmentArray.js delete mode 100644 tests/baselines/reference/augmentArray.types delete mode 100644 tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js delete mode 100644 tests/baselines/reference/autoAsiForStaticsInClassDeclaration.types create mode 100644 tests/baselines/reference/breakInIterationOrSwitchStatement1.js create mode 100644 tests/baselines/reference/breakInIterationOrSwitchStatement1.types create mode 100644 tests/baselines/reference/breakInIterationOrSwitchStatement2.js create mode 100644 tests/baselines/reference/breakInIterationOrSwitchStatement2.types create mode 100644 tests/baselines/reference/breakInIterationOrSwitchStatement3.js create mode 100644 tests/baselines/reference/breakInIterationOrSwitchStatement3.types create mode 100644 tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt create mode 100644 tests/baselines/reference/breakInIterationOrSwitchStatement4.js create mode 100644 tests/baselines/reference/breakNotInIterationOrSwitchStatement1.errors.txt create mode 100644 tests/baselines/reference/breakNotInIterationOrSwitchStatement2.errors.txt create mode 100644 tests/baselines/reference/breakTarget1.js create mode 100644 tests/baselines/reference/breakTarget1.types create mode 100644 tests/baselines/reference/breakTarget2.js create mode 100644 tests/baselines/reference/breakTarget2.types create mode 100644 tests/baselines/reference/breakTarget3.js create mode 100644 tests/baselines/reference/breakTarget3.types create mode 100644 tests/baselines/reference/breakTarget4.js create mode 100644 tests/baselines/reference/breakTarget4.types create mode 100644 tests/baselines/reference/breakTarget5.errors.txt create mode 100644 tests/baselines/reference/breakTarget6.errors.txt delete mode 100644 tests/baselines/reference/captureThisInSuperCall.js delete mode 100644 tests/baselines/reference/captureThisInSuperCall.types create mode 100644 tests/baselines/reference/castExpressionParentheses.errors.txt delete mode 100644 tests/baselines/reference/castExpressionParentheses.types delete mode 100644 tests/baselines/reference/classExtendingPrimitive2.errors.txt delete mode 100644 tests/baselines/reference/classExtendsEveryObjectType2.errors.txt delete mode 100644 tests/baselines/reference/classImplementsImportedInterface.js delete mode 100644 tests/baselines/reference/classImplementsImportedInterface.types create mode 100644 tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.errors.txt delete mode 100644 tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types create mode 100644 tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.errors.txt delete mode 100644 tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types delete mode 100644 tests/baselines/reference/commentsDottedModuleName.types create mode 100644 tests/baselines/reference/commentsMultiModuleMultiFile.errors.txt delete mode 100644 tests/baselines/reference/commentsMultiModuleMultiFile.types delete mode 100644 tests/baselines/reference/constructorArgsErrors3.errors.txt delete mode 100644 tests/baselines/reference/constructorArgsErrors4.errors.txt delete mode 100644 tests/baselines/reference/constructorArgsErrors5.errors.txt delete mode 100644 tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt delete mode 100644 tests/baselines/reference/contextualSignatureInstantiation3.types create mode 100644 tests/baselines/reference/continueInIterationStatement1.js create mode 100644 tests/baselines/reference/continueInIterationStatement1.types create mode 100644 tests/baselines/reference/continueInIterationStatement2.js create mode 100644 tests/baselines/reference/continueInIterationStatement2.types create mode 100644 tests/baselines/reference/continueInIterationStatement3.js create mode 100644 tests/baselines/reference/continueInIterationStatement3.types create mode 100644 tests/baselines/reference/continueInIterationStatement4.errors.txt create mode 100644 tests/baselines/reference/continueInIterationStatement4.js create mode 100644 tests/baselines/reference/continueLabel.js create mode 100644 tests/baselines/reference/continueLabel.types create mode 100644 tests/baselines/reference/continueNotInIterationStatement1.errors.txt create mode 100644 tests/baselines/reference/continueNotInIterationStatement2.errors.txt create mode 100644 tests/baselines/reference/continueNotInIterationStatement3.errors.txt create mode 100644 tests/baselines/reference/continueNotInIterationStatement4.errors.txt create mode 100644 tests/baselines/reference/continueTarget1.errors.txt create mode 100644 tests/baselines/reference/continueTarget2.js create mode 100644 tests/baselines/reference/continueTarget2.types create mode 100644 tests/baselines/reference/continueTarget3.js create mode 100644 tests/baselines/reference/continueTarget3.types create mode 100644 tests/baselines/reference/continueTarget4.js create mode 100644 tests/baselines/reference/continueTarget4.types create mode 100644 tests/baselines/reference/continueTarget5.errors.txt create mode 100644 tests/baselines/reference/continueTarget6.errors.txt create mode 100644 tests/baselines/reference/convertKeywordsYes.errors.txt delete mode 100644 tests/baselines/reference/convertKeywordsYes.types delete mode 100644 tests/baselines/reference/declFileAccessors.types delete mode 100644 tests/baselines/reference/declFileCallSignatures.types delete mode 100644 tests/baselines/reference/declFileConstructSignatures.types delete mode 100644 tests/baselines/reference/declFileConstructors.types delete mode 100644 tests/baselines/reference/declFileFunctions.types delete mode 100644 tests/baselines/reference/declFileImportChainInExportAssignment.js delete mode 100644 tests/baselines/reference/declFileImportChainInExportAssignment.types delete mode 100644 tests/baselines/reference/declFileIndexSignatures.js delete mode 100644 tests/baselines/reference/declFileIndexSignatures.types delete mode 100644 tests/baselines/reference/declFileMethods.types create mode 100644 tests/baselines/reference/declarationEmit_nameConflicts.errors.txt delete mode 100644 tests/baselines/reference/declarationEmit_nameConflicts.types create mode 100644 tests/baselines/reference/declarationEmit_nameConflictsWithAlias.errors.txt delete mode 100644 tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types delete mode 100644 tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.js delete mode 100644 tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types create mode 100644 tests/baselines/reference/duplicateLabel1.errors.txt create mode 100644 tests/baselines/reference/duplicateLabel2.errors.txt create mode 100644 tests/baselines/reference/duplicateLabel3.js create mode 100644 tests/baselines/reference/duplicateLabel3.types create mode 100644 tests/baselines/reference/duplicateLabel4.js create mode 100644 tests/baselines/reference/duplicateLabel4.types delete mode 100644 tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt delete mode 100644 tests/baselines/reference/duplicateStringIndexers.errors.txt delete mode 100644 tests/baselines/reference/duplicateVarAndImport.types delete mode 100644 tests/baselines/reference/duplicateVarAndImport2.errors.txt delete mode 100644 tests/baselines/reference/emitBOM.types delete mode 100644 tests/baselines/reference/emptyTypeArgumentList.errors.txt delete mode 100644 tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt delete mode 100644 tests/baselines/reference/enumInitializersWithExponents.errors.txt delete mode 100644 tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt delete mode 100644 tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt delete mode 100644 tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt delete mode 100644 tests/baselines/reference/fileReferencesWithNoExtensions.types delete mode 100644 tests/baselines/reference/functionAndInterfaceWithSeparateErrors.errors.txt delete mode 100644 tests/baselines/reference/functionAndInterfaceWithSeparateErrors.js delete mode 100644 tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt create mode 100644 tests/baselines/reference/importDecl.errors.txt delete mode 100644 tests/baselines/reference/importDecl.types delete mode 100644 tests/baselines/reference/indexSignatureTypeInference.errors.txt delete mode 100644 tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types create mode 100644 tests/baselines/reference/missingRequiredDeclare.d.errors.txt delete mode 100644 tests/baselines/reference/mixedExports.js delete mode 100644 tests/baselines/reference/mixedExports.types delete mode 100644 tests/baselines/reference/moduleSymbolMerging.types create mode 100644 tests/baselines/reference/multiImportExport.errors.txt delete mode 100644 tests/baselines/reference/multiImportExport.js delete mode 100644 tests/baselines/reference/multiImportExport.types delete mode 100644 tests/baselines/reference/nameCollisionsInPropertyAssignments.js delete mode 100644 tests/baselines/reference/nameCollisionsInPropertyAssignments.types delete mode 100644 tests/baselines/reference/noCatchBlock.js delete mode 100644 tests/baselines/reference/noCatchBlock.js.map delete mode 100644 tests/baselines/reference/noCatchBlock.sourcemap.txt delete mode 100644 tests/baselines/reference/noCatchBlock.types delete mode 100644 tests/baselines/reference/noImplicitAnyForIn.errors.txt delete mode 100644 tests/baselines/reference/noImplicitAnyIndexing.errors.txt delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInAmbientClass.js delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.js delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInAmbientModule.js delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInInterface.js delete mode 100644 tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt delete mode 100644 tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt delete mode 100644 tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt delete mode 100644 tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js delete mode 100644 tests/baselines/reference/parserAccessors1.js rename tests/baselines/reference/{parserES3Accessors2.errors.txt => parserAccessors2.errors.txt} (54%) delete mode 100644 tests/baselines/reference/parserAccessors2.js delete mode 100644 tests/baselines/reference/parserAccessors2.types delete mode 100644 tests/baselines/reference/parserAccessors3.js rename tests/baselines/reference/{parserES3Accessors4.errors.txt => parserAccessors4.errors.txt} (52%) delete mode 100644 tests/baselines/reference/parserAccessors4.js delete mode 100644 tests/baselines/reference/parserAccessors4.types delete mode 100644 tests/baselines/reference/parserAssignmentExpression1.errors.txt delete mode 100644 tests/baselines/reference/parserAssignmentExpression1.js delete mode 100644 tests/baselines/reference/parserConstructorDeclaration11.errors.txt delete mode 100644 tests/baselines/reference/parserDoStatement2.js delete mode 100644 tests/baselines/reference/parserDoStatement2.types delete mode 100644 tests/baselines/reference/parserES3Accessors1.errors.txt delete mode 100644 tests/baselines/reference/parserES3Accessors3.errors.txt delete mode 100644 tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause6.errors.txt delete mode 100644 tests/baselines/reference/parserForStatement4.errors.txt delete mode 100644 tests/baselines/reference/parserForStatement4.js delete mode 100644 tests/baselines/reference/parserForStatement5.errors.txt delete mode 100644 tests/baselines/reference/parserForStatement5.js delete mode 100644 tests/baselines/reference/parserForStatement6.errors.txt delete mode 100644 tests/baselines/reference/parserForStatement6.js delete mode 100644 tests/baselines/reference/parserForStatement7.errors.txt delete mode 100644 tests/baselines/reference/parserForStatement7.js delete mode 100644 tests/baselines/reference/parserForStatement8.errors.txt delete mode 100644 tests/baselines/reference/parserForStatement8.js delete mode 100644 tests/baselines/reference/parserMemberAccessor1.js delete mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration1.js delete mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration2.js delete mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration3.js create mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration4.errors.txt delete mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration4.js delete mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration4.types create mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration5.errors.txt delete mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration5.js delete mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration5.types create mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration6.errors.txt delete mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration6.js delete mode 100644 tests/baselines/reference/parserMemberAccessorDeclaration6.types delete mode 100644 tests/baselines/reference/parserObjectCreation2.errors.txt delete mode 100644 tests/baselines/reference/parserObjectCreation2.js delete mode 100644 tests/baselines/reference/parserObjectLiterals1.js delete mode 100644 tests/baselines/reference/parserObjectLiterals1.types delete mode 100644 tests/baselines/reference/parserObjectType5.errors.txt delete mode 100644 tests/baselines/reference/parserObjectType6.errors.txt delete mode 100644 tests/baselines/reference/parserPostfixUnaryExpression1.errors.txt create mode 100644 tests/baselines/reference/parserS7.6.1.1_A1.10.errors.txt delete mode 100644 tests/baselines/reference/parserS7.6.1.1_A1.10.types create mode 100644 tests/baselines/reference/parserSyntaxWalker.generated.errors.txt delete mode 100644 tests/baselines/reference/parserSyntaxWalker.generated.types delete mode 100644 tests/baselines/reference/parserUnaryExpression1.errors.txt delete mode 100644 tests/baselines/reference/parserUnaryExpression1.js delete mode 100644 tests/baselines/reference/parserUnaryExpression2.errors.txt delete mode 100644 tests/baselines/reference/parserUnaryExpression2.js delete mode 100644 tests/baselines/reference/parserUnaryExpression3.errors.txt delete mode 100644 tests/baselines/reference/parserUnaryExpression3.js delete mode 100644 tests/baselines/reference/parserUnaryExpression4.errors.txt delete mode 100644 tests/baselines/reference/parserUnaryExpression4.js delete mode 100644 tests/baselines/reference/parserUnaryExpression5.errors.txt delete mode 100644 tests/baselines/reference/parserUnaryExpression5.js delete mode 100644 tests/baselines/reference/parserUnaryExpression6.js delete mode 100644 tests/baselines/reference/parserUnaryExpression6.types delete mode 100644 tests/baselines/reference/parserUnaryExpression7.errors.txt delete mode 100644 tests/baselines/reference/parserUnaryExpression7.js delete mode 100644 tests/baselines/reference/parserX_ArrowFunction4.js delete mode 100644 tests/baselines/reference/parsingClassRecoversWhenHittingUnexpectedSemicolon.errors.txt delete mode 100644 tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.js delete mode 100644 tests/baselines/reference/prefixIncrementAsOperandOfPlusExpression.types delete mode 100644 tests/baselines/reference/privacyAccessorDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyAccessorDeclFile.js delete mode 100644 tests/baselines/reference/privacyCannotNameAccessorDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyCannotNameVarTypeDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyCheckTypeOfFunction.js delete mode 100644 tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.errors.txt create mode 100644 tests/baselines/reference/privacyCheckTypeOfInvisibleModuleError.types delete mode 100644 tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyClassExtendsClauseDeclFile.js delete mode 100644 tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyClassImplementsClauseDeclFile.js delete mode 100644 tests/baselines/reference/privacyFunctionCannotNameParameterTypeDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyFunctionCannotNameReturnTypeDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyFunctionParameterDeclFile.js delete mode 100644 tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyFunctionReturnTypeDeclFile.js create mode 100644 tests/baselines/reference/privacyGetter.errors.txt delete mode 100644 tests/baselines/reference/privacyGetter.types create mode 100644 tests/baselines/reference/privacyGloGetter.errors.txt delete mode 100644 tests/baselines/reference/privacyGloGetter.types delete mode 100644 tests/baselines/reference/privacyGloImportParseErrors.errors.txt delete mode 100644 tests/baselines/reference/privacyImportParseErrors.errors.txt delete mode 100644 tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.js delete mode 100644 tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.errors.txt create mode 100644 tests/baselines/reference/privacyLocalInternalReferenceImportWithExport.types delete mode 100644 tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.errors.txt create mode 100644 tests/baselines/reference/privacyLocalInternalReferenceImportWithoutExport.types create mode 100644 tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.errors.txt delete mode 100644 tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithExport.types create mode 100644 tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.errors.txt delete mode 100644 tests/baselines/reference/privacyTopLevelAmbientExternalModuleImportWithoutExport.types delete mode 100644 tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.errors.txt create mode 100644 tests/baselines/reference/privacyTopLevelInternalReferenceImportWithExport.types delete mode 100644 tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.errors.txt create mode 100644 tests/baselines/reference/privacyTopLevelInternalReferenceImportWithoutExport.types create mode 100644 tests/baselines/reference/privacyTypeParameterOfFunction.errors.txt delete mode 100644 tests/baselines/reference/privacyTypeParameterOfFunction.types delete mode 100644 tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyTypeParameterOfFunctionDeclFile.js create mode 100644 tests/baselines/reference/privacyTypeParametersOfClass.errors.txt delete mode 100644 tests/baselines/reference/privacyTypeParametersOfClass.types delete mode 100644 tests/baselines/reference/privacyTypeParametersOfClassDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyTypeParametersOfClassDeclFile.js create mode 100644 tests/baselines/reference/privacyTypeParametersOfInterface.errors.txt delete mode 100644 tests/baselines/reference/privacyTypeParametersOfInterface.js delete mode 100644 tests/baselines/reference/privacyTypeParametersOfInterface.types delete mode 100644 tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.errors.txt delete mode 100644 tests/baselines/reference/privacyTypeParametersOfInterfaceDeclFile.js delete mode 100644 tests/baselines/reference/privacyVarDeclFile.errors.txt create mode 100644 tests/baselines/reference/promiseChaining.errors.txt delete mode 100644 tests/baselines/reference/promiseChaining.types delete mode 100644 tests/baselines/reference/promiseChaining2.errors.txt create mode 100644 tests/baselines/reference/promiseChaining2.types delete mode 100644 tests/baselines/reference/propertyParameterWithQuestionMark.errors.txt delete mode 100644 tests/baselines/reference/regExpWithSlashInCharClass.js delete mode 100644 tests/baselines/reference/regExpWithSlashInCharClass.types delete mode 100644 tests/baselines/reference/reservedNameOnInterfaceImport.errors.txt delete mode 100644 tests/baselines/reference/reservedNameOnInterfaceImport.js delete mode 100644 tests/baselines/reference/reservedNameOnModuleImport.js delete mode 100644 tests/baselines/reference/reservedNameOnModuleImport.types delete mode 100644 tests/baselines/reference/reservedNameOnModuleImportWithInterface.errors.txt delete mode 100644 tests/baselines/reference/reservedNameOnModuleImportWithInterface.js delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral1.js delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral1.types delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral2.js delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral2.types delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral3.errors.txt delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral4.errors.txt delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral5.js delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral5.types delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral6.errors.txt delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral7.js delete mode 100644 tests/baselines/reference/scannerES3NumericLiteral7.types delete mode 100644 tests/baselines/reference/scannerNumericLiteral2.errors.txt create mode 100644 tests/baselines/reference/scannerNumericLiteral2.js create mode 100644 tests/baselines/reference/scannerNumericLiteral2.types delete mode 100644 tests/baselines/reference/scannerNumericLiteral8.errors.txt delete mode 100644 tests/baselines/reference/scannerNumericLiteral9.errors.txt delete mode 100644 tests/baselines/reference/sourceMap-SkippedNode.js delete mode 100644 tests/baselines/reference/sourceMap-SkippedNode.js.map delete mode 100644 tests/baselines/reference/sourceMap-SkippedNode.sourcemap.txt delete mode 100644 tests/baselines/reference/sourceMap-SkippedNode.types create mode 100644 tests/baselines/reference/sourceMapValidationClass.errors.txt delete mode 100644 tests/baselines/reference/sourceMapValidationClass.js delete mode 100644 tests/baselines/reference/sourceMapValidationClass.sourcemap.txt delete mode 100644 tests/baselines/reference/sourceMapValidationClass.types delete mode 100644 tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js delete mode 100644 tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.js.map delete mode 100644 tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.sourcemap.txt delete mode 100644 tests/baselines/reference/sourceMapValidationExportAssignmentCommonjs.types create mode 100644 tests/baselines/reference/specializedLambdaTypeArguments.errors.txt delete mode 100644 tests/baselines/reference/specializedLambdaTypeArguments.types delete mode 100644 tests/baselines/reference/specializedSignatureInInterface.js delete mode 100644 tests/baselines/reference/specializedSignatureInInterface.types delete mode 100644 tests/baselines/reference/staticMethodWithTypeParameterExtendsClauseDeclFile.js delete mode 100644 tests/baselines/reference/staticMethodWithTypeParameterExtendsClauseDeclFile.types delete mode 100644 tests/baselines/reference/strictMode5.js delete mode 100644 tests/baselines/reference/strictMode5.types delete mode 100644 tests/baselines/reference/switchStatementsWithMultipleDefaults.errors.txt delete mode 100644 tests/baselines/reference/testContainerList.types delete mode 100644 tests/baselines/reference/trailingCommasES3.js delete mode 100644 tests/baselines/reference/trailingCommasES3.types delete mode 100644 tests/baselines/reference/trailingCommasES5.js delete mode 100644 tests/baselines/reference/trailingCommasES5.types delete mode 100644 tests/baselines/reference/typeParameterWithInvalidConstraintType.errors.txt delete mode 100644 tests/baselines/reference/typeQueryWithReservedWords.js delete mode 100644 tests/baselines/reference/typeQueryWithReservedWords.types delete mode 100644 tests/cases/compiler/amdDependencyComment2.ts delete mode 100644 tests/cases/compiler/arrowFunctionMissingCurlyWithSemicolon.ts delete mode 100644 tests/cases/compiler/arrowFunctionsMissingTokens.ts delete mode 100644 tests/cases/compiler/asiAmbientFunctionDeclaration.ts delete mode 100644 tests/cases/compiler/asiBreak.ts delete mode 100644 tests/cases/compiler/asiContinue.ts delete mode 100644 tests/cases/compiler/asiReturn.ts delete mode 100644 tests/cases/compiler/augmentArray.ts delete mode 100644 tests/cases/compiler/autoAsiForStaticsInClassDeclaration.ts create mode 100644 tests/cases/compiler/breakInIterationOrSwitchStatement1.ts create mode 100644 tests/cases/compiler/breakInIterationOrSwitchStatement2.ts create mode 100644 tests/cases/compiler/breakInIterationOrSwitchStatement3.ts create mode 100644 tests/cases/compiler/breakInIterationOrSwitchStatement4.ts create mode 100644 tests/cases/compiler/breakNotInIterationOrSwitchStatement1.ts create mode 100644 tests/cases/compiler/breakNotInIterationOrSwitchStatement2.ts create mode 100644 tests/cases/compiler/breakTarget1.ts create mode 100644 tests/cases/compiler/breakTarget2.ts create mode 100644 tests/cases/compiler/breakTarget3.ts create mode 100644 tests/cases/compiler/breakTarget4.ts create mode 100644 tests/cases/compiler/breakTarget5.ts create mode 100644 tests/cases/compiler/breakTarget6.ts delete mode 100644 tests/cases/compiler/captureThisInSuperCall.ts delete mode 100644 tests/cases/compiler/classImplementsImportedInterface.ts delete mode 100644 tests/cases/compiler/commentsDottedModuleName.ts delete mode 100644 tests/cases/compiler/constructorArgsErrors3.ts delete mode 100644 tests/cases/compiler/constructorArgsErrors4.ts delete mode 100644 tests/cases/compiler/constructorArgsErrors5.ts delete mode 100644 tests/cases/compiler/constructorsWithSpecializedSignatures.ts delete mode 100644 tests/cases/compiler/contextualSignatureInstantiation3.ts create mode 100644 tests/cases/compiler/continueInIterationStatement1.ts create mode 100644 tests/cases/compiler/continueInIterationStatement2.ts create mode 100644 tests/cases/compiler/continueInIterationStatement3.ts create mode 100644 tests/cases/compiler/continueInIterationStatement4.ts create mode 100644 tests/cases/compiler/continueLabel.ts create mode 100644 tests/cases/compiler/continueNotInIterationStatement1.ts create mode 100644 tests/cases/compiler/continueNotInIterationStatement2.ts create mode 100644 tests/cases/compiler/continueNotInIterationStatement3.ts create mode 100644 tests/cases/compiler/continueNotInIterationStatement4.ts create mode 100644 tests/cases/compiler/continueTarget1.ts create mode 100644 tests/cases/compiler/continueTarget2.ts create mode 100644 tests/cases/compiler/continueTarget3.ts create mode 100644 tests/cases/compiler/continueTarget4.ts create mode 100644 tests/cases/compiler/continueTarget5.ts create mode 100644 tests/cases/compiler/continueTarget6.ts delete mode 100644 tests/cases/compiler/declFileAccessors.ts delete mode 100644 tests/cases/compiler/declFileCallSignatures.ts delete mode 100644 tests/cases/compiler/declFileConstructSignatures.ts delete mode 100644 tests/cases/compiler/declFileConstructors.ts delete mode 100644 tests/cases/compiler/declFileFunctions.ts delete mode 100644 tests/cases/compiler/declFileImportChainInExportAssignment.ts delete mode 100644 tests/cases/compiler/declFileIndexSignatures.ts delete mode 100644 tests/cases/compiler/declFileMethods.ts delete mode 100644 tests/cases/compiler/declareFileExportAssignmentWithVarFromVariableStatement.ts create mode 100644 tests/cases/compiler/duplicateLabel1.ts create mode 100644 tests/cases/compiler/duplicateLabel2.ts create mode 100644 tests/cases/compiler/duplicateLabel3.ts create mode 100644 tests/cases/compiler/duplicateLabel4.ts delete mode 100644 tests/cases/compiler/duplicatePropertiesInStrictMode.ts delete mode 100644 tests/cases/compiler/duplicateVarAndImport.ts delete mode 100644 tests/cases/compiler/duplicateVarAndImport2.ts delete mode 100644 tests/cases/compiler/emitBOM.ts delete mode 100644 tests/cases/compiler/emptyTypeArgumentList.ts delete mode 100644 tests/cases/compiler/emptyTypeArgumentListWithNew.ts delete mode 100644 tests/cases/compiler/enumInitializersWithExponents.ts delete mode 100644 tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts delete mode 100644 tests/cases/compiler/exportAssignmentWithDeclareModifier.ts delete mode 100644 tests/cases/compiler/exportAssignmentWithExportModifier.ts delete mode 100644 tests/cases/compiler/fileReferencesWithNoExtensions.ts delete mode 100644 tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts delete mode 100644 tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts delete mode 100644 tests/cases/compiler/indexSignatureTypeInference.ts delete mode 100644 tests/cases/compiler/inheritedOverloadedSpecializedSignatures.ts create mode 100644 tests/cases/compiler/missingRequiredDeclare.d.ts delete mode 100644 tests/cases/compiler/mixedExports.ts delete mode 100644 tests/cases/compiler/moduleSymbolMerging.ts delete mode 100644 tests/cases/compiler/nameCollisionsInPropertyAssignments.ts delete mode 100644 tests/cases/compiler/noCatchBlock.ts delete mode 100644 tests/cases/compiler/noImplicitAnyForIn.ts delete mode 100644 tests/cases/compiler/noImplicitAnyIndexing.ts delete mode 100644 tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts delete mode 100644 tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts delete mode 100644 tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts delete mode 100644 tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts delete mode 100644 tests/cases/compiler/noImplicitAnyParametersInClass.ts delete mode 100644 tests/cases/compiler/noImplicitAnyParametersInInterface.ts delete mode 100644 tests/cases/compiler/noImplicitAnyParametersInModule.ts delete mode 100644 tests/cases/compiler/overloadsInDifferentContainersDisagreeOnAmbient.ts delete mode 100644 tests/cases/compiler/parsingClassRecoversWhenHittingUnexpectedSemicolon.ts delete mode 100644 tests/cases/compiler/prefixIncrementAsOperandOfPlusExpression.ts delete mode 100644 tests/cases/compiler/privacyAccessorDeclFile.ts delete mode 100644 tests/cases/compiler/privacyCannotNameAccessorDeclFile.ts delete mode 100644 tests/cases/compiler/privacyCannotNameVarTypeDeclFile.ts delete mode 100644 tests/cases/compiler/privacyClassExtendsClauseDeclFile.ts delete mode 100644 tests/cases/compiler/privacyClassImplementsClauseDeclFile.ts delete mode 100644 tests/cases/compiler/privacyFunctionCannotNameParameterTypeDeclFile.ts delete mode 100644 tests/cases/compiler/privacyFunctionCannotNameReturnTypeDeclFile.ts delete mode 100644 tests/cases/compiler/privacyFunctionParameterDeclFile.ts delete mode 100644 tests/cases/compiler/privacyFunctionReturnTypeDeclFile.ts delete mode 100644 tests/cases/compiler/privacyGloImportParseErrors.ts delete mode 100644 tests/cases/compiler/privacyImportParseErrors.ts delete mode 100644 tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile.ts delete mode 100644 tests/cases/compiler/privacyTypeParameterOfFunctionDeclFile.ts delete mode 100644 tests/cases/compiler/privacyTypeParametersOfClassDeclFile.ts delete mode 100644 tests/cases/compiler/privacyTypeParametersOfInterfaceDeclFile.ts delete mode 100644 tests/cases/compiler/privacyVarDeclFile.ts delete mode 100644 tests/cases/compiler/propertyParameterWithQuestionMark.ts delete mode 100644 tests/cases/compiler/regExpWithSlashInCharClass.ts delete mode 100644 tests/cases/compiler/reservedNameOnInterfaceImport.ts delete mode 100644 tests/cases/compiler/reservedNameOnModuleImport.ts delete mode 100644 tests/cases/compiler/reservedNameOnModuleImportWithInterface.ts delete mode 100644 tests/cases/compiler/sourceMap-SkippedNode.ts delete mode 100644 tests/cases/compiler/sourceMapValidationExportAssignmentCommonjs.ts delete mode 100644 tests/cases/compiler/specializedSignatureInInterface.ts delete mode 100644 tests/cases/compiler/staticMethodWithTypeParameterExtendsClauseDeclFile.ts delete mode 100644 tests/cases/compiler/strictMode5.ts delete mode 100644 tests/cases/compiler/switchStatementsWithMultipleDefaults.ts delete mode 100644 tests/cases/compiler/testContainerList.ts delete mode 100644 tests/cases/compiler/trailingCommasES3.ts delete mode 100644 tests/cases/compiler/trailingCommasES5.ts delete mode 100644 tests/cases/compiler/typeParameterWithInvalidConstraintType.ts delete mode 100644 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts delete mode 100644 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts delete mode 100644 tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors1.ts delete mode 100644 tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors2.ts delete mode 100644 tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors3.ts delete mode 100644 tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors4.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration11.ts rename tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/{parserX_ArrowFunction1.ts => ArrowFunction1.ts} (100%) rename tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/{parserX_ArrowFunction2.ts => ArrowFunction2.ts} (100%) rename tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/{parserX_ArrowFunction3.ts => ArrowFunction3.ts} (100%) rename tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/{parserX_ArrowFunction4.ts => ArrowFunction4.ts} (100%) delete mode 100644 tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause6.ts rename tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/{parserX_TypeArgumentList1.ts => TypeArgumentList1.ts} (100%) delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserAssignmentExpression1.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserObjectCreation2.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserPostfixUnaryExpression1.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression1.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression2.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression3.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression4.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression5.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression6.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Expressions/parserUnaryExpression7.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/ObjectLiterals/parserObjectLiterals1.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType6.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/ReturnStatements/parserReturnStatement4.js delete mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserDoStatement2.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement4.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement5.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement6.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement7.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement8.ts delete mode 100644 tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts delete mode 100644 tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral1.ts delete mode 100644 tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral2.ts delete mode 100644 tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral3.ts delete mode 100644 tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral4.ts delete mode 100644 tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral5.ts delete mode 100644 tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral6.ts delete mode 100644 tests/cases/conformance/scanner/ecmascript3/scannerES3NumericLiteral7.ts delete mode 100644 tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral8.ts delete mode 100644 tests/cases/conformance/scanner/ecmascript5/scannerNumericLiteral9.ts delete mode 100644 tests/cases/conformance/types/specifyingTypes/typeQueries/typeQueryWithReservedWords.ts create mode 100644 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.ts diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index bab1200d74c..feae3f1dc66 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -307,7 +307,7 @@ class CompilerBaselineRunner extends RunnerBase { allFiles.forEach(file => { var codeLines = file.content.split('\n'); walker.getTypes(file.unitName).forEach(result => { - var formattedLine = result.identifierName + " : " + result.type; + var formattedLine = result.identifierName.replace(/\r?\n/g, "") + " : " + result.type; if (!typeMap[file.unitName]) { typeMap[file.unitName] = {}; } diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 87f215d5b72..ea7d39136bf 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -28,7 +28,7 @@ class TypeWriterWalker { // TODO: Ideally we should log all expressions, but to compare to the // old typeWriter baselines, suppress tokens case ts.SyntaxKind.ThisKeyword: - case ts.SyntaxKind.RegularExpressionLiteral: + // case ts.SyntaxKind.RegularExpressionLiteral: case ts.SyntaxKind.ArrayLiteral: case ts.SyntaxKind.ObjectLiteral: case ts.SyntaxKind.PropertyAccess: @@ -87,7 +87,7 @@ class TypeWriterWalker { column: lineAndCharacter.character, syntaxKind: ts.SyntaxKind[node.kind], identifierName: sourceText, - type: isUnknownType ? sourceText : this.checker.typeToString(type) + type: isUnknownType ? sourceText : this.checker.typeToString(type, undefined, ts.TypeFormatFlags.UseTypeOfFunction) }); } diff --git a/tests/baselines/reference/parserX_ArrowFunction1.errors.txt b/tests/baselines/reference/ArrowFunction1.errors.txt similarity index 66% rename from tests/baselines/reference/parserX_ArrowFunction1.errors.txt rename to tests/baselines/reference/ArrowFunction1.errors.txt index 2443366b415..ed868daec13 100644 --- a/tests/baselines/reference/parserX_ArrowFunction1.errors.txt +++ b/tests/baselines/reference/ArrowFunction1.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction1.ts (1 errors) ==== var v = (a: ) => { ~ !!! Type expected. diff --git a/tests/baselines/reference/parserX_ArrowFunction2.errors.txt b/tests/baselines/reference/ArrowFunction2.errors.txt similarity index 73% rename from tests/baselines/reference/parserX_ArrowFunction2.errors.txt rename to tests/baselines/reference/ArrowFunction2.errors.txt index 0b9eced39fa..eef47a30ba2 100644 --- a/tests/baselines/reference/parserX_ArrowFunction2.errors.txt +++ b/tests/baselines/reference/ArrowFunction2.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction2.ts (2 errors) ==== var v = (a: b,) => { ~ !!! Trailing comma not allowed. diff --git a/tests/baselines/reference/parserX_ArrowFunction3.errors.txt b/tests/baselines/reference/ArrowFunction3.errors.txt similarity index 74% rename from tests/baselines/reference/parserX_ArrowFunction3.errors.txt rename to tests/baselines/reference/ArrowFunction3.errors.txt index 3088cde2b10..a286116ff29 100644 --- a/tests/baselines/reference/parserX_ArrowFunction3.errors.txt +++ b/tests/baselines/reference/ArrowFunction3.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction3.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction3.ts (3 errors) ==== var v = (a): => { ~ !!! ',' expected. diff --git a/tests/baselines/reference/ArrowFunction4.js b/tests/baselines/reference/ArrowFunction4.js new file mode 100644 index 00000000000..e9759abb183 --- /dev/null +++ b/tests/baselines/reference/ArrowFunction4.js @@ -0,0 +1,8 @@ +//// [ArrowFunction4.ts] +var v = (a, b) => { + +}; + +//// [ArrowFunction4.js] +var v = function (a, b) { +}; diff --git a/tests/baselines/reference/parserX_ArrowFunction4.types b/tests/baselines/reference/ArrowFunction4.types similarity index 59% rename from tests/baselines/reference/parserX_ArrowFunction4.types rename to tests/baselines/reference/ArrowFunction4.types index 1e606de909f..1d049f193e6 100644 --- a/tests/baselines/reference/parserX_ArrowFunction4.types +++ b/tests/baselines/reference/ArrowFunction4.types @@ -1,9 +1,7 @@ -=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/parserX_ArrowFunction4.ts === +=== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrowFunctions/ArrowFunction4.ts === var v = (a, b) => { >v : (a: any, b: any) => void ->(a, b) => { - -} : (a: any, b: any) => void +>(a, b) => { } : (a: any, b: any) => void >a : any >b : any diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types index 3ea1919ecae..10132e604ae 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.types @@ -7,7 +7,7 @@ class Point { >y : number static Origin(): Point { return { x: 0, y: 0 }; } ->Origin : () => Point +>Origin : typeof Origin >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number @@ -18,7 +18,7 @@ module Point { >Point : typeof Point function Origin() { return ""; }// not an error, since not exported ->Origin : () => string +>Origin : typeof Origin } @@ -33,7 +33,7 @@ module A { >y : number static Origin(): Point { return { x: 0, y: 0 }; } ->Origin : () => Point +>Origin : typeof Origin >Point : Point >{ x: 0, y: 0 } : { x: number; y: number; } >x : number @@ -44,6 +44,6 @@ module A { >Point : typeof Point function Origin() { return ""; }// not an error since not exported ->Origin : () => string +>Origin : typeof Origin } } diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types index 6f4452fce4c..cac8fac99f2 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.types @@ -47,7 +47,7 @@ module A { >TPoint : TPoint static fromorigin2d(p: Point): Line{ ->fromorigin2d : (p: Point) => Line +>fromorigin2d : typeof fromorigin2d >p : Point >Point : Point >Line : Line diff --git a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types index ac1845a533c..fe2fea1b7a6 100644 --- a/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithAccessibleTypesInParameterAndReturnTypeAnnotation.types @@ -23,7 +23,7 @@ module A { } export function fromOrigin(p: Point): Line { ->fromOrigin : (p: Point) => Line +>fromOrigin : typeof fromOrigin >p : Point >Point : Point >Line : Line diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types index 3f3a670ee8e..36c78cd700a 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInParameterTypeAnnotation.types @@ -23,7 +23,7 @@ module A { } export function fromOrigin(p: Point): Line { ->fromOrigin : (p: Point) => Line +>fromOrigin : typeof fromOrigin >p : Point >Point : Point >Line : Line diff --git a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types index 7634e2cde3e..5d59aa10039 100644 --- a/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types +++ b/tests/baselines/reference/ExportFunctionWithInaccessibleTypesInReturnTypeAnnotation.types @@ -23,7 +23,7 @@ module A { } export function fromOrigin(p: Point): Line { ->fromOrigin : (p: Point) => Line +>fromOrigin : typeof fromOrigin >p : Point >Point : Point >Line : Line diff --git a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types index a3a80cb06ad..11a62d66f98 100644 --- a/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types +++ b/tests/baselines/reference/ExportModuleWithAccessibleTypesOnItsExportedMembers.types @@ -31,7 +31,7 @@ module A { } static fromOrigin(p: Point) { ->fromOrigin : (p: Point) => Line +>fromOrigin : typeof fromOrigin >p : Point >Point : Point diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types index 3110020b9bc..55a30a857cc 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndDifferentCommonRoot.types @@ -3,7 +3,7 @@ module A { >A : typeof A export function Point() { ->Point : () => { x: number; y: number; } +>Point : typeof Point return { x: 0, y: 0 }; >{ x: 0, y: 0 } : { x: number; y: number; } @@ -35,9 +35,9 @@ var fn: () => { x: number; y: number }; var fn = A.Point; >fn : () => { x: number; y: number; } ->A.Point : () => { x: number; y: number; } +>A.Point : typeof Point >A : typeof A ->Point : () => { x: number; y: number; } +>Point : typeof Point var cl: { x: number; y: number; } >cl : { x: number; y: number; } diff --git a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types index 44472c4da6b..4fc79d0409c 100644 --- a/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types +++ b/tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedAndNonExportedLocalVarsOfTheSameName.types @@ -16,7 +16,7 @@ module A { >Utils : typeof Utils export function mirror(p: T) { ->mirror : (p: T) => { x: number; y: number; } +>mirror : typeof mirror >T : T >Point : Point >p : T @@ -87,11 +87,11 @@ var o = A.Origin; var o = A.Utils.mirror(o); >o : { x: number; y: number; } >A.Utils.mirror(o) : { x: number; y: number; } ->A.Utils.mirror : (p: T) => { x: number; y: number; } +>A.Utils.mirror : typeof mirror >A.Utils : typeof Utils >A : typeof A >Utils : typeof Utils ->mirror : (p: T) => { x: number; y: number; } +>mirror : typeof mirror >o : { x: number; y: number; } var p: { tl: A.Point; br: A.Point }; diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types index 15f596622e7..6662806a523 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndDifferentCommonRoot.types @@ -19,7 +19,7 @@ module Root { >Utils : typeof Utils export function mirror(p: T) { ->mirror : (p: T) => { x: number; y: number; } +>mirror : typeof mirror >T : T >Point : Point >p : T diff --git a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types index 0bcc1b750c8..6e12c97e761 100644 --- a/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types +++ b/tests/baselines/reference/TwoInternalModulesWithTheSameNameAndSameCommonRoot.types @@ -16,7 +16,7 @@ module A { >Utils : typeof Utils export function mirror(p: T) { ->mirror : (p: T) => { x: number; y: number; } +>mirror : typeof mirror >T : T >Point : Point >p : T @@ -84,11 +84,11 @@ var o = A.Origin; var o = A.Utils.mirror(o); >o : { x: number; y: number; } >A.Utils.mirror(o) : { x: number; y: number; } ->A.Utils.mirror : (p: T) => { x: number; y: number; } +>A.Utils.mirror : typeof mirror >A.Utils : typeof Utils >A : typeof A >Utils : typeof Utils ->mirror : (p: T) => { x: number; y: number; } +>mirror : typeof mirror >o : { x: number; y: number; } var p: { tl: A.Point; br: A.Point }; diff --git a/tests/baselines/reference/parserX_TypeArgumentList1.errors.txt b/tests/baselines/reference/TypeArgumentList1.errors.txt similarity index 72% rename from tests/baselines/reference/parserX_TypeArgumentList1.errors.txt rename to tests/baselines/reference/TypeArgumentList1.errors.txt index 44a696d7ce9..6c1a300f5a5 100644 --- a/tests/baselines/reference/parserX_TypeArgumentList1.errors.txt +++ b/tests/baselines/reference/TypeArgumentList1.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/parserX_TypeArgumentList1.ts (5 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/TypeArgumentLists/TypeArgumentList1.ts (5 errors) ==== Foo(4, 5, 6); !!! Invalid character. diff --git a/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt index df4fe1ecf9e..8765a8002a5 100644 --- a/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt +++ b/tests/baselines/reference/accessorParameterAccessibilityModifier.errors.txt @@ -1,14 +1,15 @@ ==== tests/cases/compiler/accessorParameterAccessibilityModifier.ts (4 errors) ==== + // target: es5 class C { set X(public v) { } ~ -!!! A parameter property is only allowed in a constructor implementation. +!!! Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~ !!! A parameter property is only allowed in a constructor implementation. static set X(public v2) { } ~ -!!! A parameter property is only allowed in a constructor implementation. +!!! Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~ !!! A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithES5.types b/tests/baselines/reference/accessorWithES5.types index 8753eb64ae4..9d4976dd91a 100644 --- a/tests/baselines/reference/accessorWithES5.types +++ b/tests/baselines/reference/accessorWithES5.types @@ -21,9 +21,7 @@ class D { var x = { >x : { a: number; } ->{ - get a() { return 1 } -} : { a: number; } +>{ get a() { return 1 }} : { a: number; } get a() { return 1 } >a : number @@ -31,9 +29,7 @@ var x = { var y = { >y : { b: any; } ->{ - set b(v) { } -} : { b: any; } +>{ set b(v) { }} : { b: any; } set b(v) { } >b : any diff --git a/tests/baselines/reference/accessorWithInitializer.errors.txt b/tests/baselines/reference/accessorWithInitializer.errors.txt index 127bfdc8d82..ebd518ec9e8 100644 --- a/tests/baselines/reference/accessorWithInitializer.errors.txt +++ b/tests/baselines/reference/accessorWithInitializer.errors.txt @@ -1,10 +1,11 @@ ==== tests/cases/compiler/accessorWithInitializer.ts (2 errors) ==== + // target: es5 class C { set X(v = 0) { } ~ -!!! A 'set' accessor parameter cannot have an initializer. +!!! Accessors are only available when targeting ECMAScript 5 and higher. static set X(v2 = 0) { } ~ -!!! A 'set' accessor parameter cannot have an initializer. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/accessorWithRestParam.errors.txt b/tests/baselines/reference/accessorWithRestParam.errors.txt index 10f4633805f..8f5877fef1e 100644 --- a/tests/baselines/reference/accessorWithRestParam.errors.txt +++ b/tests/baselines/reference/accessorWithRestParam.errors.txt @@ -1,10 +1,9 @@ ==== tests/cases/compiler/accessorWithRestParam.ts (2 errors) ==== - class C { set X(...v) { } ~ -!!! A 'set' accessor cannot have rest parameter. +!!! Accessors are only available when targeting ECMAScript 5 and higher. static set X(...v2) { } ~ -!!! A 'set' accessor cannot have rest parameter. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types index da534c68ad6..15672dc0006 100644 --- a/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types +++ b/tests/baselines/reference/additionOperatorWithAnyAndEveryType.types @@ -1,6 +1,6 @@ === tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithAnyAndEveryType.ts === function foo() { } ->foo : () => void +>foo : typeof foo class C { >C : C @@ -9,7 +9,7 @@ class C { >a : string static foo() { } ->foo : () => void +>foo : typeof foo } enum E { a, b, c } >E : E @@ -98,14 +98,14 @@ var r10 = a + foo; >r10 : any >a + foo : any >a : any ->foo : () => void +>foo : typeof foo var r11 = a + foo(); >r11 : any >a + foo() : any >a : any >foo() : void ->foo : () => void +>foo : typeof foo var r12 = a + C; >r12 : any diff --git a/tests/baselines/reference/aliasInaccessibleModule.errors.txt b/tests/baselines/reference/aliasInaccessibleModule.errors.txt deleted file mode 100644 index 839ea965b02..00000000000 --- a/tests/baselines/reference/aliasInaccessibleModule.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -==== tests/cases/compiler/aliasInaccessibleModule.ts (1 errors) ==== - module M { - module N { - } - export import X = N; - ~~~~~~~~~~~~~~~~~~~~ -!!! Import declaration 'X' is using private name 'N'. - } \ No newline at end of file diff --git a/tests/baselines/reference/aliasInaccessibleModule.types b/tests/baselines/reference/aliasInaccessibleModule.types new file mode 100644 index 00000000000..482e3f667ac --- /dev/null +++ b/tests/baselines/reference/aliasInaccessibleModule.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/aliasInaccessibleModule.ts === +module M { +>M : typeof M + + module N { +>N : N + } + export import X = N; +>X : X +>N : N +} diff --git a/tests/baselines/reference/aliasInaccessibleModule2.errors.txt b/tests/baselines/reference/aliasInaccessibleModule2.errors.txt deleted file mode 100644 index 149410acb10..00000000000 --- a/tests/baselines/reference/aliasInaccessibleModule2.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -==== tests/cases/compiler/aliasInaccessibleModule2.ts (1 errors) ==== - module M { - module N { - class C { - } - - } - import R = N; - ~~~~~~~~~~~~~ -!!! Import declaration 'R' is using private name 'N'. - export import X = R; - } \ No newline at end of file diff --git a/tests/baselines/reference/aliasInaccessibleModule2.types b/tests/baselines/reference/aliasInaccessibleModule2.types new file mode 100644 index 00000000000..1ad25ae0cf9 --- /dev/null +++ b/tests/baselines/reference/aliasInaccessibleModule2.types @@ -0,0 +1,20 @@ +=== tests/cases/compiler/aliasInaccessibleModule2.ts === +module M { +>M : typeof M + + module N { +>N : typeof N + + class C { +>C : C + } + + } + import R = N; +>R : typeof N +>N : typeof N + + export import X = R; +>X : typeof N +>R : typeof N +} diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.errors.txt b/tests/baselines/reference/aliasUsageInAccessorsOfClass.errors.txt new file mode 100644 index 00000000000..2fdccc7f49a --- /dev/null +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/compiler/aliasUsage1_main.ts (2 errors) ==== + import Backbone = require("aliasUsage1_backbone"); + import moduleA = require("aliasUsage1_moduleA"); + interface IHasVisualizationModel { + VisualizationModel: typeof Backbone.Model; + } + class C2 { + x: IHasVisualizationModel; + get A() { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + return this.x; + } + set A(x) { + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + x = moduleA; + } + } +==== tests/cases/compiler/aliasUsage1_backbone.ts (0 errors) ==== + export class Model { + public someData: string; + } + +==== tests/cases/compiler/aliasUsage1_moduleA.ts (0 errors) ==== + import Backbone = require("aliasUsage1_backbone"); + export class VisualizationModel extends Backbone.Model { + // interesting stuff here + } + \ No newline at end of file diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js deleted file mode 100644 index 485aedc971d..00000000000 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js +++ /dev/null @@ -1,69 +0,0 @@ -//// [tests/cases/compiler/aliasUsageInAccessorsOfClass.ts] //// - -//// [aliasUsage1_backbone.ts] -export class Model { - public someData: string; -} - -//// [aliasUsage1_moduleA.ts] -import Backbone = require("aliasUsage1_backbone"); -export class VisualizationModel extends Backbone.Model { - // interesting stuff here -} - -//// [aliasUsage1_main.ts] -import Backbone = require("aliasUsage1_backbone"); -import moduleA = require("aliasUsage1_moduleA"); -interface IHasVisualizationModel { - VisualizationModel: typeof Backbone.Model; -} -class C2 { - x: IHasVisualizationModel; - get A() { - return this.x; - } - set A(x) { - x = moduleA; - } -} - -//// [aliasUsage1_backbone.js] -var Model = (function () { - function Model() { - } - return Model; -})(); -exports.Model = Model; -//// [aliasUsage1_moduleA.js] -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var Backbone = require("aliasUsage1_backbone"); -var VisualizationModel = (function (_super) { - __extends(VisualizationModel, _super); - function VisualizationModel() { - _super.apply(this, arguments); - } - return VisualizationModel; -})(Backbone.Model); -exports.VisualizationModel = VisualizationModel; -//// [aliasUsage1_main.js] -var moduleA = require("aliasUsage1_moduleA"); -var C2 = (function () { - function C2() { - } - Object.defineProperty(C2.prototype, "A", { - get: function () { - return this.x; - }, - set: function (x) { - x = moduleA; - }, - enumerable: true, - configurable: true - }); - return C2; -})(); diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types b/tests/baselines/reference/aliasUsageInAccessorsOfClass.types deleted file mode 100644 index 8dc3aadedae..00000000000 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.types +++ /dev/null @@ -1,60 +0,0 @@ -=== tests/cases/compiler/aliasUsage1_main.ts === -import Backbone = require("aliasUsage1_backbone"); ->Backbone : typeof "tests/cases/compiler/aliasUsage1_backbone" - -import moduleA = require("aliasUsage1_moduleA"); ->moduleA : typeof "tests/cases/compiler/aliasUsage1_moduleA" - -interface IHasVisualizationModel { ->IHasVisualizationModel : IHasVisualizationModel - - VisualizationModel: typeof Backbone.Model; ->VisualizationModel : typeof Model ->Backbone : typeof "tests/cases/compiler/aliasUsage1_backbone" ->Model : typeof Model -} -class C2 { ->C2 : C2 - - x: IHasVisualizationModel; ->x : IHasVisualizationModel ->IHasVisualizationModel : IHasVisualizationModel - - get A() { ->A : IHasVisualizationModel - - return this.x; ->this.x : IHasVisualizationModel ->this : C2 ->x : IHasVisualizationModel - } - set A(x) { ->A : IHasVisualizationModel ->x : IHasVisualizationModel - - x = moduleA; ->x = moduleA : typeof "tests/cases/compiler/aliasUsage1_moduleA" ->x : IHasVisualizationModel ->moduleA : typeof "tests/cases/compiler/aliasUsage1_moduleA" - } -} -=== tests/cases/compiler/aliasUsage1_backbone.ts === -export class Model { ->Model : Model - - public someData: string; ->someData : string -} - -=== tests/cases/compiler/aliasUsage1_moduleA.ts === -import Backbone = require("aliasUsage1_backbone"); ->Backbone : typeof "tests/cases/compiler/aliasUsage1_backbone" - -export class VisualizationModel extends Backbone.Model { ->VisualizationModel : VisualizationModel ->Backbone : Backbone ->Model : Model - - // interesting stuff here -} - diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.types b/tests/baselines/reference/aliasUsageInGenericFunction.types index 2d357d58ceb..a54953520db 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.types +++ b/tests/baselines/reference/aliasUsageInGenericFunction.types @@ -14,7 +14,7 @@ interface IHasVisualizationModel { >Model : typeof Model } function foo(x: T) { ->foo : (x: T) => T +>foo : typeof foo >T : T >a : IHasVisualizationModel >IHasVisualizationModel : IHasVisualizationModel @@ -27,7 +27,7 @@ function foo(x: T) { var r = foo({ a: moduleA }); >r : { a: typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA"; } >foo({ a: moduleA }) : { a: typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA"; } ->foo : (x: T) => T +>foo : typeof foo >{ a: moduleA } : { a: typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA"; } >a : typeof "tests/cases/compiler/aliasUsageInGenericFunction_moduleA" >moduleA : moduleA @@ -35,7 +35,7 @@ var r = foo({ a: moduleA }); var r2 = foo({ a: null }); >r2 : { a: IHasVisualizationModel; } >foo({ a: null }) : { a: IHasVisualizationModel; } ->foo : (x: T) => T +>foo : typeof foo >{ a: null } : { a: IHasVisualizationModel; } >a : IHasVisualizationModel >null : IHasVisualizationModel diff --git a/tests/baselines/reference/aliasUsedAsNameValue.types b/tests/baselines/reference/aliasUsedAsNameValue.types index 3eebbdce7fd..8783d3fd14e 100644 --- a/tests/baselines/reference/aliasUsedAsNameValue.types +++ b/tests/baselines/reference/aliasUsedAsNameValue.types @@ -9,17 +9,14 @@ import b = require("aliasUsedAsNameValue_1"); export var a = function () { >a : () => void ->function () { - //var x = mod.id; // TODO needed hack that mod is loaded - b.b(mod); -} : () => void +>function () { //var x = mod.id; // TODO needed hack that mod is loaded b.b(mod);} : () => void //var x = mod.id; // TODO needed hack that mod is loaded b.b(mod); >b.b(mod) : any ->b.b : (a: any) => any +>b.b : typeof b >b : typeof "tests/cases/compiler/aliasUsedAsNameValue_1" ->b : (a: any) => any +>b : typeof b >mod : typeof "tests/cases/compiler/aliasUsedAsNameValue_0" } @@ -29,6 +26,6 @@ export var id: number; === tests/cases/compiler/aliasUsedAsNameValue_1.ts === export function b(a: any): any { return null; } ->b : (a: any) => any +>b : typeof b >a : any diff --git a/tests/baselines/reference/ambientDeclarations.types b/tests/baselines/reference/ambientDeclarations.types index 38814405521..11b7bae1617 100644 --- a/tests/baselines/reference/ambientDeclarations.types +++ b/tests/baselines/reference/ambientDeclarations.types @@ -9,50 +9,50 @@ declare var m: string; // Ambient function with no type annotations declare function fn1(); ->fn1 : () => any +>fn1 : typeof fn1 // Ambient function with type annotations declare function fn2(n: string): number; ->fn2 : (n: string) => number +>fn2 : typeof fn2 >n : string // Ambient function with valid overloads declare function fn3(n: string): number; ->fn3 : (n: string) => number +>fn3 : typeof fn3 >n : string declare function fn4(n: number, y: number): string; ->fn4 : (n: number, y: number) => string +>fn4 : typeof fn4 >n : number >y : number // Ambient function with optional parameters declare function fn5(x, y?); ->fn5 : (x: any, y?: any) => any +>fn5 : typeof fn5 >x : any >y : any declare function fn6(e?); ->fn6 : (e?: any) => any +>fn6 : typeof fn6 >e : any declare function fn7(x, y?, ...z); ->fn7 : (x: any, y?: any, ...z: any[]) => any +>fn7 : typeof fn7 >x : any >y : any >z : any[] declare function fn8(y?, ...z: number[]); ->fn8 : (y?: any, ...z: number[]) => any +>fn8 : typeof fn8 >y : any >z : number[] declare function fn9(...q: {}[]); ->fn9 : (...q: {}[]) => any +>fn9 : typeof fn9 >q : {}[] declare function fn10(...q: T[]); ->fn10 : (...q: T[]) => any +>fn10 : typeof fn10 >T : T >q : T[] >T : T @@ -67,7 +67,7 @@ declare class cls { >cls : cls static static(p): number; ->static : (p: any) => number +>static : typeof static >p : any static q; @@ -77,7 +77,7 @@ declare class cls { >fn : () => any private static fns(); ->fns : () => any +>fns : typeof fns } // Ambient enum @@ -141,7 +141,7 @@ declare module M1 { >x : any function fn(): number; ->fn : () => number +>fn : typeof fn } // Ambient module members are always exported with or without export keyword @@ -154,9 +154,9 @@ var p = M1.x; var q = M1.fn(); >q : number >M1.fn() : number ->M1.fn : () => number +>M1.fn : typeof fn >M1 : typeof M1 ->fn : () => number +>fn : typeof fn // Ambient external module in the global module // Ambient external module with a string literal name that is a top level external module name diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt index fba44282cc3..084ff473afc 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.errors.txt @@ -1,12 +1,6 @@ -==== tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts (2 errors) ==== +==== tests/cases/compiler/ambientExternalModuleWithRelativeModuleName.ts (1 errors) ==== declare module "./relativeModule" { ~~~~~~~~~~~~~~~~~~ -!!! Ambient external module declaration cannot specify relative module name. - var x: string; - } - - declare module ".\\relativeModule" { - ~~~~~~~~~~~~~~~~~~~ !!! Ambient external module declaration cannot specify relative module name. var x: string; } \ No newline at end of file diff --git a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js index 9a4622a1b7e..6eb77f96970 100644 --- a/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js +++ b/tests/baselines/reference/ambientExternalModuleWithRelativeModuleName.js @@ -1,10 +1,6 @@ //// [ambientExternalModuleWithRelativeModuleName.ts] declare module "./relativeModule" { var x: string; -} - -declare module ".\\relativeModule" { - var x: string; } //// [ambientExternalModuleWithRelativeModuleName.js] diff --git a/tests/baselines/reference/ambientGetters.errors.txt b/tests/baselines/reference/ambientGetters.errors.txt index a01c146d977..0ed6bda5848 100644 --- a/tests/baselines/reference/ambientGetters.errors.txt +++ b/tests/baselines/reference/ambientGetters.errors.txt @@ -1,13 +1,12 @@ ==== tests/cases/compiler/ambientGetters.ts (2 errors) ==== - declare class A { get length() : number; ~~~~~~ -!!! An accessor cannot be declared in an ambient context. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } declare class B { get length() { return 0; } ~~~~~~ -!!! An accessor cannot be declared in an ambient context. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/ambientModuleExports.types b/tests/baselines/reference/ambientModuleExports.types index bb964bd3927..deb49b17694 100644 --- a/tests/baselines/reference/ambientModuleExports.types +++ b/tests/baselines/reference/ambientModuleExports.types @@ -3,7 +3,7 @@ declare module Foo { >Foo : typeof Foo function a():void; ->a : () => void +>a : typeof a var b:number; >b : number @@ -14,9 +14,9 @@ declare module Foo { Foo.a(); >Foo.a() : void ->Foo.a : () => void +>Foo.a : typeof a >Foo : typeof Foo ->a : () => void +>a : typeof a Foo.b; >Foo.b : number @@ -34,7 +34,7 @@ declare module Foo2 { >Foo2 : typeof Foo2 export function a(): void; ->a : () => void +>a : typeof a export var b: number; >b : number @@ -45,9 +45,9 @@ declare module Foo2 { Foo2.a(); >Foo2.a() : void ->Foo2.a : () => void +>Foo2.a : typeof a >Foo2 : typeof Foo2 ->a : () => void +>a : typeof a Foo2.b; >Foo2.b : number diff --git a/tests/baselines/reference/ambiguousOverloadResolution.types b/tests/baselines/reference/ambiguousOverloadResolution.types index dd42b44d7c3..17ce79db6f1 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.types +++ b/tests/baselines/reference/ambiguousOverloadResolution.types @@ -8,14 +8,14 @@ class B extends A { x: number; } >x : number declare function f(p: A, q: B): number; ->f : { (p: A, q: B): number; (p: B, q: A): string; } +>f : typeof f >p : A >A : A >q : B >B : B declare function f(p: B, q: A): string; ->f : { (p: A, q: B): number; (p: B, q: A): string; } +>f : typeof f >p : B >B : B >q : A @@ -28,7 +28,7 @@ var x: B; var t: number = f(x, x); // Not an error >t : number >f(x, x) : number ->f : { (p: A, q: B): number; (p: B, q: A): string; } +>f : typeof f >x : B >x : B diff --git a/tests/baselines/reference/amdDependencyComment2.errors.txt b/tests/baselines/reference/amdDependencyComment2.errors.txt deleted file mode 100644 index edab2e9c955..00000000000 --- a/tests/baselines/reference/amdDependencyComment2.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/compiler/amdDependencyComment2.ts (1 errors) ==== - /// - - import m1 = require("m2") - ~~~~ -!!! Cannot find external module 'm2'. - m1.f(); \ No newline at end of file diff --git a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types index f25cd57831b..e95e692c34d 100644 --- a/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types +++ b/tests/baselines/reference/anyAsReturnTypeForNewOnCall.types @@ -1,6 +1,6 @@ === tests/cases/compiler/anyAsReturnTypeForNewOnCall.ts === function Point(x, y) { ->Point : (x: any, y: any) => void +>Point : typeof Point >x : any >y : any @@ -23,7 +23,7 @@ function Point(x, y) { var o = new Point(3, 4); >o : any >new Point(3, 4) : any ->Point : (x: any, y: any) => void +>Point : typeof Point var xx = o.x; >xx : any diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.types b/tests/baselines/reference/anyAssignabilityInInheritance.types index f5a4f22ef3f..795e4a1f332 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.types +++ b/tests/baselines/reference/anyAssignabilityInInheritance.types @@ -15,107 +15,107 @@ var a: any; >a : any declare function foo2(x: number): number; ->foo2 : { (x: number): number; (x: any): any; } +>foo2 : typeof foo2 >x : number declare function foo2(x: any): any; ->foo2 : { (x: number): number; (x: any): any; } +>foo2 : typeof foo2 >x : any var r3 = foo2(a); // any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload) >r3 : any >foo2(a) : any ->foo2 : { (x: number): number; (x: any): any; } +>foo2 : typeof foo2 >a : any declare function foo3(x: string): string; ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >x : string declare function foo3(x: any): any; ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any declare function foo4(x: boolean): boolean; ->foo4 : { (x: boolean): boolean; (x: any): any; } +>foo4 : typeof foo4 >x : boolean declare function foo4(x: any): any; ->foo4 : { (x: boolean): boolean; (x: any): any; } +>foo4 : typeof foo4 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any declare function foo5(x: Date): Date; ->foo5 : { (x: Date): Date; (x: any): any; } +>foo5 : typeof foo5 >x : Date >Date : Date >Date : Date declare function foo5(x: any): any; ->foo5 : { (x: Date): Date; (x: any): any; } +>foo5 : typeof foo5 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any declare function foo6(x: RegExp): RegExp; ->foo6 : { (x: RegExp): RegExp; (x: any): any; } +>foo6 : typeof foo6 >x : RegExp >RegExp : RegExp >RegExp : RegExp declare function foo6(x: any): any; ->foo6 : { (x: RegExp): RegExp; (x: any): any; } +>foo6 : typeof foo6 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any declare function foo7(x: { bar: number }): { bar: number }; ->foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; } +>foo7 : typeof foo7 >x : { bar: number; } >bar : number >bar : number declare function foo7(x: any): any; ->foo7 : { (x: { bar: number; }): { bar: number; }; (x: any): any; } +>foo7 : typeof foo7 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any declare function foo8(x: number[]): number[]; ->foo8 : { (x: number[]): number[]; (x: any): any; } +>foo8 : typeof foo8 >x : number[] declare function foo8(x: any): any; ->foo8 : { (x: number[]): number[]; (x: any): any; } +>foo8 : typeof foo8 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any interface I8 { foo: string } @@ -123,19 +123,19 @@ interface I8 { foo: string } >foo : string declare function foo9(x: I8): I8; ->foo9 : { (x: I8): I8; (x: any): any; } +>foo9 : typeof foo9 >x : I8 >I8 : I8 >I8 : I8 declare function foo9(x: any): any; ->foo9 : { (x: I8): I8; (x: any): any; } +>foo9 : typeof foo9 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any class A { foo: number; } @@ -143,19 +143,19 @@ class A { foo: number; } >foo : number declare function foo10(x: A): A; ->foo10 : { (x: A): A; (x: any): any; } +>foo10 : typeof foo10 >x : A >A : A >A : A declare function foo10(x: any): any; ->foo10 : { (x: A): A; (x: any): any; } +>foo10 : typeof foo10 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any class A2 { foo: T; } @@ -165,39 +165,39 @@ class A2 { foo: T; } >T : T declare function foo11(x: A2): A2; ->foo11 : { (x: A2): A2; (x: any): any; } +>foo11 : typeof foo11 >x : A2 >A2 : A2 >A2 : A2 declare function foo11(x: any): any; ->foo11 : { (x: A2): A2; (x: any): any; } +>foo11 : typeof foo11 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any declare function foo12(x: (x) => number): (x) => number; ->foo12 : { (x: (x: any) => number): (x: any) => number; (x: any): any; } +>foo12 : typeof foo12 >x : (x: any) => number >x : any >x : any declare function foo12(x: any): any; ->foo12 : { (x: (x: any) => number): (x: any) => number; (x: any): any; } +>foo12 : typeof foo12 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any declare function foo13(x: (x: T) => T): (x: T) => T; ->foo13 : { (x: (x: T) => T): (x: T) => T; (x: any): any; } +>foo13 : typeof foo13 >x : (x: T) => T >T : T >x : T @@ -209,13 +209,13 @@ declare function foo13(x: (x: T) => T): (x: T) => T; >T : T declare function foo13(x: any): any; ->foo13 : { (x: (x: T) => T): (x: T) => T; (x: any): any; } +>foo13 : typeof foo13 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any enum E { A } @@ -223,19 +223,19 @@ enum E { A } >A : E declare function foo14(x: E): E; ->foo14 : { (x: E): E; (x: any): any; } +>foo14 : typeof foo14 >x : E >E : E >E : E declare function foo14(x: any): any; ->foo14 : { (x: E): E; (x: any): any; } +>foo14 : typeof foo14 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any function f() { } @@ -248,19 +248,19 @@ module f { >bar : number } declare function foo15(x: typeof f): typeof f; ->foo15 : { (x: typeof f): typeof f; (x: any): any; } +>foo15 : typeof foo15 >x : typeof f >f : typeof f >f : typeof f declare function foo15(x: any): any; ->foo15 : { (x: typeof f): typeof f; (x: any): any; } +>foo15 : typeof foo15 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any class CC { baz: string } @@ -274,48 +274,48 @@ module CC { >bar : number } declare function foo16(x: CC): CC; ->foo16 : { (x: CC): CC; (x: any): any; } +>foo16 : typeof foo16 >x : CC >CC : CC >CC : CC declare function foo16(x: any): any; ->foo16 : { (x: CC): CC; (x: any): any; } +>foo16 : typeof foo16 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any declare function foo17(x: Object): Object; ->foo17 : { (x: Object): Object; (x: any): any; } +>foo17 : typeof foo17 >x : Object >Object : Object >Object : Object declare function foo17(x: any): any; ->foo17 : { (x: Object): Object; (x: any): any; } +>foo17 : typeof foo17 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any declare function foo18(x: {}): {}; ->foo18 : { (x: {}): {}; (x: any): any; } +>foo18 : typeof foo18 >x : {} declare function foo18(x: any): any; ->foo18 : { (x: {}): {}; (x: any): any; } +>foo18 : typeof foo18 >x : any var r3 = foo3(a); // any >r3 : any >foo3(a) : any ->foo3 : { (x: string): string; (x: any): any; } +>foo3 : typeof foo3 >a : any diff --git a/tests/baselines/reference/anyAssignableToEveryType.types b/tests/baselines/reference/anyAssignableToEveryType.types index c2a9b324d96..36c24c6ac3d 100644 --- a/tests/baselines/reference/anyAssignableToEveryType.types +++ b/tests/baselines/reference/anyAssignableToEveryType.types @@ -121,7 +121,7 @@ var q: String = a; >a : any function foo(x: T, y: U, z: V) { ->foo : (x: T, y: U, z: V) => void +>foo : typeof foo >T : T >U : U >V : V diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.types b/tests/baselines/reference/anyInferenceAnonymousFunctions.types index ac249f83414..8dc7fdcb90f 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.types +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.types @@ -3,19 +3,11 @@ var paired: any[]; >paired : any[] paired.reduce(function (a1, a2) { ->paired.reduce(function (a1, a2) { - - return a1.concat({}); - -} , []) : any +>paired.reduce(function (a1, a2) { return a1.concat({});} , []) : any >paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >paired : any[] >reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } ->function (a1, a2) { - - return a1.concat({}); - -} : (a1: any, a2: any) => any +>function (a1, a2) { return a1.concat({});} : (a1: any, a2: any) => any >a1 : any >a2 : any @@ -30,17 +22,11 @@ paired.reduce(function (a1, a2) { >[] : undefined[] paired.reduce((b1, b2) => { ->paired.reduce((b1, b2) => { - - return b1.concat({}); -} , []) : any +>paired.reduce((b1, b2) => { return b1.concat({});} , []) : any >paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >paired : any[] >reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } ->(b1, b2) => { - - return b1.concat({}); -} : (b1: any, b2: any) => any +>(b1, b2) => { return b1.concat({});} : (b1: any, b2: any) => any >b1 : any >b2 : any diff --git a/tests/baselines/reference/arguments.types b/tests/baselines/reference/arguments.types index 1902e459316..5adaf29a8ba 100644 --- a/tests/baselines/reference/arguments.types +++ b/tests/baselines/reference/arguments.types @@ -1,6 +1,6 @@ === tests/cases/compiler/arguments.ts === function f() { ->f : () => void +>f : typeof f var x=arguments[12]; >x : any diff --git a/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.types b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.types index 532412d0c08..63c7c5d556e 100644 --- a/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.types +++ b/tests/baselines/reference/argumentsUsedInObjectLiteralProperty.types @@ -3,14 +3,12 @@ class A { >A : A public static createSelectableViewModel(initialState?: any, selectedValue?: any) { ->createSelectableViewModel : (initialState?: any, selectedValue?: any) => { selectedValue: number; } +>createSelectableViewModel : typeof createSelectableViewModel >initialState : any >selectedValue : any return { ->{ - selectedValue: arguments.length - } : { selectedValue: number; } +>{ selectedValue: arguments.length } : { selectedValue: number; } selectedValue: arguments.length >selectedValue : number diff --git a/tests/baselines/reference/arrayConcatMap.types b/tests/baselines/reference/arrayConcatMap.types index 643f1a6a57e..92da3edf93f 100644 --- a/tests/baselines/reference/arrayConcatMap.types +++ b/tests/baselines/reference/arrayConcatMap.types @@ -1,10 +1,8 @@ === tests/cases/compiler/arrayConcatMap.ts === var x = [].concat([{ a: 1 }], [{ a: 2 }]) >x : any[] ->[].concat([{ a: 1 }], [{ a: 2 }]) - .map(b => b.a) : any[] ->[].concat([{ a: 1 }], [{ a: 2 }]) - .map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] +>[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[] +>[].concat([{ a: 1 }], [{ a: 2 }]) .map : (callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any) => U[] >[].concat([{ a: 1 }], [{ a: 2 }]) : any[] >[].concat : { (...items: U[]): any[]; (...items: any[]): any[]; } >[] : undefined[] diff --git a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types index c4889e223bb..9afd479dc7f 100644 --- a/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types +++ b/tests/baselines/reference/arrayLiteralInNonVarArgParameter.types @@ -1,11 +1,11 @@ === tests/cases/compiler/arrayLiteralInNonVarArgParameter.ts === function panic(val: string[], ...opt: string[]) { } ->panic : (val: string[], ...opt: string[]) => void +>panic : typeof panic >val : string[] >opt : string[] panic([], 'one', 'two'); >panic([], 'one', 'two') : void ->panic : (val: string[], ...opt: string[]) => void +>panic : typeof panic >[] : string[] diff --git a/tests/baselines/reference/arrayLiteralTypeInference.types b/tests/baselines/reference/arrayLiteralTypeInference.types index a5f1cb97084..5b4d9b7fff8 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.types +++ b/tests/baselines/reference/arrayLiteralTypeInference.types @@ -25,10 +25,7 @@ class ActionB extends Action { var x1: Action[] = [ >x1 : Action[] >Action : Action ->[ - { id: 2, trueness: false }, - { id: 3, name: "three" } -] : Action[] +>[ { id: 2, trueness: false }, { id: 3, name: "three" }] : Action[] { id: 2, trueness: false }, >{ id: 2, trueness: false } : { id: number; trueness: boolean; } @@ -45,10 +42,7 @@ var x1: Action[] = [ var x2: Action[] = [ >x2 : Action[] >Action : Action ->[ - new ActionA(), - new ActionB() -] : Action[] +>[ new ActionA(), new ActionB()] : Action[] new ActionA(), >new ActionA() : ActionA @@ -63,11 +57,7 @@ var x2: Action[] = [ var x3: Action[] = [ >x3 : Action[] >Action : Action ->[ - new Action(), - new ActionA(), - new ActionB() -] : Action[] +>[ new Action(), new ActionA(), new ActionB()] : Action[] new Action(), >new Action() : Action @@ -88,10 +78,7 @@ var z1: { id: number }[] = >id : number [ ->[ - { id: 2, trueness: false }, - { id: 3, name: "three" } - ] : { id: number; }[] +>[ { id: 2, trueness: false }, { id: 3, name: "three" } ] : { id: number; }[] { id: 2, trueness: false }, >{ id: 2, trueness: false } : { id: number; trueness: boolean; } @@ -110,10 +97,7 @@ var z2: { id: number }[] = >id : number [ ->[ - new ActionA(), - new ActionB() - ] : { id: number; }[] +>[ new ActionA(), new ActionB() ] : { id: number; }[] new ActionA(), >new ActionA() : ActionA @@ -130,11 +114,7 @@ var z3: { id: number }[] = >id : number [ ->[ - new Action(), - new ActionA(), - new ActionB() - ] : { id: number; }[] +>[ new Action(), new ActionA(), new ActionB() ] : { id: number; }[] new Action(), >new Action() : Action diff --git a/tests/baselines/reference/arrayconcat.types b/tests/baselines/reference/arrayconcat.types index 0ae65d31426..37e7308aad9 100644 --- a/tests/baselines/reference/arrayconcat.types +++ b/tests/baselines/reference/arrayconcat.types @@ -36,50 +36,17 @@ class parser { >m : () => void this.options = this.options.sort(function(a, b) { ->this.options = this.options.sort(function(a, b) { - var aName = a.name.toLowerCase(); - var bName = b.name.toLowerCase(); - - if (aName > bName) { - return 1; - } else if (aName < bName) { - return -1; - } else { - return 0; - } - }) : IOptions[] +>this.options = this.options.sort(function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } }) : IOptions[] >this.options : IOptions[] >this : parser >options : IOptions[] ->this.options.sort(function(a, b) { - var aName = a.name.toLowerCase(); - var bName = b.name.toLowerCase(); - - if (aName > bName) { - return 1; - } else if (aName < bName) { - return -1; - } else { - return 0; - } - }) : IOptions[] +>this.options.sort(function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } }) : IOptions[] >this.options.sort : (compareFn?: (a: IOptions, b: IOptions) => number) => IOptions[] >this.options : IOptions[] >this : parser >options : IOptions[] >sort : (compareFn?: (a: IOptions, b: IOptions) => number) => IOptions[] ->function(a, b) { - var aName = a.name.toLowerCase(); - var bName = b.name.toLowerCase(); - - if (aName > bName) { - return 1; - } else if (aName < bName) { - return -1; - } else { - return 0; - } - } : (a: IOptions, b: IOptions) => number +>function(a, b) { var aName = a.name.toLowerCase(); var bName = b.name.toLowerCase(); if (aName > bName) { return 1; } else if (aName < bName) { return -1; } else { return 0; } } : (a: IOptions, b: IOptions) => number >a : IOptions >b : IOptions diff --git a/tests/baselines/reference/arrowFunctionExpressions.types b/tests/baselines/reference/arrowFunctionExpressions.types index 6d23dcd6600..8a27de65225 100644 --- a/tests/baselines/reference/arrowFunctionExpressions.types +++ b/tests/baselines/reference/arrowFunctionExpressions.types @@ -118,7 +118,7 @@ var e: number; // Arrow function used in arrow function used in function function someFn() { ->someFn : () => void +>someFn : typeof someFn var arr = (n: number) => (p: number) => p * n; >arr : (n: number) => (p: number) => number @@ -141,7 +141,7 @@ function someFn() { // Arrow function used in function function someOtherFn() { ->someOtherFn : () => void +>someOtherFn : typeof someOtherFn var arr = (n: number) => '' + n; >arr : (n: number) => string @@ -160,7 +160,7 @@ function someOtherFn() { // Arrow function used in nested function in function function outerFn() { ->outerFn : () => void +>outerFn : typeof outerFn function innerFn() { >innerFn : () => void @@ -182,12 +182,7 @@ function outerFn() { // Arrow function used in nested function in arrow function var f = (n: string) => { >f : (n: string) => () => string ->(n: string) => { - function fn(x: number) { - return () => n + x; - } - return fn(4); -} : (n: string) => () => string +>(n: string) => { function fn(x: number) { return () => n + x; } return fn(4);} : (n: string) => () => string >n : string function fn(x: number) { @@ -216,16 +211,11 @@ var g: string; // Arrow function used in nested function in arrow function in nested function function someOuterFn() { ->someOuterFn : () => (n: string) => () => () => number +>someOuterFn : typeof someOuterFn var arr = (n: string) => { >arr : (n: string) => () => () => number ->(n: string) => { - function innerFn() { - return () => n.length; - } - return innerFn; - } : (n: string) => () => () => number +>(n: string) => { function innerFn() { return () => n.length; } return innerFn; } : (n: string) => () => () => number >n : string function innerFn() { @@ -249,7 +239,7 @@ var h = someOuterFn()('')()(); >someOuterFn()('')() : () => number >someOuterFn()('') : () => () => number >someOuterFn() : (n: string) => () => () => number ->someOuterFn : () => (n: string) => () => () => number +>someOuterFn : typeof someOuterFn h.toExponential(); >h.toExponential() : string @@ -259,7 +249,7 @@ h.toExponential(); // Arrow function used in try/catch/finally in function function tryCatchFn() { ->tryCatchFn : () => void +>tryCatchFn : typeof tryCatchFn try { var x = () => this; diff --git a/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.errors.txt b/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.errors.txt deleted file mode 100644 index a0cf2c00518..00000000000 --- a/tests/baselines/reference/arrowFunctionMissingCurlyWithSemicolon.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/compiler/arrowFunctionMissingCurlyWithSemicolon.ts (1 errors) ==== - // Should error at semicolon. - var f = () => ; - ~ -!!! Expression expected. - var b = 1 * 2 * 3 * 4; - var square = (x: number) => x * x; \ No newline at end of file diff --git a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt b/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt deleted file mode 100644 index 69b94cd7d46..00000000000 --- a/tests/baselines/reference/arrowFunctionsMissingTokens.errors.txt +++ /dev/null @@ -1,115 +0,0 @@ -==== tests/cases/compiler/arrowFunctionsMissingTokens.ts (24 errors) ==== - - module missingArrowsWithCurly { - var a = () { }; - ~ -!!! '=>' expected. - - var b = (): void { } - ~ -!!! '=>' expected. - - var c = (x) { }; - ~ -!!! '=>' expected. - - var d = (x: number, y: string) { }; - ~ -!!! '=>' expected. - - var e = (x: number, y: string): void { }; - ~ -!!! '=>' expected. - } - - module missingCurliesWithArrow { - module withStatement { - var a = () => var k = 10;}; - ~~~ -!!! '{' expected. - - var b = (): void => var k = 10;} - ~~~ -!!! '{' expected. - - var c = (x) => var k = 10;}; - ~~~ -!!! '{' expected. - - var d = (x: number, y: string) => var k = 10;}; - ~~~ -!!! '{' expected. - - var e = (x: number, y: string): void => var k = 10;}; - ~~~ -!!! '{' expected. - - var f = () => var k = 10;} - ~~~ -!!! '{' expected. - } - - module withoutStatement { - var a = () => }; - ~ -!!! Expression expected. - - var b = (): void => } - ~ -!!! Expression expected. - - var c = (x) => }; - ~ -!!! Expression expected. - - var d = (x: number, y: string) => }; - ~ -!!! Expression expected. - - var e = (x: number, y: string): void => }; - ~ -!!! Expression expected. - - var f = () => } - ~ -!!! Expression expected. - } - ~ -!!! Declaration or statement expected. - } - ~ -!!! Declaration or statement expected. - - module ce_nEst_pas_une_arrow_function { - var a = (); - ~ -!!! Expression expected. - - var b = (): void; - ~ -!!! '=>' expected. - - var c = (x); - ~ -!!! Cannot find name 'x'. - - var d = (x: number, y: string); - ~ -!!! '=>' expected. - - var e = (x: number, y: string): void; - ~ -!!! '=>' expected. - } - - module okay { - var a = () => { }; - - var b = (): void => { } - - var c = (x) => { }; - - var d = (x: number, y: string) => { }; - - var e = (x: number, y: string): void => { }; - } \ No newline at end of file diff --git a/tests/baselines/reference/asiAmbientFunctionDeclaration.js b/tests/baselines/reference/asiAmbientFunctionDeclaration.js deleted file mode 100644 index 30b7e76056a..00000000000 --- a/tests/baselines/reference/asiAmbientFunctionDeclaration.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [asiAmbientFunctionDeclaration.ts] -declare function foo() - -//// [asiAmbientFunctionDeclaration.js] diff --git a/tests/baselines/reference/asiAmbientFunctionDeclaration.types b/tests/baselines/reference/asiAmbientFunctionDeclaration.types deleted file mode 100644 index 40ad7f2ba94..00000000000 --- a/tests/baselines/reference/asiAmbientFunctionDeclaration.types +++ /dev/null @@ -1,4 +0,0 @@ -=== tests/cases/compiler/asiAmbientFunctionDeclaration.ts === -declare function foo() ->foo : () => any - diff --git a/tests/baselines/reference/asiArith.types b/tests/baselines/reference/asiArith.types index 5a4ae5fbcc4..d6c0c7abd71 100644 --- a/tests/baselines/reference/asiArith.types +++ b/tests/baselines/reference/asiArith.types @@ -9,30 +9,16 @@ var z = >z : number x ->x - -+ - -+ - -+ - -y : number +>x+++y : number >x : number + + ->+ - -+ - -y : number +>++y : number + ->+ - -y : number +>+y : number y >y : number @@ -48,30 +34,16 @@ var c = >c : number x ->x - -- - -- - -- - -y : number +>x---y : number >x : number - - ->- - -- - -y : number +>--y : number - ->- - -y : number +>-y : number y >y : number diff --git a/tests/baselines/reference/asiBreak.js b/tests/baselines/reference/asiBreak.js deleted file mode 100644 index cd890f74de7..00000000000 --- a/tests/baselines/reference/asiBreak.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [asiBreak.ts] -while (true) break - -//// [asiBreak.js] -while (true) - break; diff --git a/tests/baselines/reference/asiBreak.types b/tests/baselines/reference/asiBreak.types deleted file mode 100644 index 355d27f2a43..00000000000 --- a/tests/baselines/reference/asiBreak.types +++ /dev/null @@ -1,3 +0,0 @@ -=== tests/cases/compiler/asiBreak.ts === -while (true) break -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asiContinue.js b/tests/baselines/reference/asiContinue.js deleted file mode 100644 index b2b9bc751cc..00000000000 --- a/tests/baselines/reference/asiContinue.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [asiContinue.ts] -while (true) continue - -//// [asiContinue.js] -while (true) - continue; diff --git a/tests/baselines/reference/asiContinue.types b/tests/baselines/reference/asiContinue.types deleted file mode 100644 index 5b3f0145377..00000000000 --- a/tests/baselines/reference/asiContinue.types +++ /dev/null @@ -1,3 +0,0 @@ -=== tests/cases/compiler/asiContinue.ts === -while (true) continue -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/asiInES6Classes.types b/tests/baselines/reference/asiInES6Classes.types index aa80e3e073e..90c7f71aba6 100644 --- a/tests/baselines/reference/asiInES6Classes.types +++ b/tests/baselines/reference/asiInES6Classes.types @@ -6,11 +6,7 @@ class Foo { defaults = { >defaults : { done: boolean; } ->{ - - done: false - - } : { done: boolean; } +>{ done: false } : { done: boolean; } done: false >done : boolean diff --git a/tests/baselines/reference/asiReturn.errors.txt b/tests/baselines/reference/asiReturn.errors.txt deleted file mode 100644 index 7b7b44655c2..00000000000 --- a/tests/baselines/reference/asiReturn.errors.txt +++ /dev/null @@ -1,5 +0,0 @@ -==== tests/cases/compiler/asiReturn.ts (1 errors) ==== - // This should be an error for using a return outside a function, but ASI should work properly - return - ~~~~~~ -!!! A 'return' statement can only be used within a function body. \ No newline at end of file diff --git a/tests/baselines/reference/assignEveryTypeToAny.types b/tests/baselines/reference/assignEveryTypeToAny.types index b25aba00837..379d705cc4b 100644 --- a/tests/baselines/reference/assignEveryTypeToAny.types +++ b/tests/baselines/reference/assignEveryTypeToAny.types @@ -150,7 +150,7 @@ x = { f(x: T) { return x; } } >x : T function j(a: T) { ->j : (a: T) => void +>j : typeof j >T : T >a : T >T : T diff --git a/tests/baselines/reference/assignToPrototype1.types b/tests/baselines/reference/assignToPrototype1.types index 6fec8d187d3..f4631c89e0b 100644 --- a/tests/baselines/reference/assignToPrototype1.types +++ b/tests/baselines/reference/assignToPrototype1.types @@ -9,15 +9,13 @@ declare class Point { } Point.prototype.add = function(dx, dy) { ->Point.prototype.add = function(dx, dy) { -} : (dx: number, dy: number) => void +>Point.prototype.add = function(dx, dy) {} : (dx: number, dy: number) => void >Point.prototype.add : (dx: number, dy: number) => void >Point.prototype : Point >Point : typeof Point >prototype : Point >add : (dx: number, dy: number) => void ->function(dx, dy) { -} : (dx: number, dy: number) => void +>function(dx, dy) {} : (dx: number, dy: number) => void >dx : number >dy : number diff --git a/tests/baselines/reference/assignmentCompatForEnums.types b/tests/baselines/reference/assignmentCompatForEnums.types index 53e8caab638..c8026077aec 100644 --- a/tests/baselines/reference/assignmentCompatForEnums.types +++ b/tests/baselines/reference/assignmentCompatForEnums.types @@ -10,16 +10,16 @@ var list = {}; function returnType(): TokenType { return null; } ->returnType : () => TokenType +>returnType : typeof returnType >TokenType : TokenType function foo() { ->foo : () => void +>foo : typeof foo var x = returnType(); >x : TokenType >returnType() : TokenType ->returnType : () => TokenType +>returnType : typeof returnType var x: TokenType = list['one']; >x : TokenType diff --git a/tests/baselines/reference/assignmentCompatOnNew.types b/tests/baselines/reference/assignmentCompatOnNew.types index 19994e61df8..a6fb74f6184 100644 --- a/tests/baselines/reference/assignmentCompatOnNew.types +++ b/tests/baselines/reference/assignmentCompatOnNew.types @@ -3,12 +3,12 @@ class Foo{}; >Foo : Foo function bar(x: {new(): Foo;}){} ->bar : (x: new () => Foo) => void +>bar : typeof bar >x : new () => Foo >Foo : Foo bar(Foo); // Error, but should be allowed >bar(Foo) : void ->bar : (x: new () => Foo) => void +>bar : typeof bar >Foo : typeof Foo diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.js b/tests/baselines/reference/assignmentCompatWithObjectMembers.js new file mode 100644 index 00000000000..14b49dcd1e7 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.js @@ -0,0 +1,168 @@ +//// [assignmentCompatWithObjectMembers.ts] +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// no errors expected + +module SimpleTypes { + class S { foo: string; } + class T { foo: string; } + var s: S; + var t: T; + + interface S2 { foo: string; } + interface T2 { foo: string; } + var s2: S2; + var t2: T2; + + var a: { foo: string; } + var b: { foo: string; } + + var a2 = { foo: '' }; + var b2 = { foo: '' }; + + s = t; + t = s; + s = s2; + s = a2; + + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + + a = b; + b = a; + a = s; + a = s2; + a = a2; + + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +} + +module ObjectTypes { + class S { foo: S; } + class T { foo: T; } + var s: S; + var t: T; + + interface S2 { foo: S2; } + interface T2 { foo: T2; } + var s2: S2; + var t2: T2; + + var a: { foo: typeof a; } + var b: { foo: typeof b; } + + var a2 = { foo: a2 }; + var b2 = { foo: b2 }; + + s = t; + t = s; + s = s2; + s = a2; + + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + + a = b; + b = a; + a = s; + a = s2; + a = a2; + + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; + +} + +//// [assignmentCompatWithObjectMembers.js] +var SimpleTypes; +(function (SimpleTypes) { + var S = (function () { + function S() { + } + return S; + })(); + var T = (function () { + function T() { + } + return T; + })(); + var s; + var t; + var s2; + var t2; + var a; + var b; + var a2 = { foo: '' }; + var b2 = { foo: '' }; + s = t; + t = s; + s = s2; + s = a2; + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + a = b; + b = a; + a = s; + a = s2; + a = a2; + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +})(SimpleTypes || (SimpleTypes = {})); +var ObjectTypes; +(function (ObjectTypes) { + var S = (function () { + function S() { + } + return S; + })(); + var T = (function () { + function T() { + } + return T; + })(); + var s; + var t; + var s2; + var t2; + var a; + var b; + var a2 = { foo: a2 }; + var b2 = { foo: b2 }; + s = t; + t = s; + s = s2; + s = a2; + s2 = t2; + t2 = s2; + s2 = t; + s2 = b; + s2 = a2; + a = b; + b = a; + a = s; + a = s2; + a = a2; + a2 = b2; + b2 = a2; + a2 = b; + a2 = t2; + a2 = t; +})(ObjectTypes || (ObjectTypes = {})); diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers.types b/tests/baselines/reference/assignmentCompatWithObjectMembers.types new file mode 100644 index 00000000000..b821fbc8608 --- /dev/null +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers.types @@ -0,0 +1,310 @@ +=== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatWithObjectMembers.ts === +// members N and M of types S and T have the same name, same accessibility, same optionality, and N is assignable M +// no errors expected + +module SimpleTypes { +>SimpleTypes : typeof SimpleTypes + + class S { foo: string; } +>S : S +>foo : string + + class T { foo: string; } +>T : T +>foo : string + + var s: S; +>s : S +>S : S + + var t: T; +>t : T +>T : T + + interface S2 { foo: string; } +>S2 : S2 +>foo : string + + interface T2 { foo: string; } +>T2 : T2 +>foo : string + + var s2: S2; +>s2 : S2 +>S2 : S2 + + var t2: T2; +>t2 : T2 +>T2 : T2 + + var a: { foo: string; } +>a : { foo: string; } +>foo : string + + var b: { foo: string; } +>b : { foo: string; } +>foo : string + + var a2 = { foo: '' }; +>a2 : { foo: string; } +>{ foo: '' } : { foo: string; } +>foo : string + + var b2 = { foo: '' }; +>b2 : { foo: string; } +>{ foo: '' } : { foo: string; } +>foo : string + + s = t; +>s = t : T +>s : S +>t : T + + t = s; +>t = s : S +>t : T +>s : S + + s = s2; +>s = s2 : S2 +>s : S +>s2 : S2 + + s = a2; +>s = a2 : { foo: string; } +>s : S +>a2 : { foo: string; } + + s2 = t2; +>s2 = t2 : T2 +>s2 : S2 +>t2 : T2 + + t2 = s2; +>t2 = s2 : S2 +>t2 : T2 +>s2 : S2 + + s2 = t; +>s2 = t : T +>s2 : S2 +>t : T + + s2 = b; +>s2 = b : { foo: string; } +>s2 : S2 +>b : { foo: string; } + + s2 = a2; +>s2 = a2 : { foo: string; } +>s2 : S2 +>a2 : { foo: string; } + + a = b; +>a = b : { foo: string; } +>a : { foo: string; } +>b : { foo: string; } + + b = a; +>b = a : { foo: string; } +>b : { foo: string; } +>a : { foo: string; } + + a = s; +>a = s : S +>a : { foo: string; } +>s : S + + a = s2; +>a = s2 : S2 +>a : { foo: string; } +>s2 : S2 + + a = a2; +>a = a2 : { foo: string; } +>a : { foo: string; } +>a2 : { foo: string; } + + a2 = b2; +>a2 = b2 : { foo: string; } +>a2 : { foo: string; } +>b2 : { foo: string; } + + b2 = a2; +>b2 = a2 : { foo: string; } +>b2 : { foo: string; } +>a2 : { foo: string; } + + a2 = b; +>a2 = b : { foo: string; } +>a2 : { foo: string; } +>b : { foo: string; } + + a2 = t2; +>a2 = t2 : T2 +>a2 : { foo: string; } +>t2 : T2 + + a2 = t; +>a2 = t : T +>a2 : { foo: string; } +>t : T +} + +module ObjectTypes { +>ObjectTypes : typeof ObjectTypes + + class S { foo: S; } +>S : S +>foo : S +>S : S + + class T { foo: T; } +>T : T +>foo : T +>T : T + + var s: S; +>s : S +>S : S + + var t: T; +>t : T +>T : T + + interface S2 { foo: S2; } +>S2 : S2 +>foo : S2 +>S2 : S2 + + interface T2 { foo: T2; } +>T2 : T2 +>foo : T2 +>T2 : T2 + + var s2: S2; +>s2 : S2 +>S2 : S2 + + var t2: T2; +>t2 : T2 +>T2 : T2 + + var a: { foo: typeof a; } +>a : { foo: any; } +>foo : { foo: any; } +>a : { foo: any; } + + var b: { foo: typeof b; } +>b : { foo: any; } +>foo : { foo: any; } +>b : { foo: any; } + + var a2 = { foo: a2 }; +>a2 : any +>{ foo: a2 } : { foo: any; } +>foo : any +>a2 : a2 + + var b2 = { foo: b2 }; +>b2 : any +>{ foo: b2 } : { foo: any; } +>foo : any +>b2 : b2 + + s = t; +>s = t : T +>s : S +>t : T + + t = s; +>t = s : S +>t : T +>s : S + + s = s2; +>s = s2 : S2 +>s : S +>s2 : S2 + + s = a2; +>s = a2 : any +>s : S +>a2 : any + + s2 = t2; +>s2 = t2 : T2 +>s2 : S2 +>t2 : T2 + + t2 = s2; +>t2 = s2 : S2 +>t2 : T2 +>s2 : S2 + + s2 = t; +>s2 = t : T +>s2 : S2 +>t : T + + s2 = b; +>s2 = b : { foo: any; } +>s2 : S2 +>b : { foo: any; } + + s2 = a2; +>s2 = a2 : any +>s2 : S2 +>a2 : any + + a = b; +>a = b : { foo: any; } +>a : { foo: any; } +>b : { foo: any; } + + b = a; +>b = a : { foo: any; } +>b : { foo: any; } +>a : { foo: any; } + + a = s; +>a = s : S +>a : { foo: any; } +>s : S + + a = s2; +>a = s2 : S2 +>a : { foo: any; } +>s2 : S2 + + a = a2; +>a = a2 : any +>a : { foo: any; } +>a2 : any + + a2 = b2; +>a2 = b2 : any +>a2 : any +>b2 : any + + b2 = a2; +>b2 = a2 : any +>b2 : any +>a2 : any + + a2 = b; +>a2 = b : { foo: any; } +>a2 : any +>b : { foo: any; } + + a2 = t2; +>a2 = t2 : T2 +>a2 : any +>t2 : T2 + + a2 = t; +>a2 = t : T +>a2 : any +>t : T + +} diff --git a/tests/baselines/reference/assignmentCompatability24.errors.txt b/tests/baselines/reference/assignmentCompatability24.errors.txt index 70a6717b9b7..a696d593e5a 100644 --- a/tests/baselines/reference/assignmentCompatability24.errors.txt +++ b/tests/baselines/reference/assignmentCompatability24.errors.txt @@ -1,12 +1,14 @@ -==== tests/cases/compiler/assignmentCompatability24.ts (1 errors) ==== +==== tests/cases/compiler/assignmentCompatability24.ts (2 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { - export var obj = function f(a: Tstring) { return a; };; + export var obj = function f(a: string) { return a; };; + ~~~~~~ +!!! Type parameter name cannot be 'string' export var __val__obj = obj; } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability24.js b/tests/baselines/reference/assignmentCompatability24.js index 7eda1e61266..3be069c17fe 100644 --- a/tests/baselines/reference/assignmentCompatability24.js +++ b/tests/baselines/reference/assignmentCompatability24.js @@ -4,7 +4,7 @@ module __test1__ { export var __val__obj4 = obj4; } module __test2__ { - export var obj = function f(a: Tstring) { return a; };; + export var obj = function f(a: string) { return a; };; export var __val__obj = obj; } __test2__.__val__obj = __test1__.__val__obj4 diff --git a/tests/baselines/reference/assignmentCompatability33.errors.txt b/tests/baselines/reference/assignmentCompatability33.errors.txt index 3f9f4716f81..d9037bbdbfe 100644 --- a/tests/baselines/reference/assignmentCompatability33.errors.txt +++ b/tests/baselines/reference/assignmentCompatability33.errors.txt @@ -1,12 +1,14 @@ -==== tests/cases/compiler/assignmentCompatability33.ts (1 errors) ==== +==== tests/cases/compiler/assignmentCompatability33.ts (2 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { - export var obj: { (a: Tstring): Tstring; }; + export var obj: { (a: string): string; }; + ~~~~~~ +!!! Type parameter name cannot be 'string' export var __val__obj = obj; } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tstring) => Tstring'. \ No newline at end of file +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: string) => string'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability33.js b/tests/baselines/reference/assignmentCompatability33.js index 80dfcfc4f7a..f14fc82d3fa 100644 --- a/tests/baselines/reference/assignmentCompatability33.js +++ b/tests/baselines/reference/assignmentCompatability33.js @@ -4,7 +4,7 @@ module __test1__ { export var __val__obj4 = obj4; } module __test2__ { - export var obj: { (a: Tstring): Tstring; }; + export var obj: { (a: string): string; }; export var __val__obj = obj; } __test2__.__val__obj = __test1__.__val__obj4 diff --git a/tests/baselines/reference/assignmentCompatability34.errors.txt b/tests/baselines/reference/assignmentCompatability34.errors.txt index 1ae98d98d37..26e92151da9 100644 --- a/tests/baselines/reference/assignmentCompatability34.errors.txt +++ b/tests/baselines/reference/assignmentCompatability34.errors.txt @@ -1,12 +1,14 @@ -==== tests/cases/compiler/assignmentCompatability34.ts (1 errors) ==== +==== tests/cases/compiler/assignmentCompatability34.ts (2 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { - export var obj: { (a:Tnumber):Tnumber;}; + export var obj: { (a:number):number;}; + ~~~~~~ +!!! Type parameter name cannot be 'number' export var __val__obj = obj; } __test2__.__val__obj = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: Tnumber) => Tnumber'. \ No newline at end of file +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type '(a: number) => number'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability34.js b/tests/baselines/reference/assignmentCompatability34.js index ab324a10396..454ec319c5c 100644 --- a/tests/baselines/reference/assignmentCompatability34.js +++ b/tests/baselines/reference/assignmentCompatability34.js @@ -4,7 +4,7 @@ module __test1__ { export var __val__obj4 = obj4; } module __test2__ { - export var obj: { (a:Tnumber):Tnumber;}; + export var obj: { (a:number):number;}; export var __val__obj = obj; } __test2__.__val__obj = __test1__.__val__obj4 diff --git a/tests/baselines/reference/assignmentCompatability37.errors.txt b/tests/baselines/reference/assignmentCompatability37.errors.txt index f097e9664d3..b08b483174a 100644 --- a/tests/baselines/reference/assignmentCompatability37.errors.txt +++ b/tests/baselines/reference/assignmentCompatability37.errors.txt @@ -1,12 +1,14 @@ -==== tests/cases/compiler/assignmentCompatability37.ts (1 errors) ==== +==== tests/cases/compiler/assignmentCompatability37.ts (2 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { - export var aa:{ new (param: Tnumber); };; + export var aa:{ new (param: number); };; + ~~~~~~ +!!! Type parameter name cannot be 'number' export var __val__aa = aa; } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tnumber) => any'. \ No newline at end of file +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: number) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability37.js b/tests/baselines/reference/assignmentCompatability37.js index 8625cae42e5..bf37f2c902e 100644 --- a/tests/baselines/reference/assignmentCompatability37.js +++ b/tests/baselines/reference/assignmentCompatability37.js @@ -4,7 +4,7 @@ module __test1__ { export var __val__obj4 = obj4; } module __test2__ { - export var aa:{ new (param: Tnumber); };; + export var aa:{ new (param: number); };; export var __val__aa = aa; } __test2__.__val__aa = __test1__.__val__obj4 diff --git a/tests/baselines/reference/assignmentCompatability38.errors.txt b/tests/baselines/reference/assignmentCompatability38.errors.txt index 9efa19b0338..f915afa52a8 100644 --- a/tests/baselines/reference/assignmentCompatability38.errors.txt +++ b/tests/baselines/reference/assignmentCompatability38.errors.txt @@ -1,12 +1,14 @@ -==== tests/cases/compiler/assignmentCompatability38.ts (1 errors) ==== +==== tests/cases/compiler/assignmentCompatability38.ts (2 errors) ==== module __test1__ { export interface interfaceWithPublicAndOptional { one: T; two?: U; }; var obj4: interfaceWithPublicAndOptional = { one: 1 };; export var __val__obj4 = obj4; } module __test2__ { - export var aa:{ new (param: Tstring); };; + export var aa:{ new (param: string); };; + ~~~~~~ +!!! Type parameter name cannot be 'string' export var __val__aa = aa; } __test2__.__val__aa = __test1__.__val__obj4 ~~~~~~~~~~~~~~~~~~~ -!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: Tstring) => any'. \ No newline at end of file +!!! Type 'interfaceWithPublicAndOptional' is not assignable to type 'new (param: string) => any'. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentCompatability38.js b/tests/baselines/reference/assignmentCompatability38.js index 22096b68f25..ba1c5c3c5d1 100644 --- a/tests/baselines/reference/assignmentCompatability38.js +++ b/tests/baselines/reference/assignmentCompatability38.js @@ -4,7 +4,7 @@ module __test1__ { export var __val__obj4 = obj4; } module __test2__ { - export var aa:{ new (param: Tstring); };; + export var aa:{ new (param: string); };; export var __val__aa = aa; } __test2__.__val__aa = __test1__.__val__obj4 diff --git a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.types b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.types index fab8e2baae6..1a8f0e6bfd2 100644 --- a/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.types +++ b/tests/baselines/reference/assignmentCompatibilityForConstrainedTypeParameters.types @@ -1,6 +1,6 @@ === tests/cases/compiler/assignmentCompatibilityForConstrainedTypeParameters.ts === function foo() { ->foo : () => void +>foo : typeof foo >T : T >bar : string diff --git a/tests/baselines/reference/assignmentLHSIsReference.types b/tests/baselines/reference/assignmentLHSIsReference.types index 0d7bfad3f06..c5dc4813a5d 100644 --- a/tests/baselines/reference/assignmentLHSIsReference.types +++ b/tests/baselines/reference/assignmentLHSIsReference.types @@ -12,7 +12,7 @@ x1 = value; >value : any function fn1(x2: number) { ->fn1 : (x2: number) => void +>fn1 : typeof fn1 >x2 : number x2 = value; @@ -47,7 +47,7 @@ x3['a'] = value; >value : any function fn2(x4: number) { ->fn2 : (x4: number) => void +>fn2 : typeof fn2 >x4 : number (x4) = value; diff --git a/tests/baselines/reference/augmentArray.js b/tests/baselines/reference/augmentArray.js deleted file mode 100644 index 948f1944048..00000000000 --- a/tests/baselines/reference/augmentArray.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [augmentArray.ts] -interface Array { - (): any[]; -} - -//// [augmentArray.js] diff --git a/tests/baselines/reference/augmentArray.types b/tests/baselines/reference/augmentArray.types deleted file mode 100644 index 31f7e11edca..00000000000 --- a/tests/baselines/reference/augmentArray.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/compiler/augmentArray.ts === -interface Array { ->Array : T[] ->T : T - - (): any[]; -} diff --git a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js deleted file mode 100644 index 27b56e4ff88..00000000000 --- a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [autoAsiForStaticsInClassDeclaration.ts] -class C { - static x - static y -} - -//// [autoAsiForStaticsInClassDeclaration.js] -var C = (function () { - function C() { - } - return C; -})(); diff --git a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.types b/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.types deleted file mode 100644 index d902f0b3eaa..00000000000 --- a/tests/baselines/reference/autoAsiForStaticsInClassDeclaration.types +++ /dev/null @@ -1,10 +0,0 @@ -=== tests/cases/compiler/autoAsiForStaticsInClassDeclaration.ts === -class C { ->C : C - - static x ->x : any - - static y ->y : any -} diff --git a/tests/baselines/reference/avoid.types b/tests/baselines/reference/avoid.types index 853d93bdd79..23e78f37613 100644 --- a/tests/baselines/reference/avoid.types +++ b/tests/baselines/reference/avoid.types @@ -1,6 +1,6 @@ === tests/cases/compiler/avoid.ts === function f() { ->f : () => void +>f : typeof f var x=1; >x : number @@ -9,12 +9,12 @@ function f() { var y=f(); // error void fn >y : void >f() : void ->f : () => void +>f : typeof f var why:any=f(); // error void fn >why : any >f() : void ->f : () => void +>f : typeof f var w:any; >w : any @@ -23,7 +23,7 @@ w=f(); // error void fn >w=f() : void >w : any >f() : void ->f : () => void +>f : typeof f class C { >C : C @@ -45,6 +45,6 @@ var z=new C().g(); // error void fn var N=new f(); // ok with void fn >N : any >new f() : any ->f : () => void +>f : typeof f diff --git a/tests/baselines/reference/badArraySyntax.errors.txt b/tests/baselines/reference/badArraySyntax.errors.txt index 9c1edf93231..a38f9918197 100644 --- a/tests/baselines/reference/badArraySyntax.errors.txt +++ b/tests/baselines/reference/badArraySyntax.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/compiler/badArraySyntax.ts (6 errors) ==== +==== tests/cases/compiler/badArraySyntax.ts (4 errors) ==== class Z { public x = ""; } @@ -16,9 +16,5 @@ var a5: Z[] = new Z[](); ~~ !!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. - var a6: Z[][] = new Z [ ] [ ]; - ~~~~~~~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. - ~~~~ -!!! 'new T[]' cannot be used to create an array. Use 'new Array()' instead. + \ No newline at end of file diff --git a/tests/baselines/reference/badOverloadError.types b/tests/baselines/reference/badOverloadError.types index 837eb5c5c83..8777296d798 100644 --- a/tests/baselines/reference/badOverloadError.types +++ b/tests/baselines/reference/badOverloadError.types @@ -1,6 +1,6 @@ === tests/cases/compiler/badOverloadError.ts === function method() { ->method : () => void +>method : typeof method var dictionary = <{ [index: string]: string; }>{}; >dictionary : { [x: string]: string; } diff --git a/tests/baselines/reference/badThisBinding.types b/tests/baselines/reference/badThisBinding.types index 852fb02f58e..5b95cc95ba0 100644 --- a/tests/baselines/reference/badThisBinding.types +++ b/tests/baselines/reference/badThisBinding.types @@ -1,10 +1,10 @@ === tests/cases/compiler/badThisBinding.ts === declare function foo(a:any): any; ->foo : (a: any) => any +>foo : typeof foo >a : any declare function bar(a:any): any; ->bar : (a: any) => any +>bar : typeof bar >a : any class Greeter { @@ -12,26 +12,14 @@ class Greeter { constructor() { foo(() => { ->foo(() => { - bar(() => { - var x = this; - }); - }) : any ->foo : (a: any) => any ->() => { - bar(() => { - var x = this; - }); - } : () => void +>foo(() => { bar(() => { var x = this; }); }) : any +>foo : typeof foo +>() => { bar(() => { var x = this; }); } : () => void bar(() => { ->bar(() => { - var x = this; - }) : any ->bar : (a: any) => any ->() => { - var x = this; - } : () => void +>bar(() => { var x = this; }) : any +>bar : typeof bar +>() => { var x = this; } : () => void var x = this; >x : Greeter diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types index 3deeae69bbe..ae9f7c59765 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.types @@ -102,7 +102,7 @@ var r11 = true ? base : derived2; >derived2 : Derived2 function foo5(t: T, u: U): Object { ->foo5 : (t: T, u: U) => Object +>foo5 : typeof foo5 >T : T >U : U >t : T diff --git a/tests/baselines/reference/bestCommonTypeReturnStatement.types b/tests/baselines/reference/bestCommonTypeReturnStatement.types index 3c260ea709b..ce360a92ccf 100644 --- a/tests/baselines/reference/bestCommonTypeReturnStatement.types +++ b/tests/baselines/reference/bestCommonTypeReturnStatement.types @@ -14,23 +14,23 @@ interface IPromise { } function f() { ->f : () => IPromise +>f : typeof f if (true) return b(); >b() : IPromise ->b : () => IPromise +>b : typeof b return d(); >d() : IPromise ->d : () => IPromise +>d : typeof d } function b(): IPromise { return null; } ->b : () => IPromise +>b : typeof b >IPromise : IPromise function d(): IPromise { return null; } ->d : () => IPromise +>d : typeof d >IPromise : IPromise diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types index ce870dbc818..94c056cf77c 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types @@ -4,7 +4,7 @@ var BOOLEAN: boolean; >BOOLEAN : boolean function foo(): boolean { return true; } ->foo : () => boolean +>foo : typeof foo class A { >A : A @@ -13,7 +13,7 @@ class A { >a : boolean static foo() { return false; } ->foo : () => boolean +>foo : typeof foo } module M { >M : typeof M @@ -64,15 +64,15 @@ var ResultIsNumber6 = ~foo(); >ResultIsNumber6 : number >~foo() : number >foo() : boolean ->foo : () => boolean +>foo : typeof foo var ResultIsNumber7 = ~A.foo(); >ResultIsNumber7 : number >~A.foo() : number >A.foo() : boolean ->A.foo : () => boolean +>A.foo : typeof foo >A : typeof A ->foo : () => boolean +>foo : typeof foo // multiple ~ operators var ResultIsNumber8 = ~~BOOLEAN; @@ -92,7 +92,7 @@ var ResultIsNumber8 = ~~BOOLEAN; ~foo(); >~foo() : number >foo() : boolean ->foo : () => boolean +>foo : typeof foo ~true, false; >~true, false : boolean diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types index 94207a56343..18b22db036c 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types @@ -8,7 +8,7 @@ var NUMBER1: number[] = [1, 2]; >[1, 2] : number[] function foo(): number { return 1; } ->foo : () => number +>foo : typeof foo class A { >A : A @@ -17,7 +17,7 @@ class A { >a : number static foo() { return 1; } ->foo : () => number +>foo : typeof foo } module M { >M : typeof M @@ -89,15 +89,15 @@ var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number >~foo() : number >foo() : number ->foo : () => number +>foo : typeof foo var ResultIsNumber10 = ~A.foo(); >ResultIsNumber10 : number >~A.foo() : number >A.foo() : number ->A.foo : () => number +>A.foo : typeof foo >A : typeof A ->foo : () => number +>foo : typeof foo var ResultIsNumber11 = ~(NUMBER + NUMBER); >ResultIsNumber11 : number @@ -136,7 +136,7 @@ var ResultIsNumber13 = ~~~(NUMBER + NUMBER); ~foo(); >~foo() : number >foo() : number ->foo : () => number +>foo : typeof foo ~objA.a; >~objA.a : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types index dbe2f29631e..d7c65a478fc 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types @@ -8,7 +8,7 @@ var STRING1: string[] = ["", "abc"]; >["", "abc"] : string[] function foo(): string { return "abc"; } ->foo : () => string +>foo : typeof foo class A { >A : A @@ -17,7 +17,7 @@ class A { >a : string static foo() { return ""; } ->foo : () => string +>foo : typeof foo } module M { >M : typeof M @@ -89,15 +89,15 @@ var ResultIsNumber9 = ~foo(); >ResultIsNumber9 : number >~foo() : number >foo() : string ->foo : () => string +>foo : typeof foo var ResultIsNumber10 = ~A.foo(); >ResultIsNumber10 : number >~A.foo() : number >A.foo() : string ->A.foo : () => string +>A.foo : typeof foo >A : typeof A ->foo : () => string +>foo : typeof foo var ResultIsNumber11 = ~(STRING + STRING); >ResultIsNumber11 : number @@ -144,7 +144,7 @@ var ResultIsNumber14 = ~~~(STRING + STRING); ~foo(); >~foo() : number >foo() : string ->foo : () => string +>foo : typeof foo ~objA.a,M.n; >~objA.a,M.n : string diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.js b/tests/baselines/reference/breakInIterationOrSwitchStatement1.js new file mode 100644 index 00000000000..0a3de64c675 --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.js @@ -0,0 +1,9 @@ +//// [breakInIterationOrSwitchStatement1.ts] +while (true) { + break; +} + +//// [breakInIterationOrSwitchStatement1.js] +while (true) { + break; +} diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement1.types b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types new file mode 100644 index 00000000000..6a2bae2c2c4 --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement1.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/breakInIterationOrSwitchStatement1.ts === +while (true) { +No type information for this code. break; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.js b/tests/baselines/reference/breakInIterationOrSwitchStatement2.js new file mode 100644 index 00000000000..903bed733db --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.js @@ -0,0 +1,10 @@ +//// [breakInIterationOrSwitchStatement2.ts] +do { + break; +} +while (true); + +//// [breakInIterationOrSwitchStatement2.js] +do { + break; +} while (true); diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement2.types b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types new file mode 100644 index 00000000000..0f8928a664d --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement2.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/breakInIterationOrSwitchStatement2.ts === +do { +No type information for this code. break; +No type information for this code.} +No type information for this code.while (true); +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement3.js b/tests/baselines/reference/breakInIterationOrSwitchStatement3.js new file mode 100644 index 00000000000..dfadaf03182 --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement3.js @@ -0,0 +1,9 @@ +//// [breakInIterationOrSwitchStatement3.ts] +for (;;) { + break; +} + +//// [breakInIterationOrSwitchStatement3.js] +for (;;) { + break; +} diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement3.types b/tests/baselines/reference/breakInIterationOrSwitchStatement3.types new file mode 100644 index 00000000000..5676b2deccd --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement3.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/breakInIterationOrSwitchStatement3.ts === +for (;;) { +No type information for this code. break; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt b/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt new file mode 100644 index 00000000000..667108c902d --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement4.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/breakInIterationOrSwitchStatement4.ts (1 errors) ==== + for (var i in something) { + ~~~~~~~~~ +!!! Cannot find name 'something'. + break; + } \ No newline at end of file diff --git a/tests/baselines/reference/breakInIterationOrSwitchStatement4.js b/tests/baselines/reference/breakInIterationOrSwitchStatement4.js new file mode 100644 index 00000000000..ef1978666e2 --- /dev/null +++ b/tests/baselines/reference/breakInIterationOrSwitchStatement4.js @@ -0,0 +1,9 @@ +//// [breakInIterationOrSwitchStatement4.ts] +for (var i in something) { + break; +} + +//// [breakInIterationOrSwitchStatement4.js] +for (var i in something) { + break; +} diff --git a/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.errors.txt b/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.errors.txt new file mode 100644 index 00000000000..6220fd09e9d --- /dev/null +++ b/tests/baselines/reference/breakNotInIterationOrSwitchStatement1.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/breakNotInIterationOrSwitchStatement1.ts (1 errors) ==== + break; + ~~~~~~ +!!! A 'break' statement can only be used within an enclosing iteration or switch statement. \ No newline at end of file diff --git a/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.errors.txt b/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.errors.txt new file mode 100644 index 00000000000..e34345f8e8c --- /dev/null +++ b/tests/baselines/reference/breakNotInIterationOrSwitchStatement2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/breakNotInIterationOrSwitchStatement2.ts (1 errors) ==== + while (true) { + function f() { + break; + ~~~~~~ +!!! Jump target cannot cross function boundary. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget1.js b/tests/baselines/reference/breakTarget1.js new file mode 100644 index 00000000000..5283dfe1911 --- /dev/null +++ b/tests/baselines/reference/breakTarget1.js @@ -0,0 +1,6 @@ +//// [breakTarget1.ts] +target: + break target; + +//// [breakTarget1.js] +target: break target; diff --git a/tests/baselines/reference/breakTarget1.types b/tests/baselines/reference/breakTarget1.types new file mode 100644 index 00000000000..eda3b1cac35 --- /dev/null +++ b/tests/baselines/reference/breakTarget1.types @@ -0,0 +1,4 @@ +=== tests/cases/compiler/breakTarget1.ts === +target: +No type information for this code. break target; +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget2.js b/tests/baselines/reference/breakTarget2.js new file mode 100644 index 00000000000..9ca050c18e5 --- /dev/null +++ b/tests/baselines/reference/breakTarget2.js @@ -0,0 +1,10 @@ +//// [breakTarget2.ts] +target: +while (true) { + break target; +} + +//// [breakTarget2.js] +target: while (true) { + break target; +} diff --git a/tests/baselines/reference/breakTarget2.types b/tests/baselines/reference/breakTarget2.types new file mode 100644 index 00000000000..6357695785b --- /dev/null +++ b/tests/baselines/reference/breakTarget2.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/breakTarget2.ts === +target: +No type information for this code.while (true) { +No type information for this code. break target; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget3.js b/tests/baselines/reference/breakTarget3.js new file mode 100644 index 00000000000..0fa6cd2d298 --- /dev/null +++ b/tests/baselines/reference/breakTarget3.js @@ -0,0 +1,11 @@ +//// [breakTarget3.ts] +target1: +target2: +while (true) { + break target1; +} + +//// [breakTarget3.js] +target1: target2: while (true) { + break target1; +} diff --git a/tests/baselines/reference/breakTarget3.types b/tests/baselines/reference/breakTarget3.types new file mode 100644 index 00000000000..580706bbd4a --- /dev/null +++ b/tests/baselines/reference/breakTarget3.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/breakTarget3.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget4.js b/tests/baselines/reference/breakTarget4.js new file mode 100644 index 00000000000..4586301d71b --- /dev/null +++ b/tests/baselines/reference/breakTarget4.js @@ -0,0 +1,11 @@ +//// [breakTarget4.ts] +target1: +target2: +while (true) { + break target2; +} + +//// [breakTarget4.js] +target1: target2: while (true) { + break target2; +} diff --git a/tests/baselines/reference/breakTarget4.types b/tests/baselines/reference/breakTarget4.types new file mode 100644 index 00000000000..aba35ddcfdf --- /dev/null +++ b/tests/baselines/reference/breakTarget4.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/breakTarget4.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. break target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget5.errors.txt b/tests/baselines/reference/breakTarget5.errors.txt new file mode 100644 index 00000000000..a9b3932bcbb --- /dev/null +++ b/tests/baselines/reference/breakTarget5.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/breakTarget5.ts (1 errors) ==== + target: + while (true) { + function f() { + while (true) { + break target; + ~~~~~~~~~~~~~ +!!! Jump target cannot cross function boundary. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/breakTarget6.errors.txt b/tests/baselines/reference/breakTarget6.errors.txt new file mode 100644 index 00000000000..3a921bc6d36 --- /dev/null +++ b/tests/baselines/reference/breakTarget6.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/breakTarget6.ts (1 errors) ==== + while (true) { + break target; + ~~~~~~~~~~~~~ +!!! A 'break' statement can only jump to a label of an enclosing statement. + } \ No newline at end of file diff --git a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types index 34de901e3c0..f2ac424455b 100644 --- a/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types +++ b/tests/baselines/reference/callGenericFunctionWithZeroTypeArguments.types @@ -2,7 +2,7 @@ // valid invocations of generic functions with no explicit type arguments provided function f(x: T): T { return null; } ->f : (x: T) => T +>f : typeof f >T : T >x : T >T : T @@ -11,7 +11,7 @@ function f(x: T): T { return null; } var r = f(1); >r : number >f(1) : number ->f : (x: T) => T +>f : typeof f var f2 = (x: T): T => { return null; } >f2 : (x: T) => T diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types index b8b608762f5..08288f53f7e 100644 --- a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.types @@ -2,13 +2,13 @@ // Call signatures without a return type annotation and function body return 'any' function foo(x) { } ->foo : (x: any) => void +>foo : typeof foo >x : any var r = foo(1); // void since there's a body >r : void >foo(1) : void ->foo : (x: any) => void +>foo : typeof foo interface I { >I : I diff --git a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types index 2bb38c096f6..5a171809e40 100644 --- a/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types +++ b/tests/baselines/reference/callSignatureWithoutReturnTypeAnnotationInference.types @@ -3,7 +3,7 @@ // Simple types function foo(x) { ->foo : (x: any) => number +>foo : typeof foo >x : any return 1; @@ -11,36 +11,36 @@ function foo(x) { var r = foo(1); >r : number >foo(1) : number ->foo : (x: any) => number +>foo : typeof foo function foo2(x) { ->foo2 : (x: any) => number +>foo2 : typeof foo2 >x : any return foo(x); >foo(x) : number ->foo : (x: any) => number +>foo : typeof foo >x : any } var r2 = foo2(1); >r2 : number >foo2(1) : number ->foo2 : (x: any) => number +>foo2 : typeof foo2 function foo3() { ->foo3 : () => any +>foo3 : typeof foo3 return foo3(); >foo3() : any ->foo3 : () => any +>foo3 : typeof foo3 } var r3 = foo3(); >r3 : any >foo3() : any ->foo3 : () => any +>foo3 : typeof foo3 function foo4(x: T) { ->foo4 : (x: T) => T +>foo4 : typeof foo4 >T : T >x : T >T : T @@ -51,10 +51,10 @@ function foo4(x: T) { var r4 = foo4(1); >r4 : number >foo4(1) : number ->foo4 : (x: T) => T +>foo4 : typeof foo4 function foo5(x) { ->foo5 : (x: any) => number +>foo5 : typeof foo5 >x : any if (true) { @@ -66,10 +66,10 @@ function foo5(x) { var r5 = foo5(1); >r5 : number >foo5(1) : number ->foo5 : (x: any) => number +>foo5 : typeof foo5 function foo6(x) { ->foo6 : (x: any) => any[] +>foo6 : typeof foo6 >x : any try { @@ -88,10 +88,10 @@ function foo6(x) { var r6 = foo6(1); >r6 : any[] >foo6(1) : any[] ->foo6 : (x: any) => any[] +>foo6 : typeof foo6 function foo7(x) { ->foo7 : (x: any) => string +>foo7 : typeof foo7 >x : any return typeof x; @@ -101,11 +101,11 @@ function foo7(x) { var r7 = foo7(1); >r7 : string >foo7(1) : string ->foo7 : (x: any) => string +>foo7 : typeof foo7 // object types function foo8(x: number) { ->foo8 : (x: number) => { x: number; } +>foo8 : typeof foo8 >x : number return { x: x }; @@ -116,7 +116,7 @@ function foo8(x: number) { var r8 = foo8(1); >r8 : { x: number; } >foo8(1) : { x: number; } ->foo8 : (x: number) => { x: number; } +>foo8 : typeof foo8 interface I { >I : I @@ -125,7 +125,7 @@ interface I { >foo : string } function foo9(x: number) { ->foo9 : (x: number) => I +>foo9 : typeof foo9 >x : number var i: I; @@ -138,7 +138,7 @@ function foo9(x: number) { var r9 = foo9(1); >r9 : I >foo9(1) : I ->foo9 : (x: number) => I +>foo9 : typeof foo9 class C { >C : C @@ -147,7 +147,7 @@ class C { >foo : string } function foo10(x: number) { ->foo10 : (x: number) => C +>foo10 : typeof foo10 >x : number var c: C; @@ -160,7 +160,7 @@ function foo10(x: number) { var r10 = foo10(1); >r10 : C >foo10(1) : C ->foo10 : (x: number) => C +>foo10 : typeof foo10 module M { >M : typeof M @@ -173,7 +173,7 @@ module M { >foo : string } function foo11() { ->foo11 : () => typeof M +>foo11 : typeof foo11 return M; >M : typeof M @@ -181,7 +181,7 @@ function foo11() { var r11 = foo11(); >r11 : typeof M >foo11() : typeof M ->foo11 : () => typeof M +>foo11 : typeof foo11 // merged declarations interface I2 { @@ -197,7 +197,7 @@ interface I2 { >y : number } function foo12() { ->foo12 : () => I2 +>foo12 : typeof foo12 var i2: I2; >i2 : I2 @@ -209,7 +209,7 @@ function foo12() { var r12 = foo12(); >r12 : I2 >foo12() : I2 ->foo12 : () => I2 +>foo12 : typeof foo12 function m1() { return 1; } >m1 : typeof m1 @@ -219,7 +219,7 @@ module m1 { export var y = 2; } >y : number function foo13() { ->foo13 : () => typeof m1 +>foo13 : typeof foo13 return m1; >m1 : typeof m1 @@ -227,7 +227,7 @@ function foo13() { var r13 = foo13(); >r13 : typeof m1 >foo13() : typeof m1 ->foo13 : () => typeof m1 +>foo13 : typeof foo13 class c1 { >c1 : c1 @@ -245,7 +245,7 @@ module c1 { >x : number } function foo14() { ->foo14 : () => typeof c1 +>foo14 : typeof foo14 return c1; >c1 : typeof c1 @@ -253,7 +253,7 @@ function foo14() { var r14 = foo14(); >r14 : typeof c1 >foo14() : typeof c1 ->foo14 : () => typeof c1 +>foo14 : typeof foo14 enum e1 { A } >e1 : e1 @@ -264,7 +264,7 @@ module e1 { export var y = 1; } >y : number function foo15() { ->foo15 : () => typeof e1 +>foo15 : typeof foo15 return e1; >e1 : typeof e1 @@ -272,5 +272,5 @@ function foo15() { var r15 = foo15(); >r15 : typeof e1 >foo15() : typeof e1 ->foo15 : () => typeof e1 +>foo15 : typeof foo15 diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters.types b/tests/baselines/reference/callSignaturesWithOptionalParameters.types index b38b5687ed4..199d458983c 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters.types @@ -2,7 +2,7 @@ // Optional parameters should be valid in all the below casts function foo(x?: number) { } ->foo : (x?: number) => void +>foo : typeof foo >x : number var f = function foo(x?: number) { } @@ -19,11 +19,11 @@ var f2 = (x: number, y?: number) => { } foo(1); >foo(1) : void ->foo : (x?: number) => void +>foo : typeof foo foo(); >foo() : void ->foo : (x?: number) => void +>foo : typeof foo f(1); >f(1) : void @@ -134,11 +134,7 @@ a.foo(1); var b = { >b : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } ->{ - foo(x?: number) { }, - a: function foo(x: number, y?: number) { }, - b: (x?: number) => { } -} : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } +>{ foo(x?: number) { }, a: function foo(x: number, y?: number) { }, b: (x?: number) => { }} : { foo: (x?: number) => void; a: (x: number, y?: number) => void; b: (x?: number) => void; } foo(x?: number) { }, >foo : (x?: number) => void diff --git a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types index 602edd911fe..c13942a5c70 100644 --- a/tests/baselines/reference/callSignaturesWithOptionalParameters2.types +++ b/tests/baselines/reference/callSignaturesWithOptionalParameters2.types @@ -2,42 +2,42 @@ // Optional parameters should be valid in all the below casts function foo(x?: number); ->foo : (x?: number) => any +>foo : typeof foo >x : number function foo(x?: number) { } ->foo : (x?: number) => any +>foo : typeof foo >x : number foo(1); >foo(1) : any ->foo : (x?: number) => any +>foo : typeof foo foo(); >foo() : any ->foo : (x?: number) => any +>foo : typeof foo function foo2(x: number); ->foo2 : { (x: number): any; (x: number, y?: number): any; } +>foo2 : typeof foo2 >x : number function foo2(x: number, y?: number); ->foo2 : { (x: number): any; (x: number, y?: number): any; } +>foo2 : typeof foo2 >x : number >y : number function foo2(x: number, y?: number) { } ->foo2 : { (x: number): any; (x: number, y?: number): any; } +>foo2 : typeof foo2 >x : number >y : number foo2(1); >foo2(1) : any ->foo2 : { (x: number): any; (x: number, y?: number): any; } +>foo2 : typeof foo2 foo2(1, 2); >foo2(1, 2) : any ->foo2 : { (x: number): any; (x: number, y?: number): any; } +>foo2 : typeof foo2 class C { >C : C diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js deleted file mode 100644 index 3f60fcd3cb1..00000000000 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ /dev/null @@ -1,32 +0,0 @@ -//// [captureThisInSuperCall.ts] -class A { - constructor(p:any) {} -} - -class B extends A { - constructor() { super({ test: () => this.someMethod()}); } - someMethod() {} -} - -//// [captureThisInSuperCall.js] -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var A = (function () { - function A(p) { - } - return A; -})(); -var B = (function (_super) { - __extends(B, _super); - function B() { - var _this = this; - _super.call(this, { test: function () { return _this.someMethod(); } }); - } - B.prototype.someMethod = function () { - }; - return B; -})(A); diff --git a/tests/baselines/reference/captureThisInSuperCall.types b/tests/baselines/reference/captureThisInSuperCall.types deleted file mode 100644 index dc11b56ada2..00000000000 --- a/tests/baselines/reference/captureThisInSuperCall.types +++ /dev/null @@ -1,25 +0,0 @@ -=== tests/cases/compiler/captureThisInSuperCall.ts === -class A { ->A : A - - constructor(p:any) {} ->p : any -} - -class B extends A { ->B : B ->A : A - - constructor() { super({ test: () => this.someMethod()}); } ->super({ test: () => this.someMethod()}) : void ->{ test: () => this.someMethod()} : { test: () => void; } ->test : () => void ->() => this.someMethod() : () => void ->this.someMethod() : void ->this.someMethod : () => void ->this : B ->someMethod : () => void - - someMethod() {} ->someMethod : () => void -} diff --git a/tests/baselines/reference/castExpressionParentheses.errors.txt b/tests/baselines/reference/castExpressionParentheses.errors.txt new file mode 100644 index 00000000000..acb0f057f9a --- /dev/null +++ b/tests/baselines/reference/castExpressionParentheses.errors.txt @@ -0,0 +1,42 @@ +==== tests/cases/compiler/castExpressionParentheses.ts (1 errors) ==== + declare var a; + + // parentheses should be omitted + // literals + ({a:0}); + ([1,3,]); + ("string"); + (23.0); + (/regexp/g); + (false); + (true); + (null); + // names and dotted names + (this); + (this.x); + ((a).x); + (a); + (a[0]); + (a.b["0"]); + (a()).x; + + declare var A; + + // should keep the parentheses in emit + (new A).foo; + (typeof A).x; + (-A).x; + new (A()); + (()=> {})(); + ~~~ +!!! Type parameter name cannot be 'any' + (function foo() { })(); + (-A).x; + + // nested cast, should keep one pair of parenthese + ((-A)).x; + + // nested parenthesized expression, should keep one pair of parenthese + ((A)) + + \ No newline at end of file diff --git a/tests/baselines/reference/castExpressionParentheses.js b/tests/baselines/reference/castExpressionParentheses.js index 2f62d6e9447..f400d647a94 100644 --- a/tests/baselines/reference/castExpressionParentheses.js +++ b/tests/baselines/reference/castExpressionParentheses.js @@ -27,7 +27,7 @@ declare var A; (typeof A).x; (-A).x; new (A()); -(()=> {})(); +(()=> {})(); (function foo() { })(); (-A).x; diff --git a/tests/baselines/reference/castExpressionParentheses.types b/tests/baselines/reference/castExpressionParentheses.types deleted file mode 100644 index 590c23b048f..00000000000 --- a/tests/baselines/reference/castExpressionParentheses.types +++ /dev/null @@ -1,170 +0,0 @@ -=== tests/cases/compiler/castExpressionParentheses.ts === -declare var a; ->a : any - -// parentheses should be omitted -// literals -({a:0}); ->({a:0}) : any ->{a:0} : any ->{a:0} : { a: number; } ->a : number - -([1,3,]); ->([1,3,]) : any ->[1,3,] : any ->[1,3,] : number[] - -("string"); ->("string") : any ->"string" : any - -(23.0); ->(23.0) : any ->23.0 : any - -(/regexp/g); ->(/regexp/g) : any ->/regexp/g : any ->/regexp/g : RegExp - -(false); ->(false) : any ->false : any - -(true); ->(true) : any ->true : any - -(null); ->(null) : any ->null : any - -// names and dotted names -(this); ->(this) : any ->this : any ->this : any - -(this.x); ->(this.x) : any ->this.x : any ->this.x : any ->this : any ->x : any - -((a).x); ->((a).x) : any ->(a).x : any ->(a).x : any ->(a) : any ->a : any ->a : any ->x : any - -(a); ->(a) : any ->a : any ->a : any ->a : any - -(a[0]); ->(a[0]) : any ->a[0] : any ->a[0] : any ->a : any - -(a.b["0"]); ->(a.b["0"]) : any ->a.b["0"] : any ->a.b["0"] : any ->a.b : any ->a : any ->b : any - -(a()).x; ->(a()).x : any ->(a()) : any ->a() : any ->a() : any ->a : any ->x : any - -declare var A; ->A : any - -// should keep the parentheses in emit -(new A).foo; ->(new A).foo : any ->(new A) : any ->new A : any ->new A : any ->A : any ->foo : any - -(typeof A).x; ->(typeof A).x : any ->(typeof A) : any ->typeof A : any ->typeof A : string ->A : any ->x : any - -(-A).x; ->(-A).x : any ->(-A) : any ->-A : any ->-A : number ->A : any ->x : any - -new (A()); ->new (A()) : any ->(A()) : any ->A() : any ->A() : any ->A : any - -(()=> {})(); ->(()=> {})() : void ->(()=> {}) : () => void ->()=> {} : () => void ->Tany : Tany - -(function foo() { })(); ->(function foo() { })() : any ->(function foo() { }) : any ->function foo() { } : any ->function foo() { } : () => void ->foo : () => void - -(-A).x; ->(-A).x : any ->(-A) : any ->-A : any ->-A : number ->-A : any ->-A : number ->A : any ->x : any - -// nested cast, should keep one pair of parenthese -((-A)).x; ->((-A)).x : any ->((-A)) : any ->(-A) : any ->(-A) : number ->(-A) : any ->-A : any ->-A : number ->A : any ->x : any - -// nested parenthesized expression, should keep one pair of parenthese -((A)) ->((A)) : any ->(A) : any ->(A) : any ->A : any - - diff --git a/tests/baselines/reference/castTest.types b/tests/baselines/reference/castTest.types index 42a721d8fff..501ff5a3cbe 100644 --- a/tests/baselines/reference/castTest.types +++ b/tests/baselines/reference/castTest.types @@ -63,31 +63,10 @@ declare class Point 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 +> ({ 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: any, dy: any) => Point; mult: (p: any) => any; } ->{ - 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: any, dy: any) => Point; mult: (p: any) => any; } +>({ 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: any, dy: any) => Point; mult: (p: any) => any; } +>{ 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: any, dy: any) => Point; mult: (p: any) => any; } x: 0, >x : number @@ -97,9 +76,7 @@ var p_cast = ({ add: function(dx, dy) { >add : (dx: any, dy: any) => Point ->function(dx, dy) { - return new Point(this.x + dx, this.y + dy); - } : (dx: any, dy: any) => Point +>function(dx, dy) { return new Point(this.x + dx, this.y + dy); } : (dx: any, dy: any) => Point >dx : any >dy : any diff --git a/tests/baselines/reference/catch.types b/tests/baselines/reference/catch.types index bb0b2adbefe..2caa04d8697 100644 --- a/tests/baselines/reference/catch.types +++ b/tests/baselines/reference/catch.types @@ -1,6 +1,6 @@ === tests/cases/compiler/catch.ts === function f() { ->f : () => void +>f : typeof f try {} catch(e) { } >e : any diff --git a/tests/baselines/reference/cf.types b/tests/baselines/reference/cf.types index 62dcba0ba9a..df7dc12ce31 100644 --- a/tests/baselines/reference/cf.types +++ b/tests/baselines/reference/cf.types @@ -1,6 +1,6 @@ === tests/cases/compiler/cf.ts === function f() { ->f : () => void +>f : typeof f var z; >z : any diff --git a/tests/baselines/reference/chainedImportAlias.js b/tests/baselines/reference/chainedImportAlias.js index 6149105bce0..cbc1e82b45a 100644 --- a/tests/baselines/reference/chainedImportAlias.js +++ b/tests/baselines/reference/chainedImportAlias.js @@ -6,19 +6,15 @@ export module m { } //// [chainedImportAlias_file1.ts] -import x = require('chainedImportAlias_file0'); +import x = require('chainedImportAlias_file1'); import y = x; -y.m.foo(); +declare var console: { + log(message?: any); +}; +console.log(y); -//// [chainedImportAlias_file0.js] -(function (m) { - function foo() { - } - m.foo = foo; -})(exports.m || (exports.m = {})); -var m = exports.m; //// [chainedImportAlias_file1.js] -var x = require('chainedImportAlias_file0'); +var x = require('chainedImportAlias_file1'); var y = x; -y.m.foo(); +console.log(y); diff --git a/tests/baselines/reference/chainedImportAlias.types b/tests/baselines/reference/chainedImportAlias.types index 4a94cf6867e..463b49a14aa 100644 --- a/tests/baselines/reference/chainedImportAlias.types +++ b/tests/baselines/reference/chainedImportAlias.types @@ -1,24 +1,23 @@ === tests/cases/compiler/chainedImportAlias_file1.ts === -import x = require('chainedImportAlias_file0'); ->x : typeof "tests/cases/compiler/chainedImportAlias_file0" +import x = require('chainedImportAlias_file1'); +>x : typeof "tests/cases/compiler/chainedImportAlias_file1" import y = x; ->y : typeof "tests/cases/compiler/chainedImportAlias_file0" ->x : typeof "tests/cases/compiler/chainedImportAlias_file0" +>y : typeof "tests/cases/compiler/chainedImportAlias_file1" +>x : typeof "tests/cases/compiler/chainedImportAlias_file1" -y.m.foo(); ->y.m.foo() : void ->y.m.foo : () => void ->y.m : typeof m ->y : typeof "tests/cases/compiler/chainedImportAlias_file0" ->m : typeof m ->foo : () => void +declare var console: { +>console : { log(message?: any): any; } -=== tests/cases/compiler/chainedImportAlias_file0.ts === -export module m { ->m : typeof m + log(message?: any); +>log : (message?: any) => any +>message : any - export function foo() { } ->foo : () => void -} +}; +console.log(y); +>console.log(y) : any +>console.log : (message?: any) => any +>console : { log(message?: any): any; } +>log : (message?: any) => any +>y : typeof "tests/cases/compiler/chainedImportAlias_file1" diff --git a/tests/baselines/reference/classExtendingClass.types b/tests/baselines/reference/classExtendingClass.types index 7eaaaecf17f..19c73a2b9db 100644 --- a/tests/baselines/reference/classExtendingClass.types +++ b/tests/baselines/reference/classExtendingClass.types @@ -9,7 +9,7 @@ class C { >thing : () => void static other() { } ->other : () => void +>other : typeof other } class D extends C { @@ -46,9 +46,9 @@ var r3 = d.thing(); var r4 = D.other(); >r4 : void >D.other() : void ->D.other : () => void +>D.other : typeof other >D : typeof D ->other : () => void +>other : typeof other class C2 { >C2 : C2 @@ -64,7 +64,7 @@ class C2 { >T : T static other(x: T) { } ->other : (x: T) => void +>other : typeof other >T : T >x : T >T : T @@ -106,7 +106,7 @@ var r7 = d2.thing(''); var r8 = D2.other(1); >r8 : void >D2.other(1) : void ->D2.other : (x: T) => void +>D2.other : typeof other >D2 : typeof D2 ->other : (x: T) => void +>other : typeof other diff --git a/tests/baselines/reference/classExtendingPrimitive2.errors.txt b/tests/baselines/reference/classExtendingPrimitive2.errors.txt deleted file mode 100644 index 9d1f62d5350..00000000000 --- a/tests/baselines/reference/classExtendingPrimitive2.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts (3 errors) ==== - // classes cannot extend primitives - - class C4a extends void {} - ~~~~ -!!! Identifier expected. - class C5a extends null { } - ~~~~ -!!! Identifier expected. - ~ -!!! ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt b/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt deleted file mode 100644 index 7a5573ae000..00000000000 --- a/tests/baselines/reference/classExtendsEveryObjectType2.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ==== - class C2 extends { foo: string; } { } // error - ~ -!!! Identifier expected. - - class C6 extends []{ } // error - ~ -!!! Identifier expected. - ~ -!!! ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/classImplementsImportedInterface.js b/tests/baselines/reference/classImplementsImportedInterface.js deleted file mode 100644 index c76a026b58a..00000000000 --- a/tests/baselines/reference/classImplementsImportedInterface.js +++ /dev/null @@ -1,25 +0,0 @@ -//// [classImplementsImportedInterface.ts] -module M1 { - export interface I { - foo(); - } -} - -module M2 { - import T = M1.I; - class C implements T { - foo() {} - } -} - -//// [classImplementsImportedInterface.js] -var M2; -(function (M2) { - var C = (function () { - function C() { - } - C.prototype.foo = function () { - }; - return C; - })(); -})(M2 || (M2 = {})); diff --git a/tests/baselines/reference/classImplementsImportedInterface.types b/tests/baselines/reference/classImplementsImportedInterface.types deleted file mode 100644 index ef02896a945..00000000000 --- a/tests/baselines/reference/classImplementsImportedInterface.types +++ /dev/null @@ -1,28 +0,0 @@ -=== tests/cases/compiler/classImplementsImportedInterface.ts === -module M1 { ->M1 : M1 - - export interface I { ->I : I - - foo(); ->foo : () => any - } -} - -module M2 { ->M2 : typeof M2 - - import T = M1.I; ->T : T ->M1 : M1 ->I : I - - class C implements T { ->C : C ->T : I - - foo() {} ->foo : () => void - } -} diff --git a/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.types b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.types index 689ff5bdf41..bff966e605f 100644 --- a/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.types +++ b/tests/baselines/reference/classMemberInitializerWithLamdaScoping5.types @@ -17,9 +17,7 @@ class Greeter { messageHandler = (message: string) => { >messageHandler : (message: string) => void ->(message: string) => { - console.log(message); // This shouldnt be error - } : (message: string) => void +>(message: string) => { console.log(message); // This shouldnt be error } : (message: string) => void >message : string console.log(message); // This shouldnt be error diff --git a/tests/baselines/reference/classMethodWithKeywordName1.types b/tests/baselines/reference/classMethodWithKeywordName1.types index 8ad128bdb00..ab8232ed4ba 100644 --- a/tests/baselines/reference/classMethodWithKeywordName1.types +++ b/tests/baselines/reference/classMethodWithKeywordName1.types @@ -3,5 +3,5 @@ class C { >C : C static try() {} ->try : () => void +>try : typeof try } diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.errors.txt b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.errors.txt new file mode 100644 index 00000000000..618caae14e0 --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.errors.txt @@ -0,0 +1,30 @@ +==== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface.ts (2 errors) ==== + // no errors expected + + class C { + public x: string; + public y(a: number): number { return null; } + public get z() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set z(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + [x: string]: Object; + [x: number]: Object; + 0: number; + } + + interface I { + x: string; + y(b: number): number; + z: number; + [x: string]: Object; + [x: number]: Object; + 0: number; + } + + var c: C; + var i: I; + c = i; + i = c; \ No newline at end of file diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types deleted file mode 100644 index 9f6d031bf20..00000000000 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface.types +++ /dev/null @@ -1,73 +0,0 @@ -=== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface.ts === -// no errors expected - -class C { ->C : C - - public x: string; ->x : string - - public y(a: number): number { return null; } ->y : (a: number) => number ->a : number - - public get z() { return 1; } ->z : number - - public set z(v) { } ->z : number ->v : number - - [x: string]: Object; ->x : string ->Object : Object - - [x: number]: Object; ->x : number ->Object : Object - - 0: number; -} - -interface I { ->I : I - - x: string; ->x : string - - y(b: number): number; ->y : (b: number) => number ->b : number - - z: number; ->z : number - - [x: string]: Object; ->x : string ->Object : Object - - [x: number]: Object; ->x : number ->Object : Object - - 0: number; -} - -var c: C; ->c : C ->C : C - -var i: I; ->i : I ->I : I - -c = i; ->c = i : I ->c : C ->i : I - -i = c; ->i = c : C ->i : I ->c : C - diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.errors.txt b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.errors.txt new file mode 100644 index 00000000000..b26f3cd6146 --- /dev/null +++ b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.errors.txt @@ -0,0 +1,32 @@ +==== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface2.ts (2 errors) ==== + // no errors expected + + class C { + public x: string; + public y(a: number): number { return null; } + public get z() { return 1; } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + public set z(v) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + [x: string]: Object; + [x: number]: Object; + 0: number; + + public static foo: string; // doesn't effect equivalence + } + + interface I { + x: string; + y(b: number): number; + z: number; + [x: string]: Object; + [x: number]: Object; + 0: number; + } + + var c: C; + var i: I; + c = i; + i = c; \ No newline at end of file diff --git a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types b/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types deleted file mode 100644 index be504f895fd..00000000000 --- a/tests/baselines/reference/classWithOnlyPublicMembersEquivalentToInterface2.types +++ /dev/null @@ -1,76 +0,0 @@ -=== tests/cases/conformance/types/namedTypes/classWithOnlyPublicMembersEquivalentToInterface2.ts === -// no errors expected - -class C { ->C : C - - public x: string; ->x : string - - public y(a: number): number { return null; } ->y : (a: number) => number ->a : number - - public get z() { return 1; } ->z : number - - public set z(v) { } ->z : number ->v : number - - [x: string]: Object; ->x : string ->Object : Object - - [x: number]: Object; ->x : number ->Object : Object - - 0: number; - - public static foo: string; // doesn't effect equivalence ->foo : string -} - -interface I { ->I : I - - x: string; ->x : string - - y(b: number): number; ->y : (b: number) => number ->b : number - - z: number; ->z : number - - [x: string]: Object; ->x : string ->Object : Object - - [x: number]: Object; ->x : number ->Object : Object - - 0: number; -} - -var c: C; ->c : C ->C : C - -var i: I; ->i : I ->I : I - -c = i; ->c = i : I ->c : C ->i : I - -i = c; ->i = c : C ->i : I ->c : C - diff --git a/tests/baselines/reference/classWithPublicProperty.types b/tests/baselines/reference/classWithPublicProperty.types index a5bdeb95f1a..ee08e04256c 100644 --- a/tests/baselines/reference/classWithPublicProperty.types +++ b/tests/baselines/reference/classWithPublicProperty.types @@ -22,7 +22,7 @@ class C { >e : any public static f() { return '' } ->f : () => string +>f : typeof f public static g = () => ''; >g : () => string @@ -76,9 +76,9 @@ var r6: string = C.e; var r7: string = C.f(); >r7 : string >C.f() : string ->C.f : () => string +>C.f : typeof f >C : typeof C ->f : () => string +>f : typeof f var r8: string = C.g(); >r8 : string diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types index 3bd384b6e95..b513d80ccc0 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.types +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.types @@ -9,7 +9,7 @@ module A { >foo : () => void static bar() { } ->bar : () => void +>bar : typeof bar } } diff --git a/tests/baselines/reference/cloduleTest1.types b/tests/baselines/reference/cloduleTest1.types index a92355b483a..214b46c2676 100644 --- a/tests/baselines/reference/cloduleTest1.types +++ b/tests/baselines/reference/cloduleTest1.types @@ -19,7 +19,7 @@ >AjaxSettings : AjaxSettings } export function ajax(options: AjaxSettings) { } ->ajax : (options: AjaxSettings) => void +>ajax : typeof ajax >options : AjaxSettings >AjaxSettings : AjaxSettings } diff --git a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types index 07ef123f642..7c22d6ddc8f 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithFunctionChildren.types @@ -6,7 +6,7 @@ module M { >x : number function fn(M, p = x) { } ->fn : (M: any, p?: number) => void +>fn : typeof fn >M : any >p : number >x : number @@ -16,7 +16,7 @@ module M { >M : typeof M function fn2() { ->fn2 : () => void +>fn2 : typeof fn2 var M; >M : any @@ -31,7 +31,7 @@ module M { >M : typeof M function fn3() { ->fn3 : () => void +>fn3 : typeof fn3 function M() { >M : () => void diff --git a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types index 7853bcbdb32..3ed65442a0e 100644 --- a/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types +++ b/tests/baselines/reference/collisionCodeGenModuleWithModuleChildren.types @@ -44,7 +44,7 @@ module M { >m3 : typeof m3 function M() { ->M : () => void +>M : typeof M } var p = x; >p : number @@ -53,7 +53,7 @@ module M { var p2 = M(); >p2 : void >M() : void ->M : () => void +>M : typeof M } } diff --git a/tests/baselines/reference/collisionExportsRequireAndFunction.types b/tests/baselines/reference/collisionExportsRequireAndFunction.types index 8b90397c6fe..8bf94d991f7 100644 --- a/tests/baselines/reference/collisionExportsRequireAndFunction.types +++ b/tests/baselines/reference/collisionExportsRequireAndFunction.types @@ -1,11 +1,11 @@ === tests/cases/compiler/collisionExportsRequireAndFunction.ts === export function exports() { ->exports : () => number +>exports : typeof exports return 1; } export function require() { ->require : () => string +>require : typeof require return "require"; } diff --git a/tests/baselines/reference/collisionExportsRequireAndModule.types b/tests/baselines/reference/collisionExportsRequireAndModule.types index e2956ee1ba8..21154458d6f 100644 --- a/tests/baselines/reference/collisionExportsRequireAndModule.types +++ b/tests/baselines/reference/collisionExportsRequireAndModule.types @@ -10,7 +10,7 @@ export module require { } } export function foo(): require.I { ->foo : () => I +>foo : typeof foo >require : require >I : I @@ -27,7 +27,7 @@ export module exports { } } export function foo2(): exports.I { ->foo2 : () => I +>foo2 : typeof foo2 >exports : exports >I : I diff --git a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types index 4b219229ef3..e29b88abfe9 100644 --- a/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types +++ b/tests/baselines/reference/collisionExportsRequireAndUninstantiatedModule.types @@ -7,7 +7,7 @@ export module require { // no error } } export function foo(): require.I { ->foo : () => I +>foo : typeof foo >require : require >I : I @@ -21,7 +21,7 @@ export module exports { // no error } } export function foo2(): exports.I { ->foo2 : () => I +>foo2 : typeof foo2 >exports : exports >I : I diff --git a/tests/baselines/reference/collisionExportsRequireAndVar.types b/tests/baselines/reference/collisionExportsRequireAndVar.types index 656c705aa23..112b8ec838e 100644 --- a/tests/baselines/reference/collisionExportsRequireAndVar.types +++ b/tests/baselines/reference/collisionExportsRequireAndVar.types @@ -1,6 +1,6 @@ === tests/cases/compiler/collisionExportsRequireAndVar.ts === export function foo() { ->foo : () => void +>foo : typeof foo } var exports = 1; >exports : number diff --git a/tests/baselines/reference/commaOperator1.types b/tests/baselines/reference/commaOperator1.types index 52a36e33024..17b8c3cad00 100644 --- a/tests/baselines/reference/commaOperator1.types +++ b/tests/baselines/reference/commaOperator1.types @@ -12,7 +12,7 @@ var v1 = ((1, 2, 3), 4, 5, (6, 7)); >6, 7 : number function f1() { ->f1 : () => number +>f1 : typeof f1 var a = 1; >a : number diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.types b/tests/baselines/reference/commaOperatorOtherValidOperation.types index e42991e7b5a..57538f4a1cb 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.types +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.types @@ -16,7 +16,7 @@ for (var i = 0, j = 10; i < j; i++, j--) //Comma operator in fuction arguments and return function foo(x: number, y: string) ->foo : (x: number, y: string) => string +>foo : typeof foo >x : number >y : string { @@ -28,11 +28,11 @@ function foo(x: number, y: string) var resultIsString = foo(1, "123"); >resultIsString : string >foo(1, "123") : string ->foo : (x: number, y: string) => string +>foo : typeof foo //TypeParameters function foo1() ->foo1 : () => void +>foo1 : typeof foo1 >T1 : T1 >T2 : T2 { diff --git a/tests/baselines/reference/commentBeforeStaticMethod1.types b/tests/baselines/reference/commentBeforeStaticMethod1.types index db674324306..ebae1111658 100644 --- a/tests/baselines/reference/commentBeforeStaticMethod1.types +++ b/tests/baselines/reference/commentBeforeStaticMethod1.types @@ -6,7 +6,7 @@ class C { * Returns bar */ public static foo(): string { ->foo : () => string +>foo : typeof foo return "bar"; } diff --git a/tests/baselines/reference/commentInEmptyParameterList1.types b/tests/baselines/reference/commentInEmptyParameterList1.types index dd708e8c9ac..c2e120d1ffb 100644 --- a/tests/baselines/reference/commentInEmptyParameterList1.types +++ b/tests/baselines/reference/commentInEmptyParameterList1.types @@ -1,4 +1,4 @@ === tests/cases/compiler/commentInEmptyParameterList1.ts === function foo(/** nothing */) { ->foo : () => void +>foo : typeof foo } diff --git a/tests/baselines/reference/commentInMethodCall.types b/tests/baselines/reference/commentInMethodCall.types index dad966bd3df..e9543a8c6f2 100644 --- a/tests/baselines/reference/commentInMethodCall.types +++ b/tests/baselines/reference/commentInMethodCall.types @@ -4,8 +4,7 @@ var s: string[]; >s : string[] s.map(// do something ->s.map(// do something - function () { }) : void[] +>s.map(// do something function () { }) : void[] >s.map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >s : string[] >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] diff --git a/tests/baselines/reference/commentOnSignature1.types b/tests/baselines/reference/commentOnSignature1.types index 6fd4516d4e9..6630fb2cf1e 100644 --- a/tests/baselines/reference/commentOnSignature1.types +++ b/tests/baselines/reference/commentOnSignature1.types @@ -1,15 +1,15 @@ === tests/cases/compiler/commentOnSignature1.ts === /*! Keep this pinned comment */ function foo(n: number): void; ->foo : { (n: number): void; (s: string): void; } +>foo : typeof foo >n : number // Don't keep this comment. function foo(s: string): void; ->foo : { (n: number): void; (s: string): void; } +>foo : typeof foo >s : string function foo(a: any): void { ->foo : { (n: number): void; (s: string): void; } +>foo : typeof foo >a : any } diff --git a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types index 797da3e419a..99ec3c9a021 100644 --- a/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types +++ b/tests/baselines/reference/commentOnSimpleArrowFunctionBody1.types @@ -1,18 +1,14 @@ === tests/cases/compiler/commentOnSimpleArrowFunctionBody1.ts === function Foo(x: any) ->Foo : (x: any) => void +>Foo : typeof Foo >x : any { } Foo(() => ->Foo(() => - // do something - 127) : void ->Foo : (x: any) => void ->() => - // do something - 127 : () => number +>Foo(() => // do something 127) : void +>Foo : typeof Foo +>() => // do something 127 : () => number // do something 127); diff --git a/tests/baselines/reference/commentOnStaticMember1.types b/tests/baselines/reference/commentOnStaticMember1.types index 4b54b07570a..927114680d8 100644 --- a/tests/baselines/reference/commentOnStaticMember1.types +++ b/tests/baselines/reference/commentOnStaticMember1.types @@ -4,6 +4,6 @@ class Greeter { //Hello World static foo(){ ->foo : () => void +>foo : typeof foo } } diff --git a/tests/baselines/reference/commentsBeforeFunctionExpression1.types b/tests/baselines/reference/commentsBeforeFunctionExpression1.types index 50bb6352fad..4580ca9ceeb 100644 --- a/tests/baselines/reference/commentsBeforeFunctionExpression1.types +++ b/tests/baselines/reference/commentsBeforeFunctionExpression1.types @@ -1,9 +1,7 @@ === tests/cases/compiler/commentsBeforeFunctionExpression1.ts === var v = { >v : { f: (a: any) => number; } ->{ - f: /**own f*/ (a) => 0 -} : { f: (a: any) => number; } +>{ f: /**own f*/ (a) => 0} : { f: (a: any) => number; } f: /**own f*/ (a) => 0 >f : (a: any) => number diff --git a/tests/baselines/reference/commentsClassMembers.types b/tests/baselines/reference/commentsClassMembers.types index d71ccd2e1e8..91e76986262 100644 --- a/tests/baselines/reference/commentsClassMembers.types +++ b/tests/baselines/reference/commentsClassMembers.types @@ -107,7 +107,7 @@ class c1 { /** static sum with property*/ static s2(/** number to add*/b: number) { ->s2 : (b: number) => number +>s2 : typeof s2 >b : number return c1.s1 + b; @@ -123,9 +123,9 @@ class c1 { return c1.s2(c1.s1); >c1.s2(c1.s1) : number ->c1.s2 : (b: number) => number +>c1.s2 : typeof s2 >c1 : typeof c1 ->s2 : (b: number) => number +>s2 : typeof s2 >c1.s1 : number >c1 : typeof c1 >s1 : number @@ -142,9 +142,9 @@ class c1 { >c1 : typeof c1 >s1 : number >c1.s2(value) : number ->c1.s2 : (b: number) => number +>c1.s2 : typeof s2 >c1 : typeof c1 ->s2 : (b: number) => number +>s2 : typeof s2 >value : number }/*trailing comment 2 */ /*setter*/ @@ -234,7 +234,7 @@ class c1 { >nc_s1 : number static nc_s2(b: number) { ->nc_s2 : (b: number) => number +>nc_s2 : typeof nc_s2 >b : number return c1.nc_s1 + b; @@ -249,9 +249,9 @@ class c1 { return c1.nc_s2(c1.nc_s1); >c1.nc_s2(c1.nc_s1) : number ->c1.nc_s2 : (b: number) => number +>c1.nc_s2 : typeof nc_s2 >c1 : typeof c1 ->nc_s2 : (b: number) => number +>nc_s2 : typeof nc_s2 >c1.nc_s1 : number >c1 : typeof c1 >nc_s1 : number @@ -266,9 +266,9 @@ class c1 { >c1 : typeof c1 >nc_s1 : number >c1.nc_s2(value) : number ->c1.nc_s2 : (b: number) => number +>c1.nc_s2 : typeof nc_s2 >c1 : typeof c1 ->nc_s2 : (b: number) => number +>nc_s2 : typeof nc_s2 >value : number } @@ -369,7 +369,7 @@ class c1 { // static sum with property static a_s2(b: number) { ->a_s2 : (b: number) => number +>a_s2 : typeof a_s2 >b : number return c1.a_s1 + b; @@ -385,9 +385,9 @@ class c1 { return c1.s2(c1.s1); >c1.s2(c1.s1) : number ->c1.s2 : (b: number) => number +>c1.s2 : typeof s2 >c1 : typeof c1 ->s2 : (b: number) => number +>s2 : typeof s2 >c1.s1 : number >c1 : typeof c1 >s1 : number @@ -404,9 +404,9 @@ class c1 { >c1 : typeof c1 >a_s1 : number >c1.a_s2(value) : number ->c1.a_s2 : (b: number) => number +>c1.a_s2 : typeof a_s2 >c1 : typeof c1 ->a_s2 : (b: number) => number +>a_s2 : typeof a_s2 >value : number } @@ -507,7 +507,7 @@ class c1 { /** static sum with property */ static b_s2(b: number) { ->b_s2 : (b: number) => number +>b_s2 : typeof b_s2 >b : number return c1.b_s1 + b; @@ -524,9 +524,9 @@ class c1 { return c1.s2(c1.s1); >c1.s2(c1.s1) : number ->c1.s2 : (b: number) => number +>c1.s2 : typeof s2 >c1 : typeof c1 ->s2 : (b: number) => number +>s2 : typeof s2 >c1.s1 : number >c1 : typeof c1 >s1 : number @@ -545,9 +545,9 @@ class c1 { >c1 : typeof c1 >b_s1 : number >c1.b_s2(value) : number ->c1.b_s2 : (b: number) => number +>c1.b_s2 : typeof b_s2 >c1 : typeof c1 ->b_s2 : (b: number) => number +>b_s2 : typeof b_s2 >value : number } } @@ -627,17 +627,17 @@ var i1_s_p = c1.s1; >s1 : number var i1_s_f = c1.s2; ->i1_s_f : (b: number) => number ->c1.s2 : (b: number) => number +>i1_s_f : typeof s2 +>c1.s2 : typeof s2 >c1 : typeof c1 ->s2 : (b: number) => number +>s2 : typeof s2 var i1_s_r = c1.s2(20); >i1_s_r : number >c1.s2(20) : number ->c1.s2 : (b: number) => number +>c1.s2 : typeof s2 >c1 : typeof c1 ->s2 : (b: number) => number +>s2 : typeof s2 var i1_s_prop = c1.s3; >i1_s_prop : number @@ -659,17 +659,17 @@ var i1_s_nc_p = c1.nc_s1; >nc_s1 : number var i1_s_ncf = c1.nc_s2; ->i1_s_ncf : (b: number) => number ->c1.nc_s2 : (b: number) => number +>i1_s_ncf : typeof nc_s2 +>c1.nc_s2 : typeof nc_s2 >c1 : typeof c1 ->nc_s2 : (b: number) => number +>nc_s2 : typeof nc_s2 var i1_s_ncr = c1.nc_s2(20); >i1_s_ncr : number >c1.nc_s2(20) : number ->c1.nc_s2 : (b: number) => number +>c1.nc_s2 : typeof nc_s2 >c1 : typeof c1 ->nc_s2 : (b: number) => number +>nc_s2 : typeof nc_s2 var i1_s_ncprop = c1.nc_s3; >i1_s_ncprop : number diff --git a/tests/baselines/reference/commentsCommentParsing.types b/tests/baselines/reference/commentsCommentParsing.types index a9194f9a63a..d10a339868e 100644 --- a/tests/baselines/reference/commentsCommentParsing.types +++ b/tests/baselines/reference/commentsCommentParsing.types @@ -2,41 +2,41 @@ /// This is simple /// comments function simple() { ->simple : () => void +>simple : typeof simple } simple(); >simple() : void ->simple : () => void +>simple : typeof simple /// multiLine /// Comments /// This is example of multiline /// comments /// Another multiLine function multiLine() { ->multiLine : () => void +>multiLine : typeof multiLine } multiLine(); >multiLine() : void ->multiLine : () => void +>multiLine : typeof multiLine /** this is eg of single line jsdoc style comment */ function jsDocSingleLine() { ->jsDocSingleLine : () => void +>jsDocSingleLine : typeof jsDocSingleLine } jsDocSingleLine(); >jsDocSingleLine() : void ->jsDocSingleLine : () => void +>jsDocSingleLine : typeof jsDocSingleLine /** this is multiple line jsdoc stule comment *New line1 *New Line2*/ function jsDocMultiLine() { ->jsDocMultiLine : () => void +>jsDocMultiLine : typeof jsDocMultiLine } jsDocMultiLine(); >jsDocMultiLine() : void ->jsDocMultiLine : () => void +>jsDocMultiLine : typeof jsDocMultiLine /** this is multiple line jsdoc stule comment *New line1 @@ -44,60 +44,60 @@ jsDocMultiLine(); /** Shoul mege this line as well * and this too*/ /** Another this one too*/ function jsDocMultiLineMerge() { ->jsDocMultiLineMerge : () => void +>jsDocMultiLineMerge : typeof jsDocMultiLineMerge } jsDocMultiLineMerge(); >jsDocMultiLineMerge() : void ->jsDocMultiLineMerge : () => void +>jsDocMultiLineMerge : typeof jsDocMultiLineMerge /// Triple slash comment /** jsdoc comment */ function jsDocMixedComments1() { ->jsDocMixedComments1 : () => void +>jsDocMixedComments1 : typeof jsDocMixedComments1 } jsDocMixedComments1(); >jsDocMixedComments1() : void ->jsDocMixedComments1 : () => void +>jsDocMixedComments1 : typeof jsDocMixedComments1 /// Triple slash comment /** jsdoc comment */ /*** another jsDocComment*/ function jsDocMixedComments2() { ->jsDocMixedComments2 : () => void +>jsDocMixedComments2 : typeof jsDocMixedComments2 } jsDocMixedComments2(); >jsDocMixedComments2() : void ->jsDocMixedComments2 : () => void +>jsDocMixedComments2 : typeof jsDocMixedComments2 /** jsdoc comment */ /*** another jsDocComment*/ /// Triple slash comment function jsDocMixedComments3() { ->jsDocMixedComments3 : () => void +>jsDocMixedComments3 : typeof jsDocMixedComments3 } jsDocMixedComments3(); >jsDocMixedComments3() : void ->jsDocMixedComments3 : () => void +>jsDocMixedComments3 : typeof jsDocMixedComments3 /** jsdoc comment */ /*** another jsDocComment*/ /// Triple slash comment /// Triple slash comment 2 function jsDocMixedComments4() { ->jsDocMixedComments4 : () => void +>jsDocMixedComments4 : typeof jsDocMixedComments4 } jsDocMixedComments4(); >jsDocMixedComments4() : void ->jsDocMixedComments4 : () => void +>jsDocMixedComments4 : typeof jsDocMixedComments4 /// Triple slash comment 1 /** jsdoc comment */ /*** another jsDocComment*/ /// Triple slash comment /// Triple slash comment 2 function jsDocMixedComments5() { ->jsDocMixedComments5 : () => void +>jsDocMixedComments5 : typeof jsDocMixedComments5 } jsDocMixedComments5(); >jsDocMixedComments5() : void ->jsDocMixedComments5 : () => void +>jsDocMixedComments5 : typeof jsDocMixedComments5 /*** another jsDocComment*/ /// Triple slash comment 1 @@ -105,41 +105,41 @@ jsDocMixedComments5(); /// Triple slash comment 2 /** jsdoc comment */ function jsDocMixedComments6() { ->jsDocMixedComments6 : () => void +>jsDocMixedComments6 : typeof jsDocMixedComments6 } jsDocMixedComments6(); >jsDocMixedComments6() : void ->jsDocMixedComments6 : () => void +>jsDocMixedComments6 : typeof jsDocMixedComments6 // This shoulnot be help comment function noHelpComment1() { ->noHelpComment1 : () => void +>noHelpComment1 : typeof noHelpComment1 } noHelpComment1(); >noHelpComment1() : void ->noHelpComment1 : () => void +>noHelpComment1 : typeof noHelpComment1 /* This shoulnot be help comment */ function noHelpComment2() { ->noHelpComment2 : () => void +>noHelpComment2 : typeof noHelpComment2 } noHelpComment2(); >noHelpComment2() : void ->noHelpComment2 : () => void +>noHelpComment2 : typeof noHelpComment2 function noHelpComment3() { ->noHelpComment3 : () => void +>noHelpComment3 : typeof noHelpComment3 } noHelpComment3(); >noHelpComment3() : void ->noHelpComment3 : () => void +>noHelpComment3 : typeof noHelpComment3 /** Adds two integers and returns the result * @param {number} a first number * @param b second number */ function sum(a: number, b: number) { ->sum : (a: number, b: number) => number +>sum : typeof sum >a : number >b : number @@ -150,7 +150,7 @@ function sum(a: number, b: number) { } sum(10, 20); >sum(10, 20) : number ->sum : (a: number, b: number) => number +>sum : typeof sum /** This is multiplication function*/ /** @param */ @@ -160,7 +160,7 @@ sum(10, 20); @param d @anotherTag*/ /** @param e LastParam @anotherTag*/ function multiply(a: number, b: number, c?: number, d?, e?) { ->multiply : (a: number, b: number, c?: number, d?: any, e?: any) => void +>multiply : typeof multiply >a : number >b : number >c : number @@ -171,16 +171,16 @@ function multiply(a: number, b: number, c?: number, d?, e?) { * @param { string} b about b */ function f1(a: number); ->f1 : { (a: number): any; (b: string): any; } +>f1 : typeof f1 >a : number function f1(b: string); ->f1 : { (a: number): any; (b: string): any; } +>f1 : typeof f1 >b : string /**@param opt optional parameter*/ function f1(aOrb, opt?) { ->f1 : { (a: number): any; (b: string): any; } +>f1 : typeof f1 >aOrb : any >opt : any @@ -196,7 +196,7 @@ function f1(aOrb, opt?) { @param { { { () => string; } } f this is optional param f */ function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string) { ->subtract : (a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string) => void +>subtract : typeof subtract >a : number >b : number >c : () => string @@ -210,7 +210,7 @@ function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: @returnType { number } it is return type */ function square(a: number) { ->square : (a: number) => number +>square : typeof square >a : number return a * a; @@ -224,7 +224,7 @@ function square(a: number) { @param { number} b this is b */ function divide(a: number, b: number) { ->divide : (a: number, b: number) => void +>divide : typeof divide >a : number >b : number } @@ -233,7 +233,7 @@ function divide(a: number, b: number) { *@param c it is third parameter */ function jsDocParamTest(/** this is inline comment for a */a: number, /** this is inline comment for b*/ b: number, c: number, d: number) { ->jsDocParamTest : (a: number, b: number, c: number, d: number) => number +>jsDocParamTest : typeof jsDocParamTest >a : number >b : number >c : number diff --git a/tests/baselines/reference/commentsDottedModuleName.types b/tests/baselines/reference/commentsDottedModuleName.types deleted file mode 100644 index 53195bfccfa..00000000000 --- a/tests/baselines/reference/commentsDottedModuleName.types +++ /dev/null @@ -1,12 +0,0 @@ -=== tests/cases/compiler/commentsDottedModuleName.ts === - -/** this is multi declare module*/ -export module outerModule.InnerModule { ->outerModule : typeof outerModule ->InnerModule : typeof InnerModule - - /// class b comment - export class b { ->b : b - } -} diff --git a/tests/baselines/reference/commentsExternalModules.types b/tests/baselines/reference/commentsExternalModules.types index cff7702fcfa..dd6569e6e53 100644 --- a/tests/baselines/reference/commentsExternalModules.types +++ b/tests/baselines/reference/commentsExternalModules.types @@ -5,11 +5,11 @@ import extMod = require("commentsExternalModules_0"); // trailing comment1 extMod.m1.fooExport(); >extMod.m1.fooExport() : number ->extMod.m1.fooExport : () => number +>extMod.m1.fooExport : typeof fooExport >extMod.m1 : typeof m1 >extMod : typeof "tests/cases/compiler/commentsExternalModules_0" >m1 : typeof m1 ->fooExport : () => number +>fooExport : typeof fooExport var newVar = new extMod.m1.m2.c(); >newVar : c @@ -24,11 +24,11 @@ var newVar = new extMod.m1.m2.c(); extMod.m4.fooExport(); >extMod.m4.fooExport() : number ->extMod.m4.fooExport : () => number +>extMod.m4.fooExport : typeof fooExport >extMod.m4 : typeof m4 >extMod : typeof "tests/cases/compiler/commentsExternalModules_0" >m4 : typeof m4 ->fooExport : () => number +>fooExport : typeof fooExport var newVar2 = new extMod.m4.m2.c(); >newVar2 : c @@ -53,7 +53,7 @@ export module m1 { /** foo's comment*/ function foo() { ->foo : () => number +>foo : typeof foo return b; >b : number @@ -75,18 +75,18 @@ export module m1 { } /** exported function*/ export function fooExport() { ->fooExport : () => number +>fooExport : typeof fooExport return foo(); >foo() : number ->foo : () => number +>foo : typeof foo } } m1.fooExport(); >m1.fooExport() : number ->m1.fooExport : () => number +>m1.fooExport : typeof fooExport >m1 : typeof m1 ->fooExport : () => number +>fooExport : typeof fooExport var myvar = new m1.m2.c(); >myvar : c @@ -108,7 +108,7 @@ export module m4 { /** foo's comment */ function foo() { ->foo : () => number +>foo : typeof foo return b; >b : number @@ -131,18 +131,18 @@ export module m4 { } /** exported function */ export function fooExport() { ->fooExport : () => number +>fooExport : typeof fooExport return foo(); >foo() : number ->foo : () => number +>foo : typeof foo } } m4.fooExport(); >m4.fooExport() : number ->m4.fooExport : () => number +>m4.fooExport : typeof fooExport >m4 : typeof m4 ->fooExport : () => number +>fooExport : typeof fooExport var myvar2 = new m4.m2.c(); >myvar2 : c diff --git a/tests/baselines/reference/commentsExternalModules2.types b/tests/baselines/reference/commentsExternalModules2.types index d7f72277b2e..fb624d9c5a6 100644 --- a/tests/baselines/reference/commentsExternalModules2.types +++ b/tests/baselines/reference/commentsExternalModules2.types @@ -5,11 +5,11 @@ import extMod = require("commentsExternalModules2_0"); // trailing comment 1 extMod.m1.fooExport(); >extMod.m1.fooExport() : number ->extMod.m1.fooExport : () => number +>extMod.m1.fooExport : typeof fooExport >extMod.m1 : typeof m1 >extMod : typeof "tests/cases/compiler/commentsExternalModules2_0" >m1 : typeof m1 ->fooExport : () => number +>fooExport : typeof fooExport export var newVar = new extMod.m1.m2.c(); >newVar : c @@ -24,11 +24,11 @@ export var newVar = new extMod.m1.m2.c(); extMod.m4.fooExport(); >extMod.m4.fooExport() : number ->extMod.m4.fooExport : () => number +>extMod.m4.fooExport : typeof fooExport >extMod.m4 : typeof m4 >extMod : typeof "tests/cases/compiler/commentsExternalModules2_0" >m4 : typeof m4 ->fooExport : () => number +>fooExport : typeof fooExport export var newVar2 = new extMod.m4.m2.c(); >newVar2 : c @@ -53,7 +53,7 @@ export module m1 { /** foo's comment*/ function foo() { ->foo : () => number +>foo : typeof foo return b; >b : number @@ -75,18 +75,18 @@ export module m1 { } /** exported function*/ export function fooExport() { ->fooExport : () => number +>fooExport : typeof fooExport return foo(); >foo() : number ->foo : () => number +>foo : typeof foo } } m1.fooExport(); >m1.fooExport() : number ->m1.fooExport : () => number +>m1.fooExport : typeof fooExport >m1 : typeof m1 ->fooExport : () => number +>fooExport : typeof fooExport var myvar = new m1.m2.c(); >myvar : c @@ -108,7 +108,7 @@ export module m4 { /** foo's comment */ function foo() { ->foo : () => number +>foo : typeof foo return b; >b : number @@ -131,18 +131,18 @@ export module m4 { } /** exported function */ export function fooExport() { ->fooExport : () => number +>fooExport : typeof fooExport return foo(); >foo() : number ->foo : () => number +>foo : typeof foo } } m4.fooExport(); >m4.fooExport() : number ->m4.fooExport : () => number +>m4.fooExport : typeof fooExport >m4 : typeof m4 ->fooExport : () => number +>fooExport : typeof fooExport var myvar2 = new m4.m2.c(); >myvar2 : c diff --git a/tests/baselines/reference/commentsExternalModules3.types b/tests/baselines/reference/commentsExternalModules3.types index d7f72277b2e..fb624d9c5a6 100644 --- a/tests/baselines/reference/commentsExternalModules3.types +++ b/tests/baselines/reference/commentsExternalModules3.types @@ -5,11 +5,11 @@ import extMod = require("commentsExternalModules2_0"); // trailing comment 1 extMod.m1.fooExport(); >extMod.m1.fooExport() : number ->extMod.m1.fooExport : () => number +>extMod.m1.fooExport : typeof fooExport >extMod.m1 : typeof m1 >extMod : typeof "tests/cases/compiler/commentsExternalModules2_0" >m1 : typeof m1 ->fooExport : () => number +>fooExport : typeof fooExport export var newVar = new extMod.m1.m2.c(); >newVar : c @@ -24,11 +24,11 @@ export var newVar = new extMod.m1.m2.c(); extMod.m4.fooExport(); >extMod.m4.fooExport() : number ->extMod.m4.fooExport : () => number +>extMod.m4.fooExport : typeof fooExport >extMod.m4 : typeof m4 >extMod : typeof "tests/cases/compiler/commentsExternalModules2_0" >m4 : typeof m4 ->fooExport : () => number +>fooExport : typeof fooExport export var newVar2 = new extMod.m4.m2.c(); >newVar2 : c @@ -53,7 +53,7 @@ export module m1 { /** foo's comment*/ function foo() { ->foo : () => number +>foo : typeof foo return b; >b : number @@ -75,18 +75,18 @@ export module m1 { } /** exported function*/ export function fooExport() { ->fooExport : () => number +>fooExport : typeof fooExport return foo(); >foo() : number ->foo : () => number +>foo : typeof foo } } m1.fooExport(); >m1.fooExport() : number ->m1.fooExport : () => number +>m1.fooExport : typeof fooExport >m1 : typeof m1 ->fooExport : () => number +>fooExport : typeof fooExport var myvar = new m1.m2.c(); >myvar : c @@ -108,7 +108,7 @@ export module m4 { /** foo's comment */ function foo() { ->foo : () => number +>foo : typeof foo return b; >b : number @@ -131,18 +131,18 @@ export module m4 { } /** exported function */ export function fooExport() { ->fooExport : () => number +>fooExport : typeof fooExport return foo(); >foo() : number ->foo : () => number +>foo : typeof foo } } m4.fooExport(); >m4.fooExport() : number ->m4.fooExport : () => number +>m4.fooExport : typeof fooExport >m4 : typeof m4 ->fooExport : () => number +>fooExport : typeof fooExport var myvar2 = new m4.m2.c(); >myvar2 : c diff --git a/tests/baselines/reference/commentsFunction.types b/tests/baselines/reference/commentsFunction.types index 642a1c42665..6b8dd2dec26 100644 --- a/tests/baselines/reference/commentsFunction.types +++ b/tests/baselines/reference/commentsFunction.types @@ -2,16 +2,16 @@ /** This comment should appear for foo*/ function foo() { ->foo : () => void +>foo : typeof foo } /* trailing comment of function */ foo(); >foo() : void ->foo : () => void +>foo : typeof foo /** This is comment for function signature*/ function fooWithParameters(/** this is comment about a*/a: string, ->fooWithParameters : (a: string, b: number) => void +>fooWithParameters : typeof fooWithParameters >a : string /** this is comment for b*/ @@ -25,16 +25,14 @@ function fooWithParameters(/** this is comment about a*/a: string, } // trailing comment of function fooWithParameters("a", 10); >fooWithParameters("a", 10) : void ->fooWithParameters : (a: string, b: number) => void +>fooWithParameters : typeof fooWithParameters /** fooFunc * comment */ var fooFunc = function FooFunctionValue(/** fooFunctionValue param */ b: string) { >fooFunc : (b: string) => string ->function FooFunctionValue(/** fooFunctionValue param */ b: string) { - return b; -} : (b: string) => string +>function FooFunctionValue(/** fooFunctionValue param */ b: string) { return b;} : (b: string) => string >FooFunctionValue : (b: string) => string >b : string @@ -70,19 +68,19 @@ lambddaNoVarComment(10, 20); >lambddaNoVarComment : (a: number, b: number) => number function blah(a: string /* multiline trailing comment ->blah : (a: string) => void +>blah : typeof blah >a : string multiline */) { } function blah2(a: string /* single line multiple trailing comments */ /* second */) { ->blah2 : (a: string) => void +>blah2 : typeof blah2 >a : string } function blah3(a: string // trailing commen single line ->blah3 : (a: string) => void +>blah3 : typeof blah3 >a : string ) { @@ -106,19 +104,19 @@ lambdaFoo = (a, b) => a * b; // This is trailing comment >() => 0 : () => number function blah4(/*1*/a: string/*2*/,/*3*/b: string/*4*/) { ->blah4 : (a: string, b: string) => void +>blah4 : typeof blah4 >a : string >b : string } function foo1() { ->foo1 : () => void +>foo1 : typeof foo1 // should emit this } function foo2() { ->foo2 : () => void +>foo2 : typeof foo2 /// This is some detached comment diff --git a/tests/baselines/reference/commentsInterface.types b/tests/baselines/reference/commentsInterface.types index 74ae683cff2..68d552882e2 100644 --- a/tests/baselines/reference/commentsInterface.types +++ b/tests/baselines/reference/commentsInterface.types @@ -186,25 +186,9 @@ var i3_i: i3; >i3 : i3 i3_i = { ->i3_i = { - f: /**own f*/ (/**i3_i a*/a: number) => "Hello" + a, - l: this.f, - /** own x*/ - x: this.f(10), - nc_x: this.l(this.x), - nc_f: this.f, - nc_l: this.l -} : { f: (a: number) => string; l: any; x: any; nc_x: any; nc_f: any; nc_l: any; } +>i3_i = { f: /**own f*/ (/**i3_i a*/a: number) => "Hello" + a, l: this.f, /** own x*/ x: this.f(10), nc_x: this.l(this.x), nc_f: this.f, nc_l: this.l} : { f: (a: number) => string; l: any; x: any; nc_x: any; nc_f: any; nc_l: any; } >i3_i : i3 ->{ - f: /**own f*/ (/**i3_i a*/a: number) => "Hello" + a, - l: this.f, - /** own x*/ - x: this.f(10), - nc_x: this.l(this.x), - nc_f: this.f, - nc_l: this.l -} : { f: (a: number) => string; l: any; x: any; nc_x: any; nc_f: any; nc_l: any; } +>{ f: /**own f*/ (/**i3_i a*/a: number) => "Hello" + a, l: this.f, /** own x*/ x: this.f(10), nc_x: this.l(this.x), nc_f: this.f, nc_l: this.l} : { f: (a: number) => string; l: any; x: any; nc_x: any; nc_f: any; nc_l: any; } f: /**own f*/ (/**i3_i a*/a: number) => "Hello" + a, >f : (a: number) => string diff --git a/tests/baselines/reference/commentsModules.types b/tests/baselines/reference/commentsModules.types index 253ec964c1d..8302ef5b517 100644 --- a/tests/baselines/reference/commentsModules.types +++ b/tests/baselines/reference/commentsModules.types @@ -9,7 +9,7 @@ module m1 { /** foo's comment*/ function foo() { ->foo : () => number +>foo : typeof foo return b; >b : number @@ -31,16 +31,16 @@ module m1 { } /** exported function*/ export function fooExport() { ->fooExport : () => number +>fooExport : typeof fooExport return foo(); >foo() : number ->foo : () => number +>foo : typeof foo } // shouldn't appear export function foo2Export(/**hm*/ a: string) { ->foo2Export : (a: string) => void +>foo2Export : typeof foo2Export >a : string } @@ -48,21 +48,21 @@ module m1 { * comment */ export function foo3Export() { ->foo3Export : () => void +>foo3Export : typeof foo3Export } /** foo4Export * comment */ function foo4Export() { ->foo4Export : () => void +>foo4Export : typeof foo4Export } } // trailing comment module m1.fooExport(); >m1.fooExport() : number ->m1.fooExport : () => number +>m1.fooExport : typeof fooExport >m1 : typeof m1 ->fooExport : () => number +>fooExport : typeof fooExport var myvar = new m1.m2.c(); >myvar : c diff --git a/tests/baselines/reference/commentsMultiModuleMultiFile.errors.txt b/tests/baselines/reference/commentsMultiModuleMultiFile.errors.txt new file mode 100644 index 00000000000..4f6d83c47ce --- /dev/null +++ b/tests/baselines/reference/commentsMultiModuleMultiFile.errors.txt @@ -0,0 +1,41 @@ +==== tests/cases/compiler/commentsMultiModuleMultiFile_1.ts (0 errors) ==== + import m = require('commentsMultiModuleMultiFile_0'); + /** this is multi module 3 comment*/ + module multiM { + /** class d comment*/ + export class d { + } + + /// class f comment + export class f { + } + } + new multiM.d(); +==== tests/cases/compiler/commentsMultiModuleMultiFile_0.ts (3 errors) ==== + + /** this is multi declare module*/ + export module multiM { + ~~~~~~ +!!! Individual declarations in merged declaration multiM must be all exported or all local. + /// class b comment + export class b { + } + } + /** thi is multi module 2*/ + module multiM { + ~~~~~~ +!!! Individual declarations in merged declaration multiM must be all exported or all local. + /** class c comment*/ + export class c { + } + + // class e comment + export class e { + } + } + + new multiM.b(); + new multiM.c(); + ~ +!!! Property 'c' does not exist on type 'typeof multiM'. + \ No newline at end of file diff --git a/tests/baselines/reference/commentsMultiModuleMultiFile.js b/tests/baselines/reference/commentsMultiModuleMultiFile.js index 2c0cf2b837e..80a971a8e27 100644 --- a/tests/baselines/reference/commentsMultiModuleMultiFile.js +++ b/tests/baselines/reference/commentsMultiModuleMultiFile.js @@ -9,7 +9,7 @@ export module multiM { } } /** thi is multi module 2*/ -export module multiM { +module multiM { /** class c comment*/ export class c { } @@ -25,7 +25,7 @@ new multiM.c(); //// [commentsMultiModuleMultiFile_1.ts] import m = require('commentsMultiModuleMultiFile_0'); /** this is multi module 3 comment*/ -export module multiM { +module multiM { /** class d comment*/ export class d { } @@ -50,6 +50,7 @@ define(["require", "exports"], function (require, exports) { })(exports.multiM || (exports.multiM = {})); var multiM = exports.multiM; /** thi is multi module 2*/ + var multiM; (function (multiM) { /** class c comment*/ var c = (function () { @@ -65,14 +66,14 @@ define(["require", "exports"], function (require, exports) { return e; })(); multiM.e = e; - })(exports.multiM || (exports.multiM = {})); - var multiM = exports.multiM; + })(multiM || (multiM = {})); new multiM.b(); new multiM.c(); }); //// [commentsMultiModuleMultiFile_1.js] define(["require", "exports"], function (require, exports) { /** this is multi module 3 comment*/ + var multiM; (function (multiM) { /** class d comment*/ var d = (function () { @@ -88,8 +89,7 @@ define(["require", "exports"], function (require, exports) { return f; })(); multiM.f = f; - })(exports.multiM || (exports.multiM = {})); - var multiM = exports.multiM; + })(multiM || (multiM = {})); new multiM.d(); }); diff --git a/tests/baselines/reference/commentsMultiModuleMultiFile.types b/tests/baselines/reference/commentsMultiModuleMultiFile.types deleted file mode 100644 index cb3db3961f0..00000000000 --- a/tests/baselines/reference/commentsMultiModuleMultiFile.types +++ /dev/null @@ -1,62 +0,0 @@ -=== tests/cases/compiler/commentsMultiModuleMultiFile_1.ts === -import m = require('commentsMultiModuleMultiFile_0'); ->m : typeof "tests/cases/compiler/commentsMultiModuleMultiFile_0" - -/** this is multi module 3 comment*/ -export module multiM { ->multiM : typeof multiM - - /** class d comment*/ - export class d { ->d : d - } - - /// class f comment - export class f { ->f : f - } -} -new multiM.d(); ->new multiM.d() : d ->multiM.d : typeof d ->multiM : typeof multiM ->d : typeof d - -=== tests/cases/compiler/commentsMultiModuleMultiFile_0.ts === - -/** this is multi declare module*/ -export module multiM { ->multiM : typeof multiM - - /// class b comment - export class b { ->b : b - } -} -/** thi is multi module 2*/ -export module multiM { ->multiM : typeof multiM - - /** class c comment*/ - export class c { ->c : c - } - - // class e comment - export class e { ->e : e - } -} - -new multiM.b(); ->new multiM.b() : b ->multiM.b : typeof b ->multiM : typeof multiM ->b : typeof b - -new multiM.c(); ->new multiM.c() : c ->multiM.c : typeof c ->multiM : typeof multiM ->c : typeof c - diff --git a/tests/baselines/reference/commentsOnObjectLiteral3.types b/tests/baselines/reference/commentsOnObjectLiteral3.types index b9bdc09506f..e7770c7e273 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral3.types +++ b/tests/baselines/reference/commentsOnObjectLiteral3.types @@ -2,23 +2,7 @@ var v = { >v : { prop: number; func: () => void; func1: () => void; a: any; } ->{ - //property - prop: 1 /* multiple trailing comments */ /*trailing comments*/, - //property - func: function () { - }, - //PropertyName + CallSignature - func1() { }, - //getter - get a() { - return this.prop; - } /*trailing 1*/, - //setter - set a(value) { - this.prop = value; - } // trailing 2 -} : { prop: number; func: () => void; func1: () => void; a: any; } +>{ //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, //property func: function () { }, //PropertyName + CallSignature func1() { }, //getter get a() { return this.prop; } /*trailing 1*/, //setter set a(value) { this.prop = value; } // trailing 2} : { prop: number; func: () => void; func1: () => void; a: any; } //property prop: 1 /* multiple trailing comments */ /*trailing comments*/, @@ -27,8 +11,7 @@ var v = { //property func: function () { >func : () => void ->function () { - } : () => void +>function () { } : () => void }, //PropertyName + CallSignature diff --git a/tests/baselines/reference/commentsOnObjectLiteral4.types b/tests/baselines/reference/commentsOnObjectLiteral4.types index 6f89ba78ea4..364df6e5ea1 100644 --- a/tests/baselines/reference/commentsOnObjectLiteral4.types +++ b/tests/baselines/reference/commentsOnObjectLiteral4.types @@ -2,14 +2,7 @@ var v = { >v : { bar: number; } ->{ - /** - * @type {number} - */ - get bar(): number { - return this._bar; - } -} : { bar: number; } +>{ /** * @type {number} */ get bar(): number { return this._bar; }} : { bar: number; } /** * @type {number} diff --git a/tests/baselines/reference/commentsOnReturnStatement1.types b/tests/baselines/reference/commentsOnReturnStatement1.types index 0d447b6536f..c9604beaba9 100644 --- a/tests/baselines/reference/commentsOnReturnStatement1.types +++ b/tests/baselines/reference/commentsOnReturnStatement1.types @@ -3,7 +3,7 @@ class DebugClass { >DebugClass : DebugClass public static debugFunc() { ->debugFunc : () => boolean +>debugFunc : typeof debugFunc // Start Debugger Test Code var i = 0; diff --git a/tests/baselines/reference/commentsOverloads.types b/tests/baselines/reference/commentsOverloads.types index 9984c1b5b26..c9fc0517fd4 100644 --- a/tests/baselines/reference/commentsOverloads.types +++ b/tests/baselines/reference/commentsOverloads.types @@ -1,96 +1,96 @@ === tests/cases/compiler/commentsOverloads.ts === /** this is signature 1*/ function f1(/**param a*/a: number): number; ->f1 : { (a: number): number; (b: string): number; } +>f1 : typeof f1 >a : number function f1(b: string): number; ->f1 : { (a: number): number; (b: string): number; } +>f1 : typeof f1 >b : string function f1(aOrb: any) { ->f1 : { (a: number): number; (b: string): number; } +>f1 : typeof f1 >aOrb : any return 10; } f1("hello"); >f1("hello") : number ->f1 : { (a: number): number; (b: string): number; } +>f1 : typeof f1 f1(10); >f1(10) : number ->f1 : { (a: number): number; (b: string): number; } +>f1 : typeof f1 function f2(a: number): number; ->f2 : { (a: number): number; (b: string): number; } +>f2 : typeof f2 >a : number /** this is signature 2*/ function f2(b: string): number; ->f2 : { (a: number): number; (b: string): number; } +>f2 : typeof f2 >b : string /** this is f2 var comment*/ function f2(aOrb: any) { ->f2 : { (a: number): number; (b: string): number; } +>f2 : typeof f2 >aOrb : any return 10; } f2("hello"); >f2("hello") : number ->f2 : { (a: number): number; (b: string): number; } +>f2 : typeof f2 f2(10); >f2(10) : number ->f2 : { (a: number): number; (b: string): number; } +>f2 : typeof f2 function f3(a: number): number; ->f3 : { (a: number): number; (b: string): number; } +>f3 : typeof f3 >a : number function f3(b: string): number; ->f3 : { (a: number): number; (b: string): number; } +>f3 : typeof f3 >b : string function f3(aOrb: any) { ->f3 : { (a: number): number; (b: string): number; } +>f3 : typeof f3 >aOrb : any return 10; } f3("hello"); >f3("hello") : number ->f3 : { (a: number): number; (b: string): number; } +>f3 : typeof f3 f3(10); >f3(10) : number ->f3 : { (a: number): number; (b: string): number; } +>f3 : typeof f3 /** this is signature 4 - with number parameter*/ function f4(/**param a*/a: number): number; ->f4 : { (a: number): number; (b: string): number; } +>f4 : typeof f4 >a : number /** this is signature 4 - with string parameter*/ function f4(b: string): number; ->f4 : { (a: number): number; (b: string): number; } +>f4 : typeof f4 >b : string function f4(aOrb: any) { ->f4 : { (a: number): number; (b: string): number; } +>f4 : typeof f4 >aOrb : any return 10; } f4("hello"); >f4("hello") : number ->f4 : { (a: number): number; (b: string): number; } +>f4 : typeof f4 f4(10); >f4(10) : number ->f4 : { (a: number): number; (b: string): number; } +>f4 : typeof f4 interface i1 { >i1 : i1 diff --git a/tests/baselines/reference/commentsPropertySignature1.types b/tests/baselines/reference/commentsPropertySignature1.types index c2fe276a410..857b0c98ee5 100644 --- a/tests/baselines/reference/commentsPropertySignature1.types +++ b/tests/baselines/reference/commentsPropertySignature1.types @@ -1,10 +1,7 @@ === tests/cases/compiler/commentsPropertySignature1.ts === var a = { >a : { x: number; } ->{ - /** own x*/ - x: 0 -} : { x: number; } +>{ /** own x*/ x: 0} : { x: number; } /** own x*/ x: 0 diff --git a/tests/baselines/reference/commentsTypeParameters.types b/tests/baselines/reference/commentsTypeParameters.types index 573dabed7da..056a65f8073 100644 --- a/tests/baselines/reference/commentsTypeParameters.types +++ b/tests/baselines/reference/commentsTypeParameters.types @@ -11,7 +11,7 @@ class C { >U : U } static staticmethod(a: U) { ->staticmethod : (a: U) => void +>staticmethod : typeof staticmethod >U : U >a : U >U : U @@ -25,7 +25,7 @@ class C { >U : U } private static privatestaticmethod(a: U) { ->privatestaticmethod : (a: U) => void +>privatestaticmethod : typeof privatestaticmethod >U : U >a : U >U : U @@ -33,7 +33,7 @@ class C { } function compare(a: T, b: T) { ->compare : (a: T, b: T) => boolean +>compare : typeof compare >T : T >a : T >T : T diff --git a/tests/baselines/reference/commentsdoNotEmitComments.types b/tests/baselines/reference/commentsdoNotEmitComments.types index 8cc0b26028d..b625fc41b87 100644 --- a/tests/baselines/reference/commentsdoNotEmitComments.types +++ b/tests/baselines/reference/commentsdoNotEmitComments.types @@ -6,7 +6,7 @@ var myVariable = 10; /** function comments*/ function foo(/** parameter comment*/p: number) { ->foo : (p: number) => void +>foo : typeof foo >p : number } @@ -16,7 +16,7 @@ var fooVar: () => void; foo(50); >foo(50) : void ->foo : (p: number) => void +>foo : typeof foo fooVar(); >fooVar() : void diff --git a/tests/baselines/reference/commentsemitComments.types b/tests/baselines/reference/commentsemitComments.types index 0defb522428..e9da4d5f46d 100644 --- a/tests/baselines/reference/commentsemitComments.types +++ b/tests/baselines/reference/commentsemitComments.types @@ -6,7 +6,7 @@ var myVariable = 10; /** function comments*/ function foo(/** parameter comment*/p: number) { ->foo : (p: number) => void +>foo : typeof foo >p : number } @@ -16,7 +16,7 @@ var fooVar: () => void; foo(50); >foo(50) : void ->foo : (p: number) => void +>foo : typeof foo fooVar(); >fooVar() : void diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.types b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.types index b545fdc9f1a..32a6a69f671 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.types +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalTypeParameter.types @@ -1,6 +1,6 @@ === tests/cases/conformance/expressions/binaryOperators/comparisonOperator/comparisonOperatorWithIdenticalTypeParameter.ts === function foo(t: T) { ->foo : (t: T) => void +>foo : typeof foo >T : T >t : T >T : T diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types index e132f03cfa3..a4be3dfa27d 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsAny.types @@ -9,7 +9,7 @@ enum E { a, b, c } >c : E function foo(t: T) { ->foo : (t: T) => void +>foo : typeof foo >T : T >t : T >T : T diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types index d1b30eb7f6a..a1ed285e96c 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsNull.types @@ -6,7 +6,7 @@ enum E { a, b, c } >c : E function foo(t: T) { ->foo : (t: T) => void +>foo : typeof foo >T : T >t : T >T : T diff --git a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types index b4a70c3e3d6..a7b92a27c40 100644 --- a/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types +++ b/tests/baselines/reference/comparisonOperatorWithOneOperandIsUndefined.types @@ -10,7 +10,7 @@ enum E { a, b, c } >c : E function foo(t: T) { ->foo : (t: T) => void +>foo : typeof foo >T : T >t : T >T : T diff --git a/tests/baselines/reference/complexClassRelationships.types b/tests/baselines/reference/complexClassRelationships.types index 69bee9caade..3b34e1295b1 100644 --- a/tests/baselines/reference/complexClassRelationships.types +++ b/tests/baselines/reference/complexClassRelationships.types @@ -5,7 +5,7 @@ class Derived extends Base { >Base : Base public static createEmpty(): Derived { ->createEmpty : () => Derived +>createEmpty : typeof createEmpty >Derived : Derived var item = new Derived(); @@ -58,7 +58,7 @@ class ComponentCollection { >T : T private static sortComponents(p: Foo) { ->sortComponents : (p: Foo) => GenericType +>sortComponents : typeof sortComponents >p : Foo >Foo : Foo @@ -97,9 +97,9 @@ class Foo { >new BaseCollection(Derived.createEmpty) : BaseCollection >BaseCollection : typeof BaseCollection >Derived : Derived ->Derived.createEmpty : () => Derived +>Derived.createEmpty : typeof createEmpty >Derived : typeof Derived ->createEmpty : () => Derived +>createEmpty : typeof createEmpty } } diff --git a/tests/baselines/reference/complicatedPrivacy.errors.txt b/tests/baselines/reference/complicatedPrivacy.errors.txt index 443fefd9487..b28321e6caf 100644 --- a/tests/baselines/reference/complicatedPrivacy.errors.txt +++ b/tests/baselines/reference/complicatedPrivacy.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/compiler/complicatedPrivacy.ts (4 errors) ==== +==== tests/cases/compiler/complicatedPrivacy.ts (5 errors) ==== module m1 { export module m2 { @@ -11,11 +11,13 @@ export class C2 implements m3.i3 { public get p1(arg) { ~~ -!!! A 'get' accessor cannot have parameters. +!!! Accessors are only available when targeting ECMAScript 5 and higher. return new C1(); } public set p1(arg1: C1) { + ~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. } public f55() { diff --git a/tests/baselines/reference/compositeGenericFunction.types b/tests/baselines/reference/compositeGenericFunction.types index 421b7bbe514..2711c0fabc0 100644 --- a/tests/baselines/reference/compositeGenericFunction.types +++ b/tests/baselines/reference/compositeGenericFunction.types @@ -1,13 +1,13 @@ === tests/cases/compiler/compositeGenericFunction.ts === function f(value: T) { return value; }; ->f : (value: T) => T +>f : typeof f >T : T >value : T >T : T >value : T function h(func: (x: number) => R): R { return null; } ->h : (func: (x: number) => R) => R +>h : typeof h >R : R >func : (x: number) => R >x : number @@ -17,12 +17,12 @@ function h(func: (x: number) => R): R { return null; } var z: number = h(f); >z : number >h(f) : number ->h : (func: (x: number) => R) => R ->f : (value: T) => T +>h : typeof h +>f : typeof f var z: number = h(f); >z : number >h(f) : number ->h : (func: (x: number) => R) => R ->f : (value: T) => T +>h : typeof h +>f : typeof f diff --git a/tests/baselines/reference/compoundAssignmentLHSIsReference.types b/tests/baselines/reference/compoundAssignmentLHSIsReference.types index e30cf19f3e3..1234d6fb876 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsReference.types +++ b/tests/baselines/reference/compoundAssignmentLHSIsReference.types @@ -17,7 +17,7 @@ x1 += value; >value : any function fn1(x2: number) { ->fn1 : (x2: number) => void +>fn1 : typeof fn1 >x2 : number x2 *= value; @@ -76,7 +76,7 @@ x3['a'] += value; >value : any function fn2(x4: number) { ->fn2 : (x4: number) => void +>fn2 : typeof fn2 >x4 : number (x4) *= value; diff --git a/tests/baselines/reference/conditionalExpressions2.types b/tests/baselines/reference/conditionalExpressions2.types index 7fa483ad348..a85b4889444 100644 --- a/tests/baselines/reference/conditionalExpressions2.types +++ b/tests/baselines/reference/conditionalExpressions2.types @@ -38,7 +38,7 @@ var h = [{h:5}, null]; >h : number function i() { if (true) { return { x: 5 }; } else { return null; } } ->i : () => { x: number; } +>i : typeof i >{ x: 5 } : { x: number; } >x : number diff --git a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types index 3396885509a..2182a6864c2 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsNumberType.types @@ -95,7 +95,7 @@ condNumber ? exprIsObject1 : exprIsObject2; //Cond is a number type expression function foo() { return 1 }; ->foo : () => number +>foo : typeof foo var array = [1, 2, 3]; >array : number[] @@ -123,7 +123,7 @@ var array = [1, 2, 3]; foo() ? exprString1 : exprString2; >foo() ? exprString1 : exprString2 : string >foo() : number ->foo : () => number +>foo : typeof foo >exprString1 : string >exprString2 : string @@ -131,7 +131,7 @@ foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo() / array[1] ? exprIsObject1 : exprIsObject2 : Object >foo() / array[1] : number >foo() : number ->foo : () => number +>foo : typeof foo >array[1] : number >array : number[] >exprIsObject1 : Object @@ -230,7 +230,7 @@ var resultIsString3 = foo() ? exprString1 : exprString2; >resultIsString3 : string >foo() ? exprString1 : exprString2 : string >foo() : number ->foo : () => number +>foo : typeof foo >exprString1 : string >exprString2 : string @@ -239,7 +239,7 @@ var resultIsObject3 = foo() / array[1] ? exprIsObject1 : exprIsObject2; >foo() / array[1] ? exprIsObject1 : exprIsObject2 : Object >foo() / array[1] : number >foo() : number ->foo : () => number +>foo : typeof foo >array[1] : number >array : number[] >exprIsObject1 : Object diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types index 36c15d64c54..d72ef94a175 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.types @@ -37,7 +37,7 @@ var exprIsObject2: Object; >Object : Object function foo() { }; ->foo : () => void +>foo : typeof foo class C { static doIt: () => void }; >C : C @@ -126,7 +126,7 @@ condObject ? exprIsObject1 : exprIsObject2; foo() ? exprAny1 : exprAny2; >foo() ? exprAny1 : exprAny2 : any >foo() : void ->foo : () => void +>foo : typeof foo >exprAny1 : any >exprAny2 : any @@ -254,7 +254,7 @@ var resultIsAny3 = foo() ? exprAny1 : exprAny2; >resultIsAny3 : any >foo() ? exprAny1 : exprAny2 : any >foo() : void ->foo : () => void +>foo : typeof foo >exprAny1 : any >exprAny2 : any diff --git a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types index 668e0fc437c..dd316991075 100644 --- a/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types +++ b/tests/baselines/reference/conditionalOperatorConditoinIsStringType.types @@ -94,7 +94,7 @@ condString ? exprIsObject1 : exprIsObject2; //Cond is a string type expression function foo() { return "string" }; ->foo : () => string +>foo : typeof foo var array = ["1", "2", "3"]; >array : string[] @@ -125,7 +125,7 @@ condString + "string" ? exprNumber1 : exprNumber2; foo() ? exprString1 : exprString2; >foo() ? exprString1 : exprString2 : string >foo() : string ->foo : () => string +>foo : typeof foo >exprString1 : string >exprString2 : string @@ -231,7 +231,7 @@ var resultIsString3 = foo() ? exprString1 : exprString2; >resultIsString3 : string >foo() ? exprString1 : exprString2 : string >foo() : string ->foo : () => string +>foo : typeof foo >exprString1 : string >exprString2 : string diff --git a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.types b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.types index 021574dfbfa..4affab88a68 100644 --- a/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.types +++ b/tests/baselines/reference/conditionallyDuplicateOverloadsCausedByOverloadResolution.types @@ -1,31 +1,21 @@ === tests/cases/compiler/conditionallyDuplicateOverloadsCausedByOverloadResolution.ts === declare function foo(func: (x: string, y: string) => any): boolean; ->foo : { (func: (x: string, y: string) => any): boolean; (func: (x: string, y: number) => any): string; } +>foo : typeof foo >func : (x: string, y: string) => any >x : string >y : string declare function foo(func: (x: string, y: number) => any): string; ->foo : { (func: (x: string, y: string) => any): boolean; (func: (x: string, y: number) => any): string; } +>foo : typeof foo >func : (x: string, y: number) => any >x : string >y : number var out = foo((x, y) => { >out : boolean ->foo((x, y) => { - function bar(a: typeof x): void; - function bar(b: typeof y): void; - function bar() { } - return bar; -}) : boolean ->foo : { (func: (x: string, y: string) => any): boolean; (func: (x: string, y: number) => any): string; } ->(x, y) => { - function bar(a: typeof x): void; - function bar(b: typeof y): void; - function bar() { } - return bar; -} : (x: string, y: string) => { (a: string): void; (b: string): void; } +>foo((x, y) => { function bar(a: typeof x): void; function bar(b: typeof y): void; function bar() { } return bar;}) : boolean +>foo : typeof foo +>(x, y) => { function bar(a: typeof x): void; function bar(b: typeof y): void; function bar() { } return bar;} : (x: string, y: string) => { (a: string): void; (b: string): void; } >x : string >y : string @@ -48,34 +38,22 @@ var out = foo((x, y) => { }); declare function foo2(func: (x: string, y: string) => any): boolean; ->foo2 : { (func: (x: string, y: string) => any): boolean; (func: (x: string, y: number) => any): string; } +>foo2 : typeof foo2 >func : (x: string, y: string) => any >x : string >y : string declare function foo2(func: (x: string, y: number) => any): string; ->foo2 : { (func: (x: string, y: string) => any): boolean; (func: (x: string, y: number) => any): string; } +>foo2 : typeof foo2 >func : (x: string, y: number) => any >x : string >y : number var out2 = foo2((x, y) => { >out2 : boolean ->foo2((x, y) => { - var bar: { - (a: typeof x): void; - (b: typeof y): void; - }; - return bar; -}) : boolean ->foo2 : { (func: (x: string, y: string) => any): boolean; (func: (x: string, y: number) => any): string; } ->(x, y) => { - var bar: { - (a: typeof x): void; - (b: typeof y): void; - }; - return bar; -} : (x: string, y: string) => { (a: string): void; (b: string): void; } +>foo2((x, y) => { var bar: { (a: typeof x): void; (b: typeof y): void; }; return bar;}) : boolean +>foo2 : typeof foo2 +>(x, y) => { var bar: { (a: typeof x): void; (b: typeof y): void; }; return bar;} : (x: string, y: string) => { (a: string): void; (b: string): void; } >x : string >y : string diff --git a/tests/baselines/reference/constantOverloadFunction.types b/tests/baselines/reference/constantOverloadFunction.types index 1e74486cb32..aa2710a8c66 100644 --- a/tests/baselines/reference/constantOverloadFunction.types +++ b/tests/baselines/reference/constantOverloadFunction.types @@ -19,27 +19,27 @@ class Derived3 extends Base { biz() { } } >biz : () => void function foo(tagName: 'canvas'): Derived1; ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } +>foo : typeof foo >tagName : 'canvas' >Derived1 : Derived1 function foo(tagName: 'div'): Derived2; ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } +>foo : typeof foo >tagName : 'div' >Derived2 : Derived2 function foo(tagName: 'span'): Derived3; ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } +>foo : typeof foo >tagName : 'span' >Derived3 : Derived3 function foo(tagName: string): Base; ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } +>foo : typeof foo >tagName : string >Base : Base function foo(tagName: any): Base { ->foo : { (tagName: 'canvas'): Derived1; (tagName: 'div'): Derived2; (tagName: 'span'): Derived3; (tagName: string): Base; } +>foo : typeof foo >tagName : any >Base : Base diff --git a/tests/baselines/reference/constraintPropagationThroughReturnTypes.types b/tests/baselines/reference/constraintPropagationThroughReturnTypes.types index 6f56cca28cc..d8a7a5b9991 100644 --- a/tests/baselines/reference/constraintPropagationThroughReturnTypes.types +++ b/tests/baselines/reference/constraintPropagationThroughReturnTypes.types @@ -1,6 +1,6 @@ === tests/cases/compiler/constraintPropagationThroughReturnTypes.ts === function g(x: T): T { ->g : (x: T) => T +>g : typeof g >T : T >x : T >T : T @@ -11,7 +11,7 @@ function g(x: T): T { } function f(x: S) { ->f : (x: S) => void +>f : typeof f >S : S >foo : string >x : S @@ -20,7 +20,7 @@ function f(x: S) { var y = g(x); >y : S >g(x) : S ->g : (x: T) => T +>g : typeof g >x : S y; diff --git a/tests/baselines/reference/constraintSatisfactionWithAny.types b/tests/baselines/reference/constraintSatisfactionWithAny.types index e007d3cec73..7e88d4044af 100644 --- a/tests/baselines/reference/constraintSatisfactionWithAny.types +++ b/tests/baselines/reference/constraintSatisfactionWithAny.types @@ -2,7 +2,7 @@ // any is not a valid type argument unless there is no constraint, or the constraint is any function foo(x: T): T { return null; } ->foo : (x: T) => T +>foo : typeof foo >T : T >String : String >x : T @@ -10,7 +10,7 @@ function foo(x: T): T { return null; } >T : T function foo2(x: T): T { return null; } ->foo2 : (x: T) => T +>foo2 : typeof foo2 >T : T >x : number >x : T @@ -19,7 +19,7 @@ function foo2(x: T): T { return null; } //function foo3(x: T): T { return null; } function foo4(x: T) => void>(x: T): T { return null; } ->foo4 : (x: T) => void>(x: T) => T +>foo4 : typeof foo4 >T : T >T : T >x : T @@ -33,18 +33,18 @@ var a; foo(a); >foo(a) : any ->foo : (x: T) => T +>foo : typeof foo >a : any foo2(a); >foo2(a) : any ->foo2 : (x: T) => T +>foo2 : typeof foo2 >a : any //foo3(a); foo4(a); >foo4(a) : any ->foo4 : (x: T) => void>(x: T) => T +>foo4 : typeof foo4 >a : any var b: number; @@ -52,18 +52,18 @@ var b: number; foo(b); >foo(b) : any ->foo : (x: T) => T +>foo : typeof foo >b : number foo2(b); >foo2(b) : any ->foo2 : (x: T) => T +>foo2 : typeof foo2 >b : number //foo3(b); foo4(b); >foo4(b) : any ->foo4 : (x: T) => void>(x: T) => T +>foo4 : typeof foo4 >b : number //function foo5(x: T, y: U): T { return null; } diff --git a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.types b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.types index 113736bdd11..a36b8e5ec65 100644 --- a/tests/baselines/reference/constraintSatisfactionWithEmptyObject.types +++ b/tests/baselines/reference/constraintSatisfactionWithEmptyObject.types @@ -3,7 +3,7 @@ // Object constraint function foo(x: T) { } ->foo : (x: T) => void +>foo : typeof foo >T : T >Object : Object >x : T @@ -12,7 +12,7 @@ function foo(x: T) { } var r = foo({}); >r : void >foo({}) : void ->foo : (x: T) => void +>foo : typeof foo >{} : {} var a = {}; @@ -22,7 +22,7 @@ var a = {}; var r = foo({}); >r : void >foo({}) : void ->foo : (x: T) => void +>foo : typeof foo >{} : {} class C { @@ -56,7 +56,7 @@ var i: I<{}>; // {} constraint function foo2(x: T) { } ->foo2 : (x: T) => void +>foo2 : typeof foo2 >T : T >x : T >T : T @@ -64,7 +64,7 @@ function foo2(x: T) { } var r = foo2({}); >r : void >foo2({}) : void ->foo2 : (x: T) => void +>foo2 : typeof foo2 >{} : {} var a = {}; @@ -74,7 +74,7 @@ var a = {}; var r = foo2({}); >r : void >foo2({}) : void ->foo2 : (x: T) => void +>foo2 : typeof foo2 >{} : {} class C2 { diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.types b/tests/baselines/reference/constructorArgWithGenericCallSignature.types index de3ed3ae5f1..acd7528976f 100644 --- a/tests/baselines/reference/constructorArgWithGenericCallSignature.types +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.types @@ -20,7 +20,7 @@ module Test { } export function F(func: MyFunc) { } ->F : (func: MyFunc) => void +>F : typeof F >func : MyFunc >MyFunc : MyFunc } @@ -31,9 +31,9 @@ var func: Test.MyFunc; Test.F(func); // OK >Test.F(func) : void ->Test.F : (func: MyFunc) => void +>Test.F : typeof F >Test : typeof Test ->F : (func: MyFunc) => void +>F : typeof F >func : MyFunc var test = new Test.MyClass(func); // Should be OK diff --git a/tests/baselines/reference/constructorArgsErrors3.errors.txt b/tests/baselines/reference/constructorArgsErrors3.errors.txt deleted file mode 100644 index b01950da279..00000000000 --- a/tests/baselines/reference/constructorArgsErrors3.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -==== tests/cases/compiler/constructorArgsErrors3.ts (1 errors) ==== - class foo { - constructor (public public a: number) { - ~~~~~~ -!!! Accessibility modifier already seen. - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors4.errors.txt b/tests/baselines/reference/constructorArgsErrors4.errors.txt deleted file mode 100644 index 431844358ee..00000000000 --- a/tests/baselines/reference/constructorArgsErrors4.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -==== tests/cases/compiler/constructorArgsErrors4.ts (1 errors) ==== - class foo { - constructor (private public a: number) { - ~~~~~~ -!!! Accessibility modifier already seen. - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/constructorArgsErrors5.errors.txt b/tests/baselines/reference/constructorArgsErrors5.errors.txt deleted file mode 100644 index 176a2b7db06..00000000000 --- a/tests/baselines/reference/constructorArgsErrors5.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -==== tests/cases/compiler/constructorArgsErrors5.ts (1 errors) ==== - class foo { - constructor (export a: number) { - ~~~~~~ -!!! 'export' modifier cannot appear on a parameter. - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt b/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt deleted file mode 100644 index d7ba7dcf92b..00000000000 --- a/tests/baselines/reference/constructorsWithSpecializedSignatures.errors.txt +++ /dev/null @@ -1,60 +0,0 @@ -==== tests/cases/compiler/constructorsWithSpecializedSignatures.ts (8 errors) ==== - // errors - declare class C { - constructor(x: "hi"); - ~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. - constructor(x: "foo"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. - constructor(x: number); - } - - // ok - declare class C2 { - constructor(x: "hi"); - constructor(x: "foo"); - constructor(x: string); - } - - // errors - class D { - constructor(x: "hi"); - ~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. - constructor(x: "foo"); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. - constructor(x: number); - constructor(x: "hi") { } - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. - } - - // overloads are ok - class D2 { - constructor(x: "hi"); - constructor(x: "foo"); - constructor(x: string); - constructor(x: "hi") { } // error - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! A signature with an implementation cannot use a string literal type. - } - - // errors - interface I { - new (x: "hi"); - ~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. - new (x: "foo"); - ~~~~~~~~~~~~~~~ -!!! Specialized overload signature is not assignable to any non-specialized signature. - new (x: number); - } - - // ok - interface I2 { - new (x: "hi"); - new (x: "foo"); - new (x: string); - } \ No newline at end of file diff --git a/tests/baselines/reference/contextualSigInstantiationRestParams.types b/tests/baselines/reference/contextualSigInstantiationRestParams.types index 76a00310fd9..6dc06be50fc 100644 --- a/tests/baselines/reference/contextualSigInstantiationRestParams.types +++ b/tests/baselines/reference/contextualSigInstantiationRestParams.types @@ -1,6 +1,6 @@ === tests/cases/compiler/contextualSigInstantiationRestParams.ts === declare function toInstantiate(a?: A, b?: B): B; ->toInstantiate : (a?: A, b?: B) => B +>toInstantiate : typeof toInstantiate >A : A >B : B >a : A @@ -10,11 +10,11 @@ declare function toInstantiate(a?: A, b?: B): B; >B : B declare function contextual(...s: string[]): string ->contextual : (...s: string[]) => string +>contextual : typeof contextual >s : string[] var sig: typeof contextual = toInstantiate; ->sig : (...s: string[]) => string ->contextual : (...s: string[]) => string ->toInstantiate : (a?: A, b?: B) => B +>sig : typeof contextual +>contextual : typeof contextual +>toInstantiate : typeof toInstantiate diff --git a/tests/baselines/reference/contextualSignatureInstantiation1.types b/tests/baselines/reference/contextualSignatureInstantiation1.types index 3a95e87b76f..e181cd47ab3 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation1.types +++ b/tests/baselines/reference/contextualSignatureInstantiation1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/contextualSignatureInstantiation1.ts === declare function map(f: (x: S) => T): (a: S[]) => T[]; ->map : (f: (x: S) => T) => (a: S[]) => T[] +>map : typeof map >S : S >T : T >f : (x: S) => T @@ -25,11 +25,11 @@ var e = (x: string, y?: K) => x.length; var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed >r99 : (a: {}[]) => number[] >map(e) : (a: {}[]) => number[] ->map : (f: (x: S) => T) => (a: S[]) => T[] +>map : typeof map >e : (x: string, y?: K) => number declare function map2(f: (x: S) => T): (a: S[]) => T[]; ->map2 : (f: (x: S) => T) => (a: S[]) => T[] +>map2 : typeof map2 >S : S >length : number >T : T @@ -55,6 +55,6 @@ var e2 = (x: string, y?: K) => x.length; var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number } >r100 : (a: { length: number; }[]) => number[] >map2(e2) : (a: { length: number; }[]) => number[] ->map2 : (f: (x: S) => T) => (a: S[]) => T[] +>map2 : typeof map2 >e2 : (x: string, y?: K) => number diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.types b/tests/baselines/reference/contextualSignatureInstantiation3.types deleted file mode 100644 index c6ed5a7e97d..00000000000 --- a/tests/baselines/reference/contextualSignatureInstantiation3.types +++ /dev/null @@ -1,83 +0,0 @@ -=== tests/cases/compiler/contextualSignatureInstantiation3.ts === -function map(items: T[], f: (x: T) => U): U[]{ ->map : (items: T[], f: (x: T) => U) => U[] ->T : T ->U : U ->items : T[] ->T : T ->f : (x: T) => U ->x : T ->T : T ->U : U ->U : U - - return items.map(f); ->items.map(f) : U[] ->items.map : (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[] ->items : T[] ->map : (callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any) => U[] ->f : (x: T) => U -} - -function identity(x: T) { ->identity : (x: T) => T ->T : T ->x : T ->T : T - - return x; ->x : T -} - -function singleton(x: T) { ->singleton : (x: T) => T[] ->T : T ->x : T ->T : T - - return [x]; ->[x] : T[] ->x : T -} - -var xs = [1, 2, 3]; ->xs : number[] ->[1, 2, 3] : number[] - -// Have compiler check that we get the correct types -var v1: number[]; ->v1 : number[] - -var v1 = xs.map(identity); // Error if not number[] ->v1 : number[] ->xs.map(identity) : number[] ->xs.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] ->xs : number[] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] ->identity : (x: T) => T - -var v1 = map(xs, identity); // Error if not number[] ->v1 : number[] ->map(xs, identity) : number[] ->map : (items: T[], f: (x: T) => U) => U[] ->xs : number[] ->identity : (x: T) => T - -var v2: number[][]; ->v2 : number[][] - -var v2 = xs.map(singleton); // Error if not number[][] ->v2 : number[][] ->xs.map(singleton) : number[][] ->xs.map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] ->xs : number[] ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] ->singleton : (x: T) => T[] - -var v2 = map(xs, singleton); // Error if not number[][] ->v2 : number[][] ->map(xs, singleton) : number[][] ->map : (items: T[], f: (x: T) => U) => U[] ->xs : number[] ->singleton : (x: T) => T[] - diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types index 89ea3028d94..e858596a976 100644 --- a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.types @@ -1,6 +1,6 @@ === tests/cases/compiler/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts === function f() { ->f : () => (u: U) => U +>f : typeof f >T : T function g(u: U): U { return null } @@ -31,5 +31,5 @@ var x = h("", f()); // Call should succeed and x should be string. All t >h("", f()) : string >h : (v: V, func: (v: V) => W) => W >f() : (u: U) => U ->f : () => (u: U) => U +>f : typeof f diff --git a/tests/baselines/reference/contextualTypeAppliedToVarArgs.types b/tests/baselines/reference/contextualTypeAppliedToVarArgs.types index 2ae7600faa5..b6c50514918 100644 --- a/tests/baselines/reference/contextualTypeAppliedToVarArgs.types +++ b/tests/baselines/reference/contextualTypeAppliedToVarArgs.types @@ -1,6 +1,6 @@ === tests/cases/compiler/contextualTypeAppliedToVarArgs.ts === function delegate(instance: any, method: (...args: any[]) => any, data?: any): (...args: any[]) => any { ->delegate : (instance: any, method: (...args: any[]) => any, data?: any) => (...args: any[]) => any +>delegate : typeof delegate >instance : any >method : (...args: any[]) => any >args : any[] @@ -19,18 +19,10 @@ class Foo{ >Bar : () => void delegate(this, function (source, args2) ->delegate(this, function (source, args2) - { - var a = source.node; - var b = args2.node; - } ) : (...args: any[]) => any ->delegate : (instance: any, method: (...args: any[]) => any, data?: any) => (...args: any[]) => any +>delegate(this, function (source, args2) { var a = source.node; var b = args2.node; } ) : (...args: any[]) => any +>delegate : typeof delegate >this : Foo ->function (source, args2) - { - var a = source.node; - var b = args2.node; - } : (source: any, args2: any) => void +>function (source, args2) { var a = source.node; var b = args2.node; } : (source: any, args2: any) => void >source : any >args2 : any { diff --git a/tests/baselines/reference/contextualTypeArrayReturnType.types b/tests/baselines/reference/contextualTypeArrayReturnType.types index 62790f234ce..b0cd03f8510 100644 --- a/tests/baselines/reference/contextualTypeArrayReturnType.types +++ b/tests/baselines/reference/contextualTypeArrayReturnType.types @@ -26,27 +26,15 @@ interface Transform3D { var style: IBookStyle = { >style : IBookStyle >IBookStyle : IBookStyle ->{ - initialLeftPageTransforms: (width: number) => { - return [ - {'ry': null } - ]; - } -} : { initialLeftPageTransforms: (width: number) => NamedTransform[]; } +>{ initialLeftPageTransforms: (width: number) => { return [ {'ry': null } ]; }} : { initialLeftPageTransforms: (width: number) => NamedTransform[]; } initialLeftPageTransforms: (width: number) => { >initialLeftPageTransforms : (width: number) => NamedTransform[] ->(width: number) => { - return [ - {'ry': null } - ]; - } : (width: number) => NamedTransform[] +>(width: number) => { return [ {'ry': null } ]; } : (width: number) => NamedTransform[] >width : number return [ ->[ - {'ry': null } - ] : NamedTransform[] +>[ {'ry': null } ] : NamedTransform[] {'ry': null } >{'ry': null } : { [x: string]: Transform3D; 'ry': null; } diff --git a/tests/baselines/reference/contextualTyping.errors.txt b/tests/baselines/reference/contextualTyping.errors.txt index 69bffcc5782..effbed3d516 100644 --- a/tests/baselines/reference/contextualTyping.errors.txt +++ b/tests/baselines/reference/contextualTyping.errors.txt @@ -234,5 +234,5 @@ interface B extends A { } var x: B = { }; ~ -!!! Type '{}' is not assignable to type 'B':\n Property 'x' is missing in type '{}'. - \ No newline at end of file +!!! Type '{}' is not assignable to type 'B': +!!! Property 'x' is missing in type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/contextualTyping.js b/tests/baselines/reference/contextualTyping.js index 6d9f1911038..1cc39a795c8 100644 --- a/tests/baselines/reference/contextualTyping.js +++ b/tests/baselines/reference/contextualTyping.js @@ -228,8 +228,199 @@ Point.prototype = { interface A { x: string; } interface B extends A { } -var x: B = { }; - +var x: B = { }; //// [contextualTyping.js] -// CONTEXT: Class property declaration\nvar C1T5 = (function () {\n function C1T5() {\n this.foo = function (i) {\n return i;\n };\n }\n return C1T5;\n})();\n// CONTEXT: Module property declaration\nvar C2T5;\n(function (C2T5) {\n C2T5.foo = function (i) {\n return i;\n };\n})(C2T5 || (C2T5 = {}));\n// CONTEXT: Variable declaration\nvar c3t1 = (function (s) {\n return s;\n});\nvar c3t2 = ({\n n: 1\n});\nvar c3t3 = [];\nvar c3t4 = function () {\n return ({});\n};\nvar c3t5 = function (n) {\n return ({});\n};\nvar c3t6 = function (n, s) {\n return ({});\n};\nvar c3t7 = function (n) {\n return n;\n};\nvar c3t8 = function (n) {\n return n;\n};\nvar c3t9 = [[], []];\nvar c3t10 = [({}), ({})];\nvar c3t11 = [function (n, s) {\n return s;\n}];\nvar c3t12 = {\n foo: ({})\n};\nvar c3t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c3t14 = ({\n a: []\n});\n// CONTEXT: Class property assignment\nvar C4T5 = (function () {\n function C4T5() {\n this.foo = function (i, s) {\n return s;\n };\n }\n return C4T5;\n})();\n// CONTEXT: Module property assignment\nvar C5T5;\n(function (C5T5) {\n C5T5.foo;\n C5T5.foo = function (i, s) {\n return s;\n };\n})(C5T5 || (C5T5 = {}));\n// CONTEXT: Variable assignment\nvar c6t5;\nc6t5 = function (n) {\n return ({});\n};\n// CONTEXT: Array index assignment\nvar c7t2;\nc7t2[0] = ({ n: 1 });\nvar objc8 = ({});\nobjc8.t1 = (function (s) {\n return s;\n});\nobjc8.t2 = ({\n n: 1\n});\nobjc8.t3 = [];\nobjc8.t4 = function () {\n return ({});\n};\nobjc8.t5 = function (n) {\n return ({});\n};\nobjc8.t6 = function (n, s) {\n return ({});\n};\nobjc8.t7 = function (n) {\n return n;\n};\nobjc8.t8 = function (n) {\n return n;\n};\nobjc8.t9 = [[], []];\nobjc8.t10 = [({}), ({})];\nobjc8.t11 = [function (n, s) {\n return s;\n}];\nobjc8.t12 = {\n foo: ({})\n};\nobjc8.t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nobjc8.t14 = ({\n a: []\n});\n// CONTEXT: Function call\nfunction c9t5(f) {\n}\n;\nc9t5(function (n) {\n return ({});\n});\n// CONTEXT: Return statement\nvar c10t5 = function () {\n return function (n) {\n return ({});\n };\n};\n// CONTEXT: Newing a class\nvar C11t5 = (function () {\n function C11t5(f) {\n }\n return C11t5;\n})();\n;\nvar i = new C11t5(function (n) {\n return ({});\n});\n// CONTEXT: Type annotated expression\nvar c12t1 = (function (s) {\n return s;\n});\nvar c12t2 = ({\n n: 1\n});\nvar c12t3 = [];\nvar c12t4 = function () {\n return ({});\n};\nvar c12t5 = function (n) {\n return ({});\n};\nvar c12t6 = function (n, s) {\n return ({});\n};\nvar c12t7 = function (n) {\n return n;\n};\nvar c12t8 = function (n) {\n return n;\n};\nvar c12t9 = [[], []];\nvar c12t10 = [({}), ({})];\nvar c12t11 = [function (n, s) {\n return s;\n}];\nvar c12t12 = {\n foo: ({})\n};\nvar c12t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c12t14 = ({\n a: []\n});\nfunction EF1(a, b) {\n return a + b;\n}\nvar efv = EF1(1, 2);\nfunction Point(x, y) {\n this.x = x;\n this.y = y;\n return this;\n}\nPoint.origin = new Point(0, 0);\nPoint.prototype.add = function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n};\nPoint.prototype = {\n x: 0,\n y: 0,\n add: function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n }\n};\nvar x = {};\n//# sourceMappingURL=contextualTyping.js.map \ No newline at end of file +// CONTEXT: Class property declaration\nvar C1T5 = (function () {\n function C1T5() {\n this.foo = function (i) {\n return i;\n };\n }\n return C1T5;\n})();\n// CONTEXT: Module property declaration\nvar C2T5;\n(function (C2T5) {\n C2T5.foo = function (i) {\n return i;\n };\n})(C2T5 || (C2T5 = {}));\n// CONTEXT: Variable declaration\nvar c3t1 = (function (s) {\n return s;\n});\nvar c3t2 = ({\n n: 1\n});\nvar c3t3 = [];\nvar c3t4 = function () {\n return ({});\n};\nvar c3t5 = function (n) {\n return ({});\n};\nvar c3t6 = function (n, s) {\n return ({});\n};\nvar c3t7 = function (n) {\n return n;\n};\nvar c3t8 = function (n) {\n return n;\n};\nvar c3t9 = [[], []];\nvar c3t10 = [({}), ({})];\nvar c3t11 = [function (n, s) {\n return s;\n}];\nvar c3t12 = {\n foo: ({})\n};\nvar c3t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c3t14 = ({\n a: []\n});\n// CONTEXT: Class property assignment\nvar C4T5 = (function () {\n function C4T5() {\n this.foo = function (i, s) {\n return s;\n };\n }\n return C4T5;\n})();\n// CONTEXT: Module property assignment\nvar C5T5;\n(function (C5T5) {\n C5T5.foo;\n C5T5.foo = function (i, s) {\n return s;\n };\n})(C5T5 || (C5T5 = {}));\n// CONTEXT: Variable assignment\nvar c6t5;\nc6t5 = function (n) {\n return ({});\n};\n// CONTEXT: Array index assignment\nvar c7t2;\nc7t2[0] = ({ n: 1 });\nvar objc8 = ({});\nobjc8.t1 = (function (s) {\n return s;\n});\nobjc8.t2 = ({\n n: 1\n});\nobjc8.t3 = [];\nobjc8.t4 = function () {\n return ({});\n};\nobjc8.t5 = function (n) {\n return ({});\n};\nobjc8.t6 = function (n, s) {\n return ({});\n};\nobjc8.t7 = function (n) {\n return n;\n};\nobjc8.t8 = function (n) {\n return n;\n};\nobjc8.t9 = [[], []];\nobjc8.t10 = [({}), ({})];\nobjc8.t11 = [function (n, s) {\n return s;\n}];\nobjc8.t12 = {\n foo: ({})\n};\nobjc8.t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nobjc8.t14 = ({\n a: []\n});\n// CONTEXT: Function call\nfunction c9t5(f) {\n}\n;\nc9t5(function (n) {\n return ({});\n});\n// CONTEXT: Return statement\nvar c10t5 = function () {\n return function (n) {\n return ({});\n };\n};\n// CONTEXT: Newing a class\nvar C11t5 = (function () {\n function C11t5(f) {\n }\n return C11t5;\n})();\n;\nvar i = new C11t5(function (n) {\n return ({});\n});\n// CONTEXT: Type annotated expression\nvar c12t1 = (function (s) {\n return s;\n});\nvar c12t2 = ({\n n: 1\n});\nvar c12t3 = [];\nvar c12t4 = function () {\n return ({});\n};\nvar c12t5 = function (n) {\n return ({});\n};\nvar c12t6 = function (n, s) {\n return ({});\n};\nvar c12t7 = function (n) {\n return n;\n};\nvar c12t8 = function (n) {\n return n;\n};\nvar c12t9 = [[], []];\nvar c12t10 = [({}), ({})];\nvar c12t11 = [function (n, s) {\n return s;\n}];\nvar c12t12 = {\n foo: ({})\n};\nvar c12t13 = ({\n f: function (i, s) {\n return s;\n }\n});\nvar c12t14 = ({\n a: []\n});\nfunction EF1(a, b) {\n return a + b;\n}\nvar efv = EF1(1, 2);\nfunction Point(x, y) {\n this.x = x;\n this.y = y;\n return this;\n}\nPoint.origin = new Point(0, 0);\nPoint.prototype.add = function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n};\nPoint.prototype = {\n x: 0,\n y: 0,\n add: function (dx, dy) {\n return new Point(this.x + dx, this.y + dy);\n }\n};\nvar x = {};\n//# sourceMappingURL=contextualTyping.js.map +var C1T5 = (function () { + function C1T5() { + this.foo = function (i) { + return i; + }; + } + return C1T5; +})(); +var C2T5; +(function (C2T5) { + C2T5.foo = function (i) { + return i; + }; +})(C2T5 || (C2T5 = {})); +var c3t1 = (function (s) { + return s; +}); +var c3t2 = ({ + n: 1 +}); +var c3t3 = []; +var c3t4 = function () { + return ({}); +}; +var c3t5 = function (n) { + return ({}); +}; +var c3t6 = function (n, s) { + return ({}); +}; +var c3t7 = function (n) { + return n; +}; +var c3t8 = function (n) { + return n; +}; +var c3t9 = [[], []]; +var c3t10 = [({}), ({})]; +var c3t11 = [function (n, s) { + return s; +}]; +var c3t12 = { + foo: ({}) +}; +var c3t13 = ({ + f: function (i, s) { + return s; + } +}); +var c3t14 = ({ + a: [] +}); +var C4T5 = (function () { + function C4T5() { + this.foo = function (i, s) { + return s; + }; + } + return C4T5; +})(); +var C5T5; +(function (C5T5) { + C5T5.foo; + C5T5.foo = function (i, s) { + return s; + }; +})(C5T5 || (C5T5 = {})); +var c6t5; +c6t5 = function (n) { + return ({}); +}; +var c7t2; +c7t2[0] = ({ n: 1 }); +var objc8 = ({}); +objc8.t1 = (function (s) { + return s; +}); +objc8.t2 = ({ + n: 1 +}); +objc8.t3 = []; +objc8.t4 = function () { + return ({}); +}; +objc8.t5 = function (n) { + return ({}); +}; +objc8.t6 = function (n, s) { + return ({}); +}; +objc8.t7 = function (n) { + return n; +}; +objc8.t8 = function (n) { + return n; +}; +objc8.t9 = [[], []]; +objc8.t10 = [({}), ({})]; +objc8.t11 = [function (n, s) { + return s; +}]; +objc8.t12 = { + foo: ({}) +}; +objc8.t13 = ({ + f: function (i, s) { + return s; + } +}); +objc8.t14 = ({ + a: [] +}); +function c9t5(f) { +} +; +c9t5(function (n) { + return ({}); +}); +var c10t5 = function () { + return function (n) { + return ({}); + }; +}; +var C11t5 = (function () { + function C11t5(f) { + } + return C11t5; +})(); +; +var i = new C11t5(function (n) { + return ({}); +}); +var c12t1 = (function (s) { + return s; +}); +var c12t2 = ({ + n: 1 +}); +var c12t3 = []; +var c12t4 = function () { + return ({}); +}; +var c12t5 = function (n) { + return ({}); +}; +var c12t6 = function (n, s) { + return ({}); +}; +var c12t7 = function (n) { + return n; +}; +var c12t8 = function (n) { + return n; +}; +var c12t9 = [[], []]; +var c12t10 = [({}), ({})]; +var c12t11 = [function (n, s) { + return s; +}]; +var c12t12 = { + foo: ({}) +}; +var c12t13 = ({ + f: function (i, s) { + return s; + } +}); +var c12t14 = ({ + a: [] +}); +function EF1(a, b) { + return a + b; +} +var efv = EF1(1, 2); +function Point(x, y) { + this.x = x; + this.y = y; + return this; +} +Point.origin = new Point(0, 0); +Point.prototype.add = function (dx, dy) { + return new Point(this.x + dx, this.y + dy); +}; +Point.prototype = { + x: 0, + y: 0, + add: function (dx, dy) { + return new Point(this.x + dx, this.y + dy); + } +}; +var x = {}; +//# sourceMappingURL=contextualTyping.js.map diff --git a/tests/baselines/reference/contextualTyping25.types b/tests/baselines/reference/contextualTyping25.types index 3c6442739a2..9b7b60a8715 100644 --- a/tests/baselines/reference/contextualTyping25.types +++ b/tests/baselines/reference/contextualTyping25.types @@ -1,10 +1,10 @@ === tests/cases/compiler/contextualTyping25.ts === function foo(param:{id:number;}){}; foo(<{id:number;}>({})); ->foo : (param: { id: number; }) => void +>foo : typeof foo >param : { id: number; } >id : number >foo(<{id:number;}>({})) : void ->foo : (param: { id: number; }) => void +>foo : typeof foo ><{id:number;}>({}) : { id: number; } >id : number >({}) : {} diff --git a/tests/baselines/reference/contextualTyping26.types b/tests/baselines/reference/contextualTyping26.types index 65a089f6082..45363789c20 100644 --- a/tests/baselines/reference/contextualTyping26.types +++ b/tests/baselines/reference/contextualTyping26.types @@ -1,10 +1,10 @@ === tests/cases/compiler/contextualTyping26.ts === function foo(param:{id:number;}){}; foo(<{id:number;}>({})); ->foo : (param: { id: number; }) => void +>foo : typeof foo >param : { id: number; } >id : number >foo(<{id:number;}>({})) : void ->foo : (param: { id: number; }) => void +>foo : typeof foo ><{id:number;}>({}) : { id: number; } >id : number >({}) : {} diff --git a/tests/baselines/reference/contextualTyping27.types b/tests/baselines/reference/contextualTyping27.types index f668565e43d..e74bee5e052 100644 --- a/tests/baselines/reference/contextualTyping27.types +++ b/tests/baselines/reference/contextualTyping27.types @@ -1,10 +1,10 @@ === tests/cases/compiler/contextualTyping27.ts === function foo(param:{id:number;}){}; foo(<{id:number;}>({})); ->foo : (param: { id: number; }) => void +>foo : typeof foo >param : { id: number; } >id : number >foo(<{id:number;}>({})) : void ->foo : (param: { id: number; }) => void +>foo : typeof foo ><{id:number;}>({}) : { id: number; } >id : number >({}) : {} diff --git a/tests/baselines/reference/contextualTyping28.types b/tests/baselines/reference/contextualTyping28.types index 6019fde4a6b..04ca0651af5 100644 --- a/tests/baselines/reference/contextualTyping28.types +++ b/tests/baselines/reference/contextualTyping28.types @@ -1,8 +1,8 @@ === tests/cases/compiler/contextualTyping28.ts === function foo(param:number[]){}; foo([1]); ->foo : (param: number[]) => void +>foo : typeof foo >param : number[] >foo([1]) : void ->foo : (param: number[]) => void +>foo : typeof foo >[1] : number[] diff --git a/tests/baselines/reference/contextualTyping29.types b/tests/baselines/reference/contextualTyping29.types index 9666e60e959..a06d296a378 100644 --- a/tests/baselines/reference/contextualTyping29.types +++ b/tests/baselines/reference/contextualTyping29.types @@ -1,8 +1,8 @@ === tests/cases/compiler/contextualTyping29.ts === function foo(param:number[]){}; foo([1, 3]); ->foo : (param: number[]) => void +>foo : typeof foo >param : number[] >foo([1, 3]) : void ->foo : (param: number[]) => void +>foo : typeof foo >[1, 3] : number[] diff --git a/tests/baselines/reference/contextualTyping31.types b/tests/baselines/reference/contextualTyping31.types index e37bacd33f3..80511aada95 100644 --- a/tests/baselines/reference/contextualTyping31.types +++ b/tests/baselines/reference/contextualTyping31.types @@ -1,8 +1,8 @@ === tests/cases/compiler/contextualTyping31.ts === function foo(param:number[]){}; foo([1]); ->foo : (param: number[]) => void +>foo : typeof foo >param : number[] >foo([1]) : void ->foo : (param: number[]) => void +>foo : typeof foo >[1] : number[] diff --git a/tests/baselines/reference/contextualTyping32.types b/tests/baselines/reference/contextualTyping32.types index a9d41405b93..cb8ad24166b 100644 --- a/tests/baselines/reference/contextualTyping32.types +++ b/tests/baselines/reference/contextualTyping32.types @@ -1,10 +1,10 @@ === tests/cases/compiler/contextualTyping32.ts === function foo(param: {():number; (i:number):number; }[]) { }; foo([function(){return 1;}, function(){return 4}]); ->foo : (param: { (): number; (i: number): number; }[]) => void +>foo : typeof foo >param : { (): number; (i: number): number; }[] >i : number >foo([function(){return 1;}, function(){return 4}]) : void ->foo : (param: { (): number; (i: number): number; }[]) => void +>foo : typeof foo >[function(){return 1;}, function(){return 4}] : { (): number; (i: number): number; }[] >function(){return 1;} : () => number >function(){return 4} : () => number diff --git a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types index 0e5c25a9282..fb24b8c6f2b 100644 --- a/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types +++ b/tests/baselines/reference/contextualTypingTwoInstancesOfSameTypeParameter.types @@ -1,6 +1,6 @@ === tests/cases/compiler/contextualTypingTwoInstancesOfSameTypeParameter.ts === function f6(x: (a: T) => T) { ->f6 : (x: (a: T) => T) => any +>f6 : typeof f6 >T : T >x : (a: T) => T >a : T @@ -11,11 +11,11 @@ function f6(x: (a: T) => T) { } f6(x => f6(y => x = y)); >f6(x => f6(y => x = y)) : any ->f6 : (x: (a: T) => T) => any +>f6 : typeof f6 >x => f6(y => x = y) : (x: {}) => any >x : {} >f6(y => x = y) : any ->f6 : (x: (a: T) => T) => any +>f6 : typeof f6 >y => x = y : (y: {}) => {} >y : {} >x = y : {} diff --git a/tests/baselines/reference/continueInIterationStatement1.js b/tests/baselines/reference/continueInIterationStatement1.js new file mode 100644 index 00000000000..e1c787ae7ea --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement1.js @@ -0,0 +1,9 @@ +//// [continueInIterationStatement1.ts] +while (true) { + continue; +} + +//// [continueInIterationStatement1.js] +while (true) { + continue; +} diff --git a/tests/baselines/reference/continueInIterationStatement1.types b/tests/baselines/reference/continueInIterationStatement1.types new file mode 100644 index 00000000000..210de69f6bb --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement1.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/continueInIterationStatement1.ts === +while (true) { +No type information for this code. continue; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueInIterationStatement2.js b/tests/baselines/reference/continueInIterationStatement2.js new file mode 100644 index 00000000000..d7ff84895f6 --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement2.js @@ -0,0 +1,10 @@ +//// [continueInIterationStatement2.ts] +do { + continue; +} +while (true); + +//// [continueInIterationStatement2.js] +do { + continue; +} while (true); diff --git a/tests/baselines/reference/continueInIterationStatement2.types b/tests/baselines/reference/continueInIterationStatement2.types new file mode 100644 index 00000000000..5cb4b62f39a --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement2.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/continueInIterationStatement2.ts === +do { +No type information for this code. continue; +No type information for this code.} +No type information for this code.while (true); +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueInIterationStatement3.js b/tests/baselines/reference/continueInIterationStatement3.js new file mode 100644 index 00000000000..90619118ac5 --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement3.js @@ -0,0 +1,9 @@ +//// [continueInIterationStatement3.ts] +for (;;) { + continue; +} + +//// [continueInIterationStatement3.js] +for (;;) { + continue; +} diff --git a/tests/baselines/reference/continueInIterationStatement3.types b/tests/baselines/reference/continueInIterationStatement3.types new file mode 100644 index 00000000000..f4df3a295fb --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement3.types @@ -0,0 +1,5 @@ +=== tests/cases/compiler/continueInIterationStatement3.ts === +for (;;) { +No type information for this code. continue; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueInIterationStatement4.errors.txt b/tests/baselines/reference/continueInIterationStatement4.errors.txt new file mode 100644 index 00000000000..c0f4388cf79 --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement4.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/continueInIterationStatement4.ts (1 errors) ==== + for (var i in something) { + ~~~~~~~~~ +!!! Cannot find name 'something'. + continue; + } \ No newline at end of file diff --git a/tests/baselines/reference/continueInIterationStatement4.js b/tests/baselines/reference/continueInIterationStatement4.js new file mode 100644 index 00000000000..e72ab3ed9ab --- /dev/null +++ b/tests/baselines/reference/continueInIterationStatement4.js @@ -0,0 +1,9 @@ +//// [continueInIterationStatement4.ts] +for (var i in something) { + continue; +} + +//// [continueInIterationStatement4.js] +for (var i in something) { + continue; +} diff --git a/tests/baselines/reference/continueLabel.js b/tests/baselines/reference/continueLabel.js new file mode 100644 index 00000000000..390566353eb --- /dev/null +++ b/tests/baselines/reference/continueLabel.js @@ -0,0 +1,9 @@ +//// [continueLabel.ts] +label1: for(var i = 0; i < 1; i++) { + continue label1; +} + +//// [continueLabel.js] +label1: for (var i = 0; i < 1; i++) { + continue label1; +} diff --git a/tests/baselines/reference/continueLabel.types b/tests/baselines/reference/continueLabel.types new file mode 100644 index 00000000000..79c5381f08a --- /dev/null +++ b/tests/baselines/reference/continueLabel.types @@ -0,0 +1,10 @@ +=== tests/cases/compiler/continueLabel.ts === +label1: for(var i = 0; i < 1; i++) { +>i : number +>i < 1 : boolean +>i : number +>i++ : number +>i : number + + continue label1; +} diff --git a/tests/baselines/reference/continueNotInIterationStatement1.errors.txt b/tests/baselines/reference/continueNotInIterationStatement1.errors.txt new file mode 100644 index 00000000000..5f7d543a0aa --- /dev/null +++ b/tests/baselines/reference/continueNotInIterationStatement1.errors.txt @@ -0,0 +1,4 @@ +==== tests/cases/compiler/continueNotInIterationStatement1.ts (1 errors) ==== + continue; + ~~~~~~~~~ +!!! A 'continue' statement can only be used within an enclosing iteration statement. \ No newline at end of file diff --git a/tests/baselines/reference/continueNotInIterationStatement2.errors.txt b/tests/baselines/reference/continueNotInIterationStatement2.errors.txt new file mode 100644 index 00000000000..0bfc41d7f72 --- /dev/null +++ b/tests/baselines/reference/continueNotInIterationStatement2.errors.txt @@ -0,0 +1,8 @@ +==== tests/cases/compiler/continueNotInIterationStatement2.ts (1 errors) ==== + while (true) { + function f() { + continue; + ~~~~~~~~~ +!!! Jump target cannot cross function boundary. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/continueNotInIterationStatement3.errors.txt b/tests/baselines/reference/continueNotInIterationStatement3.errors.txt new file mode 100644 index 00000000000..d8627b4fc3a --- /dev/null +++ b/tests/baselines/reference/continueNotInIterationStatement3.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/continueNotInIterationStatement3.ts (1 errors) ==== + switch (0) { + default: + continue; + ~~~~~~~~~ +!!! A 'continue' statement can only be used within an enclosing iteration statement. + } \ No newline at end of file diff --git a/tests/baselines/reference/continueNotInIterationStatement4.errors.txt b/tests/baselines/reference/continueNotInIterationStatement4.errors.txt new file mode 100644 index 00000000000..91e7b26b578 --- /dev/null +++ b/tests/baselines/reference/continueNotInIterationStatement4.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/continueNotInIterationStatement4.ts (1 errors) ==== + TWO: + while (true){ + var x = () => { + continue TWO; + ~~~~~~~~~~~~~ +!!! Jump target cannot cross function boundary. + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget1.errors.txt b/tests/baselines/reference/continueTarget1.errors.txt new file mode 100644 index 00000000000..1b93d9fc707 --- /dev/null +++ b/tests/baselines/reference/continueTarget1.errors.txt @@ -0,0 +1,5 @@ +==== tests/cases/compiler/continueTarget1.ts (1 errors) ==== + target: + continue target; + ~~~~~~~~~~~~~~~~ +!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget2.js b/tests/baselines/reference/continueTarget2.js new file mode 100644 index 00000000000..eb3b4118f7f --- /dev/null +++ b/tests/baselines/reference/continueTarget2.js @@ -0,0 +1,10 @@ +//// [continueTarget2.ts] +target: +while (true) { + continue target; +} + +//// [continueTarget2.js] +target: while (true) { + continue target; +} diff --git a/tests/baselines/reference/continueTarget2.types b/tests/baselines/reference/continueTarget2.types new file mode 100644 index 00000000000..16f45c402cd --- /dev/null +++ b/tests/baselines/reference/continueTarget2.types @@ -0,0 +1,6 @@ +=== tests/cases/compiler/continueTarget2.ts === +target: +No type information for this code.while (true) { +No type information for this code. continue target; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget3.js b/tests/baselines/reference/continueTarget3.js new file mode 100644 index 00000000000..052b7b593c3 --- /dev/null +++ b/tests/baselines/reference/continueTarget3.js @@ -0,0 +1,11 @@ +//// [continueTarget3.ts] +target1: +target2: +while (true) { + continue target1; +} + +//// [continueTarget3.js] +target1: target2: while (true) { + continue target1; +} diff --git a/tests/baselines/reference/continueTarget3.types b/tests/baselines/reference/continueTarget3.types new file mode 100644 index 00000000000..a1b930f2f5a --- /dev/null +++ b/tests/baselines/reference/continueTarget3.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/continueTarget3.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target1; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget4.js b/tests/baselines/reference/continueTarget4.js new file mode 100644 index 00000000000..0f6211f9202 --- /dev/null +++ b/tests/baselines/reference/continueTarget4.js @@ -0,0 +1,11 @@ +//// [continueTarget4.ts] +target1: +target2: +while (true) { + continue target2; +} + +//// [continueTarget4.js] +target1: target2: while (true) { + continue target2; +} diff --git a/tests/baselines/reference/continueTarget4.types b/tests/baselines/reference/continueTarget4.types new file mode 100644 index 00000000000..ea1989a3e4d --- /dev/null +++ b/tests/baselines/reference/continueTarget4.types @@ -0,0 +1,7 @@ +=== tests/cases/compiler/continueTarget4.ts === +target1: +No type information for this code.target2: +No type information for this code.while (true) { +No type information for this code. continue target2; +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget5.errors.txt b/tests/baselines/reference/continueTarget5.errors.txt new file mode 100644 index 00000000000..aa156707aa5 --- /dev/null +++ b/tests/baselines/reference/continueTarget5.errors.txt @@ -0,0 +1,11 @@ +==== tests/cases/compiler/continueTarget5.ts (1 errors) ==== + target: + while (true) { + function f() { + while (true) { + continue target; + ~~~~~~~~~~~~~~~~ +!!! Jump target cannot cross function boundary. + } + } + } \ No newline at end of file diff --git a/tests/baselines/reference/continueTarget6.errors.txt b/tests/baselines/reference/continueTarget6.errors.txt new file mode 100644 index 00000000000..2177e50523d --- /dev/null +++ b/tests/baselines/reference/continueTarget6.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/continueTarget6.ts (1 errors) ==== + while (true) { + continue target; + ~~~~~~~~~~~~~~~~ +!!! A 'continue' statement can only jump to a label of an enclosing iteration statement. + } \ No newline at end of file diff --git a/tests/baselines/reference/convertKeywordsYes.errors.txt b/tests/baselines/reference/convertKeywordsYes.errors.txt new file mode 100644 index 00000000000..a3502f6b52c --- /dev/null +++ b/tests/baselines/reference/convertKeywordsYes.errors.txt @@ -0,0 +1,330 @@ +==== tests/cases/compiler/convertKeywordsYes.ts (8 errors) ==== + // reserved ES5 future in strict mode + + var constructor = 0; + var any = 0; + var boolean = 0; + var implements = 0; + var interface = 0; + var let = 0; + var module = 0; + var number = 0; + var package = 0; + var private = 0; + var protected = 0; + var public = 0; + var set = 0; + var static = 0; + var string = 0; + var get = 0; + var yield = 0; + var declare = 0; + + function bigGeneric< + constructor, + any, + ~~~ +!!! Type parameter name cannot be 'any' + boolean, + ~~~~~~~ +!!! Type parameter name cannot be 'boolean' + implements , + interface , + let, + module , + number, + ~~~~~~ +!!! Type parameter name cannot be 'number' + package, + private , + protected, + public , + set , + static , + string, + ~~~~~~ +!!! Type parameter name cannot be 'string' + get , + yield, + declare + >(c: constructor, + a: any, + b2: boolean, + i: implements , + i2: interface , + l: let, + m: module , + n: number, + p: package, + p2: private , + p3: protected, + p4: public , + s: set , + s2: static , + s3: string, + g: get , + y: yield, + d: declare ) { } + + var bigObject = { + constructor: 0, + any: 0, + boolean: 0, + implements: 0, + interface: 0, + let: 0, + module: 0, + number: 0, + package: 0, + private: 0, + protected: 0, + public: 0, + set: 0, + static: 0, + string: 0, + get: 0, + yield: 0, + break: 0, + case: 0, + catch: 0, + class: 0, + continue: 0, + const: 0, + + debugger: 0, + declare: 0, + default: 0, + delete: 0, + do: 0, + else: 0, + enum: 0, + export: 0, + extends: 0, + false: 0, + finally: 0, + for: 0, + function: 0, + if: 0, + + import: 0, + in: 0, + instanceof: 0, + new: 0, + null: 0, + return: 0, + super: 0, + switch: 0, + this: 0, + throw: 0, + true: 0, + try: 0, + typeof: 0, + var: 0, + void: 0, + while: 0, + with: 0, + }; + + interface bigInterface { + constructor; + any; + boolean; + implements; + interface; + let; + module; + number; + package; + private; + protected; + public; + set; + static; + string; + get; + yield; + break; + case; + catch; + class; + continue; + const; + + debugger; + declare; + default; + delete; + do; + else; + enum; + export; + extends; + false; + finally; + for; + function; + if; + + import; + in; + instanceof; + new; + null; + return; + super; + switch; + this; + throw; + true; + try; + typeof; + var; + void; + while; + with; + } + + class bigClass { + public "constructor" = 0; + public any = 0; + public boolean = 0; + public implements = 0; + public interface = 0; + public let = 0; + public module = 0; + public number = 0; + public package = 0; + public private = 0; + public protected = 0; + public public = 0; + public set = 0; + public static = 0; + public string = 0; + public get = 0; + public yield = 0; + public break = 0; + public case = 0; + public catch = 0; + public class = 0; + public continue = 0; + public const = 0; + public debugger = 0; + public declare = 0; + public default = 0; + public delete = 0; + public do = 0; + public else = 0; + public enum = 0; + public export = 0; + public extends = 0; + public false = 0; + public finally = 0; + public for = 0; + public function = 0; + public if = 0; + public import = 0; + public in = 0; + public instanceof = 0; + public new = 0; + public null = 0; + public return = 0; + public super = 0; + public switch = 0; + public this = 0; + public throw = 0; + public true = 0; + public try = 0; + public typeof = 0; + public var = 0; + public void = 0; + public while = 0; + public with = 0; + } + + enum bigEnum { + constructor, + any, + boolean, + implements, + interface, + let, + module, + number, + package, + private, + protected, + public, + set, + static, + string, + get, + yield, + break, + case, + catch, + class, + continue, + const, + + debugger, + declare, + default, + delete, + do, + else, + enum, + export, + extends, + false, + finally, + for, + function, + if, + + import, + in, + instanceof, + new, + null, + return, + super, + switch, + this, + throw, + true, + try, + typeof, + var, + void, + while, + with, + } + + module bigModule { + class constructor { } + class any { } + ~~~ +!!! Class name cannot be 'any' + class boolean { } + ~~~~~~~ +!!! Class name cannot be 'boolean' + class implements { } + class interface { } + class let { } + class module { } + class number { } + ~~~~~~ +!!! Class name cannot be 'number' + class package { } + class private { } + class protected { } + class public { } + class set { } + class static { } + class string { } + ~~~~~~ +!!! Class name cannot be 'string' + class get { } + class yield { } + class declare { } + } \ No newline at end of file diff --git a/tests/baselines/reference/convertKeywordsYes.js b/tests/baselines/reference/convertKeywordsYes.js index deae65b54c9..c58fec070cd 100644 --- a/tests/baselines/reference/convertKeywordsYes.js +++ b/tests/baselines/reference/convertKeywordsYes.js @@ -22,16 +22,20 @@ var declare = 0; function bigGeneric< constructor, + any, + boolean, implements , interface , let, module , + number, package, private , protected, public , set , static , + string, get , yield, declare @@ -290,16 +294,20 @@ enum bigEnum { module bigModule { class constructor { } + class any { } + class boolean { } class implements { } class interface { } class let { } class module { } + class number { } class package { } class private { } class protected { } class public { } class set { } class static { } + class string { } class get { } class yield { } class declare { } @@ -506,6 +514,16 @@ var bigModule; } return constructor; })(); + var any = (function () { + function any() { + } + return any; + })(); + var boolean = (function () { + function boolean() { + } + return boolean; + })(); var implements = (function () { function implements() { } @@ -526,6 +544,11 @@ var bigModule; } return module; })(); + var number = (function () { + function number() { + } + return number; + })(); var package = (function () { function package() { } @@ -556,6 +579,11 @@ var bigModule; } return static; })(); + var string = (function () { + function string() { + } + return string; + })(); var get = (function () { function get() { } diff --git a/tests/baselines/reference/convertKeywordsYes.types b/tests/baselines/reference/convertKeywordsYes.types deleted file mode 100644 index 839c5b5f580..00000000000 --- a/tests/baselines/reference/convertKeywordsYes.types +++ /dev/null @@ -1,936 +0,0 @@ -=== tests/cases/compiler/convertKeywordsYes.ts === -// reserved ES5 future in strict mode - -var constructor = 0; ->constructor : number - -var any = 0; ->any : number - -var boolean = 0; ->boolean : number - -var implements = 0; ->implements : number - -var interface = 0; ->interface : number - -var let = 0; ->let : number - -var module = 0; ->module : number - -var number = 0; ->number : number - -var package = 0; ->package : number - -var private = 0; ->private : number - -var protected = 0; ->protected : number - -var public = 0; ->public : number - -var set = 0; ->set : number - -var static = 0; ->static : number - -var string = 0; ->string : number - -var get = 0; ->get : number - -var yield = 0; ->yield : number - -var declare = 0; ->declare : number - -function bigGeneric< ->bigGeneric : (c: constructor, a: any, b2: boolean, i: implements, i2: interface, l: let, m: module, n: number, p: package, p2: private, p3: protected, p4: public, s: set, s2: static, s3: string, g: get, y: yield, d: declare) => void - - constructor, ->constructor : constructor - - implements , ->implements : implements - - interface , ->interface : interface - - let, ->let : let - - module , ->module : module - - package, ->package : package - - private , ->private : private - - protected, ->protected : protected - - public , ->public : public - - set , ->set : set - - static , ->static : static - - get , ->get : get - - yield, ->yield : yield - - declare ->declare : declare - - >(c: constructor, ->c : constructor ->constructor : constructor - - a: any, ->a : any - - b2: boolean, ->b2 : boolean - - i: implements , ->i : implements ->implements : implements - - i2: interface , ->i2 : interface ->interface : interface - - l: let, ->l : let ->let : let - - m: module , ->m : module ->module : module - - n: number, ->n : number - - p: package, ->p : package ->package : package - - p2: private , ->p2 : private ->private : private - - p3: protected, ->p3 : protected ->protected : protected - - p4: public , ->p4 : public ->public : public - - s: set , ->s : set ->set : set - - s2: static , ->s2 : static ->static : static - - s3: string, ->s3 : string - - g: get , ->g : get ->get : get - - y: yield, ->y : yield ->yield : yield - - d: declare ) { } ->d : declare ->declare : declare - -var bigObject = { ->bigObject : { constructor: number; any: number; boolean: number; implements: number; interface: number; let: number; module: number; number: number; package: number; private: number; protected: number; public: number; set: number; static: number; string: number; get: number; yield: number; break: number; case: number; catch: number; class: number; continue: number; const: number; debugger: number; declare: number; default: number; delete: number; do: number; else: number; enum: number; export: number; extends: number; false: number; finally: number; for: number; function: number; if: number; import: number; in: number; instanceof: number; new: number; null: number; return: number; super: number; switch: number; this: number; throw: number; true: number; try: number; typeof: number; var: number; void: number; while: number; with: number; } ->{ - constructor: 0, - any: 0, - boolean: 0, - implements: 0, - interface: 0, - let: 0, - module: 0, - number: 0, - package: 0, - private: 0, - protected: 0, - public: 0, - set: 0, - static: 0, - string: 0, - get: 0, - yield: 0, - break: 0, - case: 0, - catch: 0, - class: 0, - continue: 0, - const: 0, - - debugger: 0, - declare: 0, - default: 0, - delete: 0, - do: 0, - else: 0, - enum: 0, - export: 0, - extends: 0, - false: 0, - finally: 0, - for: 0, - function: 0, - if: 0, - - import: 0, - in: 0, - instanceof: 0, - new: 0, - null: 0, - return: 0, - super: 0, - switch: 0, - this: 0, - throw: 0, - true: 0, - try: 0, - typeof: 0, - var: 0, - void: 0, - while: 0, - with: 0, -} : { constructor: number; any: number; boolean: number; implements: number; interface: number; let: number; module: number; number: number; package: number; private: number; protected: number; public: number; set: number; static: number; string: number; get: number; yield: number; break: number; case: number; catch: number; class: number; continue: number; const: number; debugger: number; declare: number; default: number; delete: number; do: number; else: number; enum: number; export: number; extends: number; false: number; finally: number; for: number; function: number; if: number; import: number; in: number; instanceof: number; new: number; null: number; return: number; super: number; switch: number; this: number; throw: number; true: number; try: number; typeof: number; var: number; void: number; while: number; with: number; } - - constructor: 0, ->constructor : number - - any: 0, ->any : number - - boolean: 0, ->boolean : number - - implements: 0, ->implements : number - - interface: 0, ->interface : number - - let: 0, ->let : number - - module: 0, ->module : number - - number: 0, ->number : number - - package: 0, ->package : number - - private: 0, ->private : number - - protected: 0, ->protected : number - - public: 0, ->public : number - - set: 0, ->set : number - - static: 0, ->static : number - - string: 0, ->string : number - - get: 0, ->get : number - - yield: 0, ->yield : number - - break: 0, ->break : number - - case: 0, ->case : number - - catch: 0, ->catch : number - - class: 0, ->class : number - - continue: 0, ->continue : number - - const: 0, ->const : number - - debugger: 0, ->debugger : number - - declare: 0, ->declare : number - - default: 0, ->default : number - - delete: 0, ->delete : number - - do: 0, ->do : number - - else: 0, ->else : number - - enum: 0, ->enum : number - - export: 0, ->export : number - - extends: 0, ->extends : number - - false: 0, ->false : number - - finally: 0, ->finally : number - - for: 0, ->for : number - - function: 0, ->function : number - - if: 0, ->if : number - - import: 0, ->import : number - - in: 0, ->in : number - - instanceof: 0, ->instanceof : number - - new: 0, ->new : number - - null: 0, ->null : number - - return: 0, ->return : number - - super: 0, ->super : number - - switch: 0, ->switch : number - - this: 0, ->this : number - - throw: 0, ->throw : number - - true: 0, ->true : number - - try: 0, ->try : number - - typeof: 0, ->typeof : number - - var: 0, ->var : number - - void: 0, ->void : number - - while: 0, ->while : number - - with: 0, ->with : number - -}; - -interface bigInterface { ->bigInterface : bigInterface - - constructor; ->constructor : any - - any; ->any : any - - boolean; ->boolean : any - - implements; ->implements : any - - interface; ->interface : any - - let; ->let : any - - module; ->module : any - - number; ->number : any - - package; ->package : any - - private; ->private : any - - protected; ->protected : any - - public; ->public : any - - set; ->set : any - - static; ->static : any - - string; ->string : any - - get; ->get : any - - yield; ->yield : any - - break; ->break : any - - case; ->case : any - - catch; ->catch : any - - class; ->class : any - - continue; ->continue : any - - const; ->const : any - - debugger; ->debugger : any - - declare; ->declare : any - - default; ->default : any - - delete; ->delete : any - - do; ->do : any - - else; ->else : any - - enum; ->enum : any - - export; ->export : any - - extends; ->extends : any - - false; ->false : any - - finally; ->finally : any - - for; ->for : any - - function; ->function : any - - if; ->if : any - - import; ->import : any - - in; ->in : any - - instanceof; ->instanceof : any - - new; ->new : any - - null; ->null : any - - return; ->return : any - - super; ->super : any - - switch; ->switch : any - - this; ->this : any - - throw; ->throw : any - - true; ->true : any - - try; ->try : any - - typeof; ->typeof : any - - var; ->var : any - - void; ->void : any - - while; ->while : any - - with; ->with : any -} - -class bigClass { ->bigClass : bigClass - - public "constructor" = 0; - public any = 0; ->any : number - - public boolean = 0; ->boolean : number - - public implements = 0; ->implements : number - - public interface = 0; ->interface : number - - public let = 0; ->let : number - - public module = 0; ->module : number - - public number = 0; ->number : number - - public package = 0; ->package : number - - public private = 0; ->private : number - - public protected = 0; ->protected : number - - public public = 0; ->public : number - - public set = 0; ->set : number - - public static = 0; ->static : number - - public string = 0; ->string : number - - public get = 0; ->get : number - - public yield = 0; ->yield : number - - public break = 0; ->break : number - - public case = 0; ->case : number - - public catch = 0; ->catch : number - - public class = 0; ->class : number - - public continue = 0; ->continue : number - - public const = 0; ->const : number - - public debugger = 0; ->debugger : number - - public declare = 0; ->declare : number - - public default = 0; ->default : number - - public delete = 0; ->delete : number - - public do = 0; ->do : number - - public else = 0; ->else : number - - public enum = 0; ->enum : number - - public export = 0; ->export : number - - public extends = 0; ->extends : number - - public false = 0; ->false : number - - public finally = 0; ->finally : number - - public for = 0; ->for : number - - public function = 0; ->function : number - - public if = 0; ->if : number - - public import = 0; ->import : number - - public in = 0; ->in : number - - public instanceof = 0; ->instanceof : number - - public new = 0; ->new : number - - public null = 0; ->null : number - - public return = 0; ->return : number - - public super = 0; ->super : number - - public switch = 0; ->switch : number - - public this = 0; ->this : number - - public throw = 0; ->throw : number - - public true = 0; ->true : number - - public try = 0; ->try : number - - public typeof = 0; ->typeof : number - - public var = 0; ->var : number - - public void = 0; ->void : number - - public while = 0; ->while : number - - public with = 0; ->with : number -} - -enum bigEnum { ->bigEnum : bigEnum - - constructor, ->constructor : bigEnum - - any, ->any : bigEnum - - boolean, ->boolean : bigEnum - - implements, ->implements : bigEnum - - interface, ->interface : bigEnum - - let, ->let : bigEnum - - module, ->module : bigEnum - - number, ->number : bigEnum - - package, ->package : bigEnum - - private, ->private : bigEnum - - protected, ->protected : bigEnum - - public, ->public : bigEnum - - set, ->set : bigEnum - - static, ->static : bigEnum - - string, ->string : bigEnum - - get, ->get : bigEnum - - yield, ->yield : bigEnum - - break, ->break : bigEnum - - case, ->case : bigEnum - - catch, ->catch : bigEnum - - class, ->class : bigEnum - - continue, ->continue : bigEnum - - const, ->const : bigEnum - - debugger, ->debugger : bigEnum - - declare, ->declare : bigEnum - - default, ->default : bigEnum - - delete, ->delete : bigEnum - - do, ->do : bigEnum - - else, ->else : bigEnum - - enum, ->enum : bigEnum - - export, ->export : bigEnum - - extends, ->extends : bigEnum - - false, ->false : bigEnum - - finally, ->finally : bigEnum - - for, ->for : bigEnum - - function, ->function : bigEnum - - if, ->if : bigEnum - - import, ->import : bigEnum - - in, ->in : bigEnum - - instanceof, ->instanceof : bigEnum - - new, ->new : bigEnum - - null, ->null : bigEnum - - return, ->return : bigEnum - - super, ->super : bigEnum - - switch, ->switch : bigEnum - - this, ->this : bigEnum - - throw, ->throw : bigEnum - - true, ->true : bigEnum - - try, ->try : bigEnum - - typeof, ->typeof : bigEnum - - var, ->var : bigEnum - - void, ->void : bigEnum - - while, ->while : bigEnum - - with, ->with : bigEnum -} - -module bigModule { ->bigModule : typeof bigModule - - class constructor { } ->constructor : constructor - - class implements { } ->implements : implements - - class interface { } ->interface : interface - - class let { } ->let : let - - class module { } ->module : module - - class package { } ->package : package - - class private { } ->private : private - - class protected { } ->protected : protected - - class public { } ->public : public - - class set { } ->set : set - - class static { } ->static : static - - class get { } ->get : get - - class yield { } ->yield : yield - - class declare { } ->declare : declare -} diff --git a/tests/baselines/reference/covariance1.types b/tests/baselines/reference/covariance1.types index 44cdf018fee..b673b7afc31 100644 --- a/tests/baselines/reference/covariance1.types +++ b/tests/baselines/reference/covariance1.types @@ -17,7 +17,7 @@ module M { >X : X export function f(y:Y) { } ->f : (y: Y) => void +>f : typeof f >y : Y >Y : Y @@ -27,7 +27,7 @@ module M { f({x:a}); // ok >f({x:a}) : void ->f : (y: Y) => void +>f : typeof f >{x:a} : { x: X; } >x : X >a : a @@ -38,7 +38,7 @@ module M { f({x:b}); // ok covariant subtype >f({x:b}) : void ->f : (y: Y) => void +>f : typeof f >{x:b} : { x: XX; } >x : XX >b : b diff --git a/tests/baselines/reference/crashInresolveReturnStatement.types b/tests/baselines/reference/crashInresolveReturnStatement.types index 6d31f15569b..6f25dcaea86 100644 --- a/tests/baselines/reference/crashInresolveReturnStatement.types +++ b/tests/baselines/reference/crashInresolveReturnStatement.types @@ -7,9 +7,9 @@ class WorkItemToolbar { WITDialogs.createCopyOfWorkItem(); >WITDialogs.createCopyOfWorkItem() : void ->WITDialogs.createCopyOfWorkItem : () => void +>WITDialogs.createCopyOfWorkItem : typeof createCopyOfWorkItem >WITDialogs : typeof WITDialogs ->createCopyOfWorkItem : () => void +>createCopyOfWorkItem : typeof createCopyOfWorkItem } } class CreateCopyOfWorkItemDialog { @@ -22,7 +22,7 @@ class CreateCopyOfWorkItemDialog { } } function createWorkItemDialog(dialogType: P0) { ->createWorkItemDialog : (dialogType: P0) => void +>createWorkItemDialog : typeof createWorkItemDialog >P0 : P0 >dialogType : P0 >P0 : P0 @@ -31,11 +31,11 @@ class WITDialogs { >WITDialogs : WITDialogs public static createCopyOfWorkItem() { ->createCopyOfWorkItem : () => void +>createCopyOfWorkItem : typeof createCopyOfWorkItem createWorkItemDialog(CreateCopyOfWorkItemDialog); >createWorkItemDialog(CreateCopyOfWorkItemDialog) : void ->createWorkItemDialog : (dialogType: P0) => void +>createWorkItemDialog : typeof createWorkItemDialog >CreateCopyOfWorkItemDialog : typeof CreateCopyOfWorkItemDialog } } diff --git a/tests/baselines/reference/cyclicModuleImport.js b/tests/baselines/reference/cyclicModuleImport.js index 1c9b74eea4f..08f3c7d6147 100644 --- a/tests/baselines/reference/cyclicModuleImport.js +++ b/tests/baselines/reference/cyclicModuleImport.js @@ -20,24 +20,3 @@ declare module "MainModule" { //// [cyclicModuleImport.js] - - -//// [cyclicModuleImport.d.ts] -declare module "SubModule" { - import MainModule = require('MainModule'); - class SubModule { - static StaticVar: number; - InstanceVar: number; - main: MainModule; - constructor(); - } - export = SubModule; -} -declare module "MainModule" { - import SubModule = require('SubModule'); - class MainModule { - SubModule: SubModule; - constructor(); - } - export = MainModule; -} diff --git a/tests/baselines/reference/debugger.types b/tests/baselines/reference/debugger.types index 8d46931bf8f..f53af948b67 100644 --- a/tests/baselines/reference/debugger.types +++ b/tests/baselines/reference/debugger.types @@ -2,7 +2,7 @@ debugger; function foo() { ->foo : () => void +>foo : typeof foo debugger; diff --git a/tests/baselines/reference/declFileAccessors.types b/tests/baselines/reference/declFileAccessors.types deleted file mode 100644 index 2d8524a21c3..00000000000 --- a/tests/baselines/reference/declFileAccessors.types +++ /dev/null @@ -1,160 +0,0 @@ -=== tests/cases/compiler/declFileAccessors_0.ts === - -/** This is comment for c1*/ -export class c1 { ->c1 : c1 - - /** getter property*/ - public get p3() { ->p3 : number - - return 10; - } - /** setter property*/ - public set p3(/** this is value*/value: number) { ->p3 : number ->value : number - } - /** private getter property*/ - private get pp3() { ->pp3 : number - - return 10; - } - /** private setter property*/ - private set pp3(/** this is value*/value: number) { ->pp3 : number ->value : number - } - /** static getter property*/ - static get s3() { ->s3 : number - - return 10; - } - /** setter property*/ - static set s3( /** this is value*/value: number) { ->s3 : number ->value : number - } - public get nc_p3() { ->nc_p3 : number - - return 10; - } - public set nc_p3(value: number) { ->nc_p3 : number ->value : number - } - private get nc_pp3() { ->nc_pp3 : number - - return 10; - } - private set nc_pp3(value: number) { ->nc_pp3 : number ->value : number - } - static get nc_s3() { ->nc_s3 : string - - return ""; - } - static set nc_s3(value: string) { ->nc_s3 : string ->value : string - } - - // Only getter property - public get onlyGetter() { ->onlyGetter : number - - return 10; - } - - // Only setter property - public set onlySetter(value: number) { ->onlySetter : number ->value : number - } -} - -=== tests/cases/compiler/declFileAccessors_1.ts === -/** This is comment for c2 - the global class*/ -class c2 { ->c2 : c2 - - /** getter property*/ - public get p3() { ->p3 : number - - return 10; - } - /** setter property*/ - public set p3(/** this is value*/value: number) { ->p3 : number ->value : number - } - /** private getter property*/ - private get pp3() { ->pp3 : number - - return 10; - } - /** private setter property*/ - private set pp3(/** this is value*/value: number) { ->pp3 : number ->value : number - } - /** static getter property*/ - static get s3() { ->s3 : number - - return 10; - } - /** setter property*/ - static set s3( /** this is value*/value: number) { ->s3 : number ->value : number - } - public get nc_p3() { ->nc_p3 : number - - return 10; - } - public set nc_p3(value: number) { ->nc_p3 : number ->value : number - } - private get nc_pp3() { ->nc_pp3 : number - - return 10; - } - private set nc_pp3(value: number) { ->nc_pp3 : number ->value : number - } - static get nc_s3() { ->nc_s3 : string - - return ""; - } - static set nc_s3(value: string) { ->nc_s3 : string ->value : string - } - - // Only getter property - public get onlyGetter() { ->onlyGetter : number - - return 10; - } - - // Only setter property - public set onlySetter(value: number) { ->onlySetter : number ->value : number - } -} diff --git a/tests/baselines/reference/declFileCallSignatures.types b/tests/baselines/reference/declFileCallSignatures.types deleted file mode 100644 index 0fc0757aee1..00000000000 --- a/tests/baselines/reference/declFileCallSignatures.types +++ /dev/null @@ -1,117 +0,0 @@ -=== tests/cases/compiler/declFileCallSignatures_0.ts === - -export interface ICallSignature { ->ICallSignature : ICallSignature - - /** This comment should appear for foo*/ - (): string; -} - -export interface ICallSignatureWithParameters { ->ICallSignatureWithParameters : ICallSignatureWithParameters - - /** This is comment for function signature*/ - (/** this is comment about a*/a: string, ->a : string - - /** this is comment for b*/ - b: number): void; ->b : number -} - -export interface ICallSignatureWithRestParameters { ->ICallSignatureWithRestParameters : ICallSignatureWithRestParameters - - (a: string, ...rests: string[]): string; ->a : string ->rests : string[] -} - -export interface ICallSignatureWithOverloads { ->ICallSignatureWithOverloads : ICallSignatureWithOverloads - - (a: string): string; ->a : string - - (a: number): number; ->a : number -} - -export interface ICallSignatureWithTypeParameters { ->ICallSignatureWithTypeParameters : ICallSignatureWithTypeParameters ->T : T - - /** This comment should appear for foo*/ - (a: T): string; ->a : T ->T : T -} - -export interface ICallSignatureWithOwnTypeParametes { ->ICallSignatureWithOwnTypeParametes : ICallSignatureWithOwnTypeParametes - - (a: T): string; ->T : T ->ICallSignature : ICallSignature ->a : T ->T : T -} - -=== tests/cases/compiler/declFileCallSignatures_1.ts === -interface IGlobalCallSignature { ->IGlobalCallSignature : IGlobalCallSignature - - /** This comment should appear for foo*/ - (): string; -} - -interface IGlobalCallSignatureWithParameters { ->IGlobalCallSignatureWithParameters : IGlobalCallSignatureWithParameters - - /** This is comment for function signature*/ - (/** this is comment about a*/a: string, ->a : string - - /** this is comment for b*/ - b: number): void; ->b : number -} - -interface IGlobalCallSignatureWithRestParameters { ->IGlobalCallSignatureWithRestParameters : IGlobalCallSignatureWithRestParameters - - (a: string, ...rests: string[]): string; ->a : string ->rests : string[] - -} - -interface IGlobalCallSignatureWithOverloads { ->IGlobalCallSignatureWithOverloads : IGlobalCallSignatureWithOverloads - - (a: string): string; ->a : string - - (a: number): number; ->a : number -} - -interface IGlobalCallSignatureWithTypeParameters { ->IGlobalCallSignatureWithTypeParameters : IGlobalCallSignatureWithTypeParameters ->T : T - - /** This comment should appear for foo*/ - (a: T): string; ->a : T ->T : T -} - -interface IGlobalCallSignatureWithOwnTypeParametes { ->IGlobalCallSignatureWithOwnTypeParametes : IGlobalCallSignatureWithOwnTypeParametes - - (a: T): string; ->T : T ->IGlobalCallSignature : IGlobalCallSignature ->a : T ->T : T -} diff --git a/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.types b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.types index 0f1b21efc9e..2de89b265c1 100644 --- a/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.types +++ b/tests/baselines/reference/declFileClassWithStaticMethodReturningConstructor.types @@ -4,7 +4,7 @@ export class Enhancement { >Enhancement : Enhancement public static getType() { ->getType : () => typeof Enhancement +>getType : typeof getType return this; >this : typeof Enhancement diff --git a/tests/baselines/reference/declFileConstructSignatures.types b/tests/baselines/reference/declFileConstructSignatures.types deleted file mode 100644 index 6ee19bfdcf7..00000000000 --- a/tests/baselines/reference/declFileConstructSignatures.types +++ /dev/null @@ -1,121 +0,0 @@ -=== tests/cases/compiler/declFileConstructSignatures_0.ts === - -export interface IConstructSignature { ->IConstructSignature : IConstructSignature - - /** This comment should appear for foo*/ - new (): string; -} - -export interface IConstructSignatureWithParameters { ->IConstructSignatureWithParameters : IConstructSignatureWithParameters - - /** This is comment for function signature*/ - new (/** this is comment about a*/a: string, ->a : string - - /** this is comment for b*/ - b: number); ->b : number -} - -export interface IConstructSignatureWithRestParameters { ->IConstructSignatureWithRestParameters : IConstructSignatureWithRestParameters - - new (a: string, ...rests: string[]): string; ->a : string ->rests : string[] -} - -export interface IConstructSignatureWithOverloads { ->IConstructSignatureWithOverloads : IConstructSignatureWithOverloads - - new (a: string): string; ->a : string - - new (a: number): number; ->a : number -} - -export interface IConstructSignatureWithTypeParameters { ->IConstructSignatureWithTypeParameters : IConstructSignatureWithTypeParameters ->T : T - - /** This comment should appear for foo*/ - new (a: T): T; ->a : T ->T : T ->T : T -} - -export interface IConstructSignatureWithOwnTypeParametes { ->IConstructSignatureWithOwnTypeParametes : IConstructSignatureWithOwnTypeParametes - - new (a: T): T; ->T : T ->IConstructSignature : IConstructSignature ->a : T ->T : T ->T : T -} - -=== tests/cases/compiler/declFileConstructSignatures_1.ts === -interface IGlobalConstructSignature { ->IGlobalConstructSignature : IGlobalConstructSignature - - /** This comment should appear for foo*/ - new (): string; -} - -interface IGlobalConstructSignatureWithParameters { ->IGlobalConstructSignatureWithParameters : IGlobalConstructSignatureWithParameters - - /** This is comment for function signature*/ - new (/** this is comment about a*/a: string, ->a : string - - /** this is comment for b*/ - b: number); ->b : number -} - -interface IGlobalConstructSignatureWithRestParameters { ->IGlobalConstructSignatureWithRestParameters : IGlobalConstructSignatureWithRestParameters - - new (a: string, ...rests: string[]): string; ->a : string ->rests : string[] - -} - -interface IGlobalConstructSignatureWithOverloads { ->IGlobalConstructSignatureWithOverloads : IGlobalConstructSignatureWithOverloads - - new (a: string): string; ->a : string - - new (a: number): number; ->a : number -} - -interface IGlobalConstructSignatureWithTypeParameters { ->IGlobalConstructSignatureWithTypeParameters : IGlobalConstructSignatureWithTypeParameters ->T : T - - /** This comment should appear for foo*/ - new (a: T): T; ->a : T ->T : T ->T : T -} - -interface IGlobalConstructSignatureWithOwnTypeParametes { ->IGlobalConstructSignatureWithOwnTypeParametes : IGlobalConstructSignatureWithOwnTypeParametes - - new (a: T): T; ->T : T ->IGlobalConstructSignature : IGlobalConstructSignature ->a : T ->T : T ->T : T -} diff --git a/tests/baselines/reference/declFileConstructors.types b/tests/baselines/reference/declFileConstructors.types deleted file mode 100644 index 723830bdeea..00000000000 --- a/tests/baselines/reference/declFileConstructors.types +++ /dev/null @@ -1,176 +0,0 @@ -=== tests/cases/compiler/declFileConstructors_0.ts === - -export class SimpleConstructor { ->SimpleConstructor : SimpleConstructor - - /** This comment should appear for foo*/ - constructor() { - } -} -export class ConstructorWithParameters { ->ConstructorWithParameters : ConstructorWithParameters - - /** This is comment for function signature*/ - constructor(/** this is comment about a*/a: string, ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } -} - -export class ConstructorWithRestParamters { ->ConstructorWithRestParamters : ConstructorWithRestParamters - - constructor(a: string, ...rests: string[]) { ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } -} - -export class ConstructorWithOverloads { ->ConstructorWithOverloads : ConstructorWithOverloads - - constructor(a: string); ->a : string - - constructor(a: number); ->a : number - - constructor(a: any) { ->a : any - } -} - -export class ConstructorWithPublicParameterProperty { ->ConstructorWithPublicParameterProperty : ConstructorWithPublicParameterProperty - - constructor(public x: string) { ->x : string - } -} - -export class ConstructorWithPrivateParameterProperty { ->ConstructorWithPrivateParameterProperty : ConstructorWithPrivateParameterProperty - - constructor(private x: string) { ->x : string - } -} - -export class ConstructorWithOptionalParameterProperty { ->ConstructorWithOptionalParameterProperty : ConstructorWithOptionalParameterProperty - - constructor(public x?: string) { ->x : string - } -} - -export class ConstructorWithParameterInitializer { ->ConstructorWithParameterInitializer : ConstructorWithParameterInitializer - - constructor(public x = "hello") { ->x : string - } -} - -=== tests/cases/compiler/declFileConstructors_1.ts === -class GlobalSimpleConstructor { ->GlobalSimpleConstructor : GlobalSimpleConstructor - - /** This comment should appear for foo*/ - constructor() { - } -} -class GlobalConstructorWithParameters { ->GlobalConstructorWithParameters : GlobalConstructorWithParameters - - /** This is comment for function signature*/ - constructor(/** this is comment about a*/a: string, ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } -} - -class GlobalConstructorWithRestParamters { ->GlobalConstructorWithRestParamters : GlobalConstructorWithRestParamters - - constructor(a: string, ...rests: string[]) { ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } -} - -class GlobalConstructorWithOverloads { ->GlobalConstructorWithOverloads : GlobalConstructorWithOverloads - - constructor(a: string); ->a : string - - constructor(a: number); ->a : number - - constructor(a: any) { ->a : any - } -} - -class GlobalConstructorWithPublicParameterProperty { ->GlobalConstructorWithPublicParameterProperty : GlobalConstructorWithPublicParameterProperty - - constructor(public x: string) { ->x : string - } -} - -class GlobalConstructorWithPrivateParameterProperty { ->GlobalConstructorWithPrivateParameterProperty : GlobalConstructorWithPrivateParameterProperty - - constructor(private x: string) { ->x : string - } -} - -class GlobalConstructorWithOptionalParameterProperty { ->GlobalConstructorWithOptionalParameterProperty : GlobalConstructorWithOptionalParameterProperty - - constructor(public x?: string) { ->x : string - } -} - -class GlobalConstructorWithParameterInitializer { ->GlobalConstructorWithParameterInitializer : GlobalConstructorWithParameterInitializer - - constructor(public x = "hello") { ->x : string - } -} diff --git a/tests/baselines/reference/declFileFunctions.types b/tests/baselines/reference/declFileFunctions.types deleted file mode 100644 index 46281813eb0..00000000000 --- a/tests/baselines/reference/declFileFunctions.types +++ /dev/null @@ -1,142 +0,0 @@ -=== tests/cases/compiler/declFileFunctions_0.ts === - -/** This comment should appear for foo*/ -export function foo() { ->foo : () => void -} -/** This is comment for function signature*/ -export function fooWithParameters(/** this is comment about a*/a: string, ->fooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string -} -export function fooWithRestParameters(a: string, ...rests: string[]) { ->fooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string -} - -export function fooWithOverloads(a: string): string; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - -export function fooWithOverloads(a: number): number; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - -export function fooWithOverloads(a: any): any { ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any -} - -/** This comment should appear for nonExportedFoo*/ -function nonExportedFoo() { ->nonExportedFoo : () => void -} -/** This is comment for function signature*/ -function nonExportedFooWithParameters(/** this is comment about a*/a: string, ->nonExportedFooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string -} -function nonExportedFooWithRestParameters(a: string, ...rests: string[]) { ->nonExportedFooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string -} - -function nonExportedFooWithOverloads(a: string): string; ->nonExportedFooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - -function nonExportedFooWithOverloads(a: number): number; ->nonExportedFooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - -function nonExportedFooWithOverloads(a: any): any { ->nonExportedFooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any -} - -=== tests/cases/compiler/declFileFunctions_1.ts === -/** This comment should appear for foo*/ -function globalfoo() { ->globalfoo : () => void -} -/** This is comment for function signature*/ -function globalfooWithParameters(/** this is comment about a*/a: string, ->globalfooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string -} -function globalfooWithRestParameters(a: string, ...rests: string[]) { ->globalfooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string -} -function globalfooWithOverloads(a: string): string; ->globalfooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - -function globalfooWithOverloads(a: number): number; ->globalfooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - -function globalfooWithOverloads(a: any): any { ->globalfooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any -} diff --git a/tests/baselines/reference/declFileGenericType.types b/tests/baselines/reference/declFileGenericType.types index 1e85eef3824..aaf5d5bf634 100644 --- a/tests/baselines/reference/declFileGenericType.types +++ b/tests/baselines/reference/declFileGenericType.types @@ -10,7 +10,7 @@ export module C { >B : B export function F(x: T): A { return null; } ->F : (x: T) => A +>F : typeof F >T : T >x : T >T : T @@ -18,7 +18,7 @@ export module C { >B : B export function F2(x: T): C.A { return null; } ->F2 : (x: T) => A +>F2 : typeof F2 >T : T >x : T >T : T @@ -28,7 +28,7 @@ export module C { >B : B export function F3(x: T): C.A[] { return null; } ->F3 : (x: T) => A[] +>F3 : typeof F3 >T : T >x : T >T : T @@ -38,7 +38,7 @@ export module C { >B : B export function F4>(x: T): Array> { return null; } ->F4 : >(x: T) => A[] +>F4 : typeof F4 >T : T >A : A >B : B @@ -51,12 +51,12 @@ export module C { >B : B export function F5(): T { return null; } ->F5 : () => T +>F5 : typeof F5 >T : T >T : T export function F6>(x: T): T { return null; } ->F6 : >(x: T) => T +>F6 : typeof F6 >T : T >A : A >B : B @@ -83,28 +83,28 @@ export var a: C.A; >B : B export var b = C.F; ->b : (x: T) => A ->C.F : (x: T) => A +>b : typeof F +>C.F : typeof F >C : typeof C ->F : (x: T) => A +>F : typeof F export var c = C.F2; ->c : (x: T) => A ->C.F2 : (x: T) => A +>c : typeof F2 +>C.F2 : typeof F2 >C : typeof C ->F2 : (x: T) => A +>F2 : typeof F2 export var d = C.F3; ->d : (x: T) => A[] ->C.F3 : (x: T) => A[] +>d : typeof F3 +>C.F3 : typeof F3 >C : typeof C ->F3 : (x: T) => A[] +>F3 : typeof F3 export var e = C.F4; ->e : >(x: T) => A[] ->C.F4 : >(x: T) => A[] +>e : typeof F4 +>C.F4 : typeof F4 >C : typeof C ->F4 : >(x: T) => A[] +>F4 : typeof F4 export var x = (new C.D>(new C.A())).val; >x : A @@ -127,7 +127,7 @@ export var x = (new C.D>(new C.A())).val; >val : A export function f>() { } ->f : >() => void +>f : typeof f >T : T >C : C >A : A @@ -137,9 +137,9 @@ export function f>() { } export var g = C.F5>(); >g : A >C.F5>() : A ->C.F5 : () => T +>C.F5 : typeof F5 >C : typeof C ->F5 : () => T +>F5 : typeof F5 >C : C >A : A >C : C @@ -160,8 +160,8 @@ export interface i extends C.A { } >B : B export var j = C.F6; ->j : >(x: T) => T ->C.F6 : >(x: T) => T +>j : typeof F6 +>C.F6 : typeof F6 >C : typeof C ->F6 : >(x: T) => T +>F6 : typeof F6 diff --git a/tests/baselines/reference/declFileImportChainInExportAssignment.js b/tests/baselines/reference/declFileImportChainInExportAssignment.js deleted file mode 100644 index 73d8ede215a..00000000000 --- a/tests/baselines/reference/declFileImportChainInExportAssignment.js +++ /dev/null @@ -1,39 +0,0 @@ -//// [declFileImportChainInExportAssignment.ts] -module m { - export module c { - export class c { - } - } -} -import a = m.c; -import b = a; -export = b; - -//// [declFileImportChainInExportAssignment.js] -var m; -(function (m) { - (function (_c) { - var c = (function () { - function c() { - } - return c; - })(); - _c.c = c; - })(m.c || (m.c = {})); - var c = m.c; -})(m || (m = {})); -var a = m.c; -var b = a; -module.exports = b; - - -//// [declFileImportChainInExportAssignment.d.ts] -declare module m { - module c { - class c { - } - } -} -import a = m.c; -import b = a; -export = b; diff --git a/tests/baselines/reference/declFileImportChainInExportAssignment.types b/tests/baselines/reference/declFileImportChainInExportAssignment.types deleted file mode 100644 index 9f440c231ee..00000000000 --- a/tests/baselines/reference/declFileImportChainInExportAssignment.types +++ /dev/null @@ -1,24 +0,0 @@ -=== tests/cases/compiler/declFileImportChainInExportAssignment.ts === -module m { ->m : typeof m - - export module c { ->c : typeof c - - export class c { ->c : c - } - } -} -import a = m.c; ->a : typeof c ->m : typeof m ->c : typeof c - -import b = a; ->b : typeof c ->a : typeof c - -export = b; ->b : typeof c - diff --git a/tests/baselines/reference/declFileIndexSignatures.js b/tests/baselines/reference/declFileIndexSignatures.js deleted file mode 100644 index 547c3f47060..00000000000 --- a/tests/baselines/reference/declFileIndexSignatures.js +++ /dev/null @@ -1,69 +0,0 @@ -//// [tests/cases/compiler/declFileIndexSignatures.ts] //// - -//// [declFileIndexSignatures_0.ts] - -export interface IStringIndexSignature { - [s: string]: string; -} -export interface INumberIndexSignature { - [n: number]: number; -} - -export interface IBothIndexSignature { - [s: string]: any; - [n: number]: number; -} - -export interface IIndexSignatureWithTypeParameter { - [a: string]: T; -} - -//// [declFileIndexSignatures_1.ts] -interface IGlobalStringIndexSignature { - [s: string]: string; -} -interface IGlobalNumberIndexSignature { - [n: number]: number; -} - -interface IGlobalBothIndexSignature { - [s: string]: any; - [n: number]: number; -} - -interface IGlobalIndexSignatureWithTypeParameter { - [a: string]: T; -} - -//// [declFileIndexSignatures_0.js] -//// [declFileIndexSignatures_1.js] - - -//// [declFileIndexSignatures_0.d.ts] -export interface IStringIndexSignature { - [s: string]: string; -} -export interface INumberIndexSignature { - [n: number]: number; -} -export interface IBothIndexSignature { - [s: string]: any; - [n: number]: number; -} -export interface IIndexSignatureWithTypeParameter { - [a: string]: T; -} -//// [declFileIndexSignatures_1.d.ts] -interface IGlobalStringIndexSignature { - [s: string]: string; -} -interface IGlobalNumberIndexSignature { - [n: number]: number; -} -interface IGlobalBothIndexSignature { - [s: string]: any; - [n: number]: number; -} -interface IGlobalIndexSignatureWithTypeParameter { - [a: string]: T; -} diff --git a/tests/baselines/reference/declFileIndexSignatures.types b/tests/baselines/reference/declFileIndexSignatures.types deleted file mode 100644 index c971fb4aeb0..00000000000 --- a/tests/baselines/reference/declFileIndexSignatures.types +++ /dev/null @@ -1,66 +0,0 @@ -=== tests/cases/compiler/declFileIndexSignatures_0.ts === - -export interface IStringIndexSignature { ->IStringIndexSignature : IStringIndexSignature - - [s: string]: string; ->s : string -} -export interface INumberIndexSignature { ->INumberIndexSignature : INumberIndexSignature - - [n: number]: number; ->n : number -} - -export interface IBothIndexSignature { ->IBothIndexSignature : IBothIndexSignature - - [s: string]: any; ->s : string - - [n: number]: number; ->n : number -} - -export interface IIndexSignatureWithTypeParameter { ->IIndexSignatureWithTypeParameter : IIndexSignatureWithTypeParameter ->T : T - - [a: string]: T; ->a : string ->T : T -} - -=== tests/cases/compiler/declFileIndexSignatures_1.ts === -interface IGlobalStringIndexSignature { ->IGlobalStringIndexSignature : IGlobalStringIndexSignature - - [s: string]: string; ->s : string -} -interface IGlobalNumberIndexSignature { ->IGlobalNumberIndexSignature : IGlobalNumberIndexSignature - - [n: number]: number; ->n : number -} - -interface IGlobalBothIndexSignature { ->IGlobalBothIndexSignature : IGlobalBothIndexSignature - - [s: string]: any; ->s : string - - [n: number]: number; ->n : number -} - -interface IGlobalIndexSignatureWithTypeParameter { ->IGlobalIndexSignatureWithTypeParameter : IGlobalIndexSignatureWithTypeParameter ->T : T - - [a: string]: T; ->a : string ->T : T -} diff --git a/tests/baselines/reference/declFileMethods.types b/tests/baselines/reference/declFileMethods.types deleted file mode 100644 index 6432540f5a4..00000000000 --- a/tests/baselines/reference/declFileMethods.types +++ /dev/null @@ -1,447 +0,0 @@ -=== tests/cases/compiler/declFileMethods_0.ts === - -export class c1 { ->c1 : c1 - - /** This comment should appear for foo*/ - public foo() { ->foo : () => void - } - /** This is comment for function signature*/ - public fooWithParameters(/** this is comment about a*/a: string, ->fooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } - public fooWithRestParameters(a: string, ...rests: string[]) { ->fooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } - - public fooWithOverloads(a: string): string; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - public fooWithOverloads(a: number): number; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - - public fooWithOverloads(a: any): any { ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any - } - - - /** This comment should appear for privateFoo*/ - private privateFoo() { ->privateFoo : () => void - } - /** This is comment for function signature*/ - private privateFooWithParameters(/** this is comment about a*/a: string, ->privateFooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } - private privateFooWithRestParameters(a: string, ...rests: string[]) { ->privateFooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } - private privateFooWithOverloads(a: string): string; ->privateFooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - private privateFooWithOverloads(a: number): number; ->privateFooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - - private privateFooWithOverloads(a: any): any { ->privateFooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any - } - - - /** This comment should appear for static foo*/ - static staticFoo() { ->staticFoo : () => void - } - /** This is comment for function signature*/ - static staticFooWithParameters(/** this is comment about a*/a: string, ->staticFooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } - static staticFooWithRestParameters(a: string, ...rests: string[]) { ->staticFooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } - static staticFooWithOverloads(a: string): string; ->staticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - static staticFooWithOverloads(a: number): number; ->staticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - - static staticFooWithOverloads(a: any): any { ->staticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any - } - - - /** This comment should appear for privateStaticFoo*/ - private static privateStaticFoo() { ->privateStaticFoo : () => void - } - /** This is comment for function signature*/ - private static privateStaticFooWithParameters(/** this is comment about a*/a: string, ->privateStaticFooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } - private static privateStaticFooWithRestParameters(a: string, ...rests: string[]) { ->privateStaticFooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } - private static privateStaticFooWithOverloads(a: string): string; ->privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - private static privateStaticFooWithOverloads(a: number): number; ->privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - - private static privateStaticFooWithOverloads(a: any): any { ->privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any - } -} - -export interface I1 { ->I1 : I1 - - /** This comment should appear for foo*/ - foo(): string; ->foo : () => string - - /** This is comment for function signature*/ - fooWithParameters(/** this is comment about a*/a: string, ->fooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number): void; ->b : number - - fooWithRestParameters(a: string, ...rests: string[]): string; ->fooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - fooWithOverloads(a: string): string; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - fooWithOverloads(a: number): number; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : number -} - -=== tests/cases/compiler/declFileMethods_1.ts === -class c2 { ->c2 : c2 - - /** This comment should appear for foo*/ - public foo() { ->foo : () => void - } - /** This is comment for function signature*/ - public fooWithParameters(/** this is comment about a*/a: string, ->fooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } - public fooWithRestParameters(a: string, ...rests: string[]) { ->fooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } - - public fooWithOverloads(a: string): string; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - public fooWithOverloads(a: number): number; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - - public fooWithOverloads(a: any): any { ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any - } - - - /** This comment should appear for privateFoo*/ - private privateFoo() { ->privateFoo : () => void - } - /** This is comment for function signature*/ - private privateFooWithParameters(/** this is comment about a*/a: string, ->privateFooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } - private privateFooWithRestParameters(a: string, ...rests: string[]) { ->privateFooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } - private privateFooWithOverloads(a: string): string; ->privateFooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - private privateFooWithOverloads(a: number): number; ->privateFooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - - private privateFooWithOverloads(a: any): any { ->privateFooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any - } - - - /** This comment should appear for static foo*/ - static staticFoo() { ->staticFoo : () => void - } - /** This is comment for function signature*/ - static staticFooWithParameters(/** this is comment about a*/a: string, ->staticFooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } - static staticFooWithRestParameters(a: string, ...rests: string[]) { ->staticFooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } - static staticFooWithOverloads(a: string): string; ->staticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - static staticFooWithOverloads(a: number): number; ->staticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - - static staticFooWithOverloads(a: any): any { ->staticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any - } - - - /** This comment should appear for privateStaticFoo*/ - private static privateStaticFoo() { ->privateStaticFoo : () => void - } - /** This is comment for function signature*/ - private static privateStaticFooWithParameters(/** this is comment about a*/a: string, ->privateStaticFooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number) { ->b : number - - var d = a; ->d : string ->a : string - } - private static privateStaticFooWithRestParameters(a: string, ...rests: string[]) { ->privateStaticFooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - return a + rests.join(""); ->a + rests.join("") : string ->a : string ->rests.join("") : string ->rests.join : (separator?: string) => string ->rests : string[] ->join : (separator?: string) => string - } - private static privateStaticFooWithOverloads(a: string): string; ->privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - private static privateStaticFooWithOverloads(a: number): number; ->privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : number - - private static privateStaticFooWithOverloads(a: any): any { ->privateStaticFooWithOverloads : { (a: string): string; (a: number): number; } ->a : any - - return a; ->a : any - } -} - -interface I2 { ->I2 : I2 - - /** This comment should appear for foo*/ - foo(): string; ->foo : () => string - - /** This is comment for function signature*/ - fooWithParameters(/** this is comment about a*/a: string, ->fooWithParameters : (a: string, b: number) => void ->a : string - - /** this is comment for b*/ - b: number): void; ->b : number - - fooWithRestParameters(a: string, ...rests: string[]): string; ->fooWithRestParameters : (a: string, ...rests: string[]) => string ->a : string ->rests : string[] - - fooWithOverloads(a: string): string; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : string - - fooWithOverloads(a: number): number; ->fooWithOverloads : { (a: string): string; (a: number): number; } ->a : number -} - diff --git a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.types b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.types index f13397b1806..2b3d5d2656d 100644 --- a/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.types +++ b/tests/baselines/reference/declFileModuleAssignmentInObjectLiteralProperty.types @@ -9,10 +9,7 @@ module m1 { } var d = { >d : { m1: { m: typeof m1; }; m2: { c: typeof c; }; } ->{ - m1: { m: m1 }, - m2: { c: m1.c }, -} : { m1: { m: typeof m1; }; m2: { c: typeof c; }; } +>{ m1: { m: m1 }, m2: { c: m1.c },} : { m1: { m: typeof m1; }; m2: { c: typeof c; }; } m1: { m: m1 }, >m1 : { m: typeof m1; } diff --git a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types index ecb7c002089..41f709491d0 100644 --- a/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types +++ b/tests/baselines/reference/declFileRestParametersOfFunctionAndFunctionType.types @@ -1,26 +1,26 @@ === tests/cases/compiler/declFileRestParametersOfFunctionAndFunctionType.ts === function f1(...args) { } ->f1 : (...args: any[]) => void +>f1 : typeof f1 >args : any[] function f2(x: (...args) => void) { } ->f2 : (x: (...args: any[]) => void) => void +>f2 : typeof f2 >x : (...args: any[]) => void >args : any[] function f3(x: { (...args): void }) { } ->f3 : (x: (...args: any[]) => void) => void +>f3 : typeof f3 >x : (...args: any[]) => void >args : any[] function f4 void>() { } ->f4 : void>() => void +>f4 : typeof f4 >T : T >args : any[] function f5() { } ->f5 : void>() => void +>f5 : typeof f5 >T : T >args : any[] diff --git a/tests/baselines/reference/declFileTypeofFunction.types b/tests/baselines/reference/declFileTypeofFunction.types index a157f80074c..0a2dae318e9 100644 --- a/tests/baselines/reference/declFileTypeofFunction.types +++ b/tests/baselines/reference/declFileTypeofFunction.types @@ -1,31 +1,31 @@ === tests/cases/compiler/declFileTypeofFunction.ts === function f(n: typeof f): string; ->f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; } ->n : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; } ->f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; } +>f : typeof f +>n : typeof f +>f : typeof f function f(n: typeof g): string; ->f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; } ->n : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; } ->g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; } +>f : typeof f +>n : typeof g +>g : typeof g function f() { return undefined; } ->f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; } +>f : typeof f >undefined : undefined function g(n: typeof g): number; ->g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; } ->n : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; } ->g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; } +>g : typeof g +>n : typeof g +>g : typeof g function g(n: typeof f): number; ->g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; } ->n : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; } ->f : { (n: typeof f): string; (n: { (n: typeof g): number; (n: typeof f): number; }): string; } +>g : typeof g +>n : typeof f +>f : typeof f function g() { return undefined; } ->g : { (n: typeof g): number; (n: { (n: typeof f): string; (n: typeof g): string; }): number; } +>g : typeof g >undefined : undefined var b: () => typeof b; @@ -33,47 +33,43 @@ var b: () => typeof b; >b : any function b1() { ->b1 : () => typeof b1 +>b1 : typeof b1 return b1; ->b1 : () => typeof b1 +>b1 : typeof b1 } function foo(): typeof foo { ->foo : () => typeof foo ->foo : () => typeof foo +>foo : typeof foo +>foo : typeof foo return null; } var foo1: typeof foo; ->foo1 : () => typeof foo ->foo : () => typeof foo +>foo1 : typeof foo +>foo : typeof foo var foo2 = foo; ->foo2 : () => typeof foo ->foo : () => typeof foo +>foo2 : typeof foo +>foo : typeof foo var foo3 = function () { >foo3 : any ->function () { - return foo3; -} : () => any +>function () { return foo3;} : () => any return foo3; >foo3 : any } var x = () => { >x : any ->() => { - return x; -} : () => any +>() => { return x;} : () => any return x; >x : any } function foo5(x: number) { ->foo5 : (x: number) => (x: number) => number +>foo5 : typeof foo5 >x : number function bar(x: number) { diff --git a/tests/baselines/reference/declFileTypeofInAnonymousType.types b/tests/baselines/reference/declFileTypeofInAnonymousType.types index f029dc22048..1112946a157 100644 --- a/tests/baselines/reference/declFileTypeofInAnonymousType.types +++ b/tests/baselines/reference/declFileTypeofInAnonymousType.types @@ -27,10 +27,7 @@ var a: { c: m1.c; }; var b = { >b : { c: typeof c; m1: typeof m1; } ->{ - c: m1.c, - m1: m1 -} : { c: typeof c; m1: typeof m1; } +>{ c: m1.c, m1: m1} : { c: typeof c; m1: typeof m1; } c: m1.c, >c : typeof c @@ -51,12 +48,7 @@ var c = { m1: m1 }; var d = { >d : { m: { mod: typeof m1; }; mc: { cl: typeof c; }; me: { en: typeof e; }; mh: e; } ->{ - m: { mod: m1 }, - mc: { cl: m1.c }, - me: { en: m1.e }, - mh: m1.e.holiday -} : { m: { mod: typeof m1; }; mc: { cl: typeof c; }; me: { en: typeof e; }; mh: e; } +>{ m: { mod: m1 }, mc: { cl: m1.c }, me: { en: m1.e }, mh: m1.e.holiday} : { m: { mod: typeof m1; }; mc: { cl: typeof c; }; me: { en: typeof e; }; mh: e; } m: { mod: m1 }, >m : { mod: typeof m1; } diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.errors.txt b/tests/baselines/reference/declarationEmit_nameConflicts.errors.txt new file mode 100644 index 00000000000..6a202ec3e60 --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflicts.errors.txt @@ -0,0 +1,53 @@ +==== tests/cases/compiler/declarationEmit_nameConflicts_0.ts (1 errors) ==== + import im = require('declarationEmit_nameConflicts_1'); + export module M { + export function f() { } + export class C { } + export module N { + export function g() { }; + export interface I { } + } + + export import a = M.f; + export import b = M.C; + export import c = N; + export import d = im; + ~~~~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'im'. + } + + export module M.P { + export function f() { } + export class C { } + export module N { + export function g() { }; + export interface I { } + } + export import im = M.P.f; + // Bug 887180: Invalid .d.ts when an aliased entity is referenced, and a different entity is closer in scope + export var a = M.a; // emitted incorrectly as typeof f + export var b = M.b; // ok + export var c = M.c; // ok + export var g = M.c.g; // ok + export var d = M.d; // emitted incorrectly as typeof im + } + + export module M.Q { + export function f() { } + export class C { } + export module N { + export function g() { }; + export interface I { } + } + export interface b extends M.b { } // ok + export interface I extends M.c.I { } // ok + export module c { + export interface I extends M.c.I { } // ok + } + } +==== tests/cases/compiler/declarationEmit_nameConflicts_1.ts (1 errors) ==== + function f() { } + export = f; + ~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. + \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.types b/tests/baselines/reference/declarationEmit_nameConflicts.types deleted file mode 100644 index 2b6a8d21827..00000000000 --- a/tests/baselines/reference/declarationEmit_nameConflicts.types +++ /dev/null @@ -1,148 +0,0 @@ -=== tests/cases/compiler/declarationEmit_nameConflicts_0.ts === -import im = require('declarationEmit_nameConflicts_1'); ->im : typeof f - -export module M { ->M : typeof M - - export function f() { } ->f : () => void - - export class C { } ->C : C - - export module N { ->N : typeof N - - export function g() { }; ->g : () => void - - export interface I { } ->I : I - } - - export import a = M.f; ->a : () => void ->M : typeof M ->f : () => void - - export import b = M.C; ->b : typeof C ->M : typeof M ->C : C - - export import c = N; ->c : typeof N ->N : typeof N - - export import d = im; ->d : typeof f ->im : typeof f -} - -export module M.P { ->M : typeof M ->P : typeof P - - export function f() { } ->f : () => void - - export class C { } ->C : C - - export module N { ->N : typeof N - - export function g() { }; ->g : () => void - - export interface I { } ->I : I - } - export import im = M.P.f; ->im : () => void ->M : typeof M ->P : typeof P ->f : () => void - - export var a = M.a; // emitted incorrectly as typeof f ->a : () => void ->M.a : () => void ->M : typeof M ->a : () => void - - export var b = M.b; // ok ->b : typeof C ->M.b : typeof C ->M : typeof M ->b : typeof C - - export var c = M.c; // ok ->c : typeof N ->M.c : typeof N ->M : typeof M ->c : typeof N - - export var g = M.c.g; // ok ->g : () => void ->M.c.g : () => void ->M.c : typeof N ->M : typeof M ->c : typeof N ->g : () => void - - export var d = M.d; // emitted incorrectly as typeof im ->d : typeof f ->M.d : typeof f ->M : typeof M ->d : typeof f -} - -export module M.Q { ->M : typeof M ->Q : typeof Q - - export function f() { } ->f : () => void - - export class C { } ->C : C - - export module N { ->N : typeof N - - export function g() { }; ->g : () => void - - export interface I { } ->I : I - } - export interface b extends M.b { } // ok ->b : b ->M : M ->b : C - - export interface I extends M.c.I { } // ok ->I : I ->M : M ->c : c ->I : I - - export module c { ->c : c - - export interface I extends M.c.I { } // ok ->I : I ->M : M ->c : c ->I : I - } -} -=== tests/cases/compiler/declarationEmit_nameConflicts_1.ts === -module f { export class c { } } ->f : typeof f ->c : c - -export = f; ->f : typeof f - diff --git a/tests/baselines/reference/declarationEmit_nameConflicts2.js b/tests/baselines/reference/declarationEmit_nameConflicts2.js index 7b8e1ce17c9..b60514e8076 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts2.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts2.js @@ -9,6 +9,7 @@ module X.Y.base { } module X.Y.base.Z { + // Bug 887180 export var f = X.Y.base.f; // Should be base.f export var C = X.Y.base.C; // Should be base.C export var M = X.Y.base.M; // Should be base.M diff --git a/tests/baselines/reference/declarationEmit_nameConflicts2.types b/tests/baselines/reference/declarationEmit_nameConflicts2.types index d1422468dd3..9daf65b530a 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts2.types +++ b/tests/baselines/reference/declarationEmit_nameConflicts2.types @@ -5,7 +5,7 @@ module X.Y.base { >base : typeof base export function f() { } ->f : () => void +>f : typeof f export class C { } >C : C @@ -26,15 +26,16 @@ module X.Y.base.Z { >base : typeof base >Z : typeof Z + // Bug 887180 export var f = X.Y.base.f; // Should be base.f ->f : () => void ->X.Y.base.f : () => void +>f : typeof f +>X.Y.base.f : typeof f >X.Y.base : typeof base >X.Y : typeof Y >X : typeof X >Y : typeof Y >base : typeof base ->f : () => void +>f : typeof f export var C = X.Y.base.C; // Should be base.C >C : typeof C diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.js b/tests/baselines/reference/declarationEmit_nameConflicts3.js index a8dc1217ef4..e4d4feddc99 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts3.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.js @@ -20,6 +20,7 @@ module M.P { export enum D { f } + // Bug 887180 export var v: M.D; // ok export var w = M.D.f; // error, should be typeof M.D.f export var x = M.C.f; // error, should be typeof M.C.f diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.types b/tests/baselines/reference/declarationEmit_nameConflicts3.types index f474b19288e..1021b10f79f 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts3.types +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.types @@ -9,19 +9,19 @@ module M { >D : typeof D export function f() { } ->f : () => void +>f : typeof f } export module C { >C : typeof C export function f() { } ->f : () => void +>f : typeof f } export module E { >E : typeof E export function f() { } ->f : () => void +>f : typeof f } } @@ -33,7 +33,7 @@ module M.P { >C : C static f() { } ->f : () => void +>f : typeof f } export class E extends C { } >E : E @@ -45,32 +45,33 @@ module M.P { f >f : D } + // Bug 887180 export var v: M.D; // ok >v : D >M : M >D : D export var w = M.D.f; // error, should be typeof M.D.f ->w : () => void ->M.D.f : () => void +>w : typeof f +>M.D.f : typeof f >M.D : typeof D >M : typeof M >D : typeof D ->f : () => void +>f : typeof f export var x = M.C.f; // error, should be typeof M.C.f ->x : () => void ->M.C.f : () => void +>x : typeof f +>M.C.f : typeof f >M.C : typeof C >M : typeof M >C : typeof C ->f : () => void +>f : typeof f export var x = M.E.f; // error, should be typeof M.E.f ->x : () => void ->M.E.f : () => void +>x : typeof f +>M.E.f : typeof f >M.E : typeof E >M : typeof M >E : typeof E ->f : () => void +>f : typeof f } diff --git a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.errors.txt b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.errors.txt new file mode 100644 index 00000000000..7a62ea58b2d --- /dev/null +++ b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.errors.txt @@ -0,0 +1,10 @@ +==== tests/cases/compiler/declarationEmit_nameConflictsWithAlias.ts (1 errors) ==== + // Bug 887180 + export module C { export interface I { } } + ~ +!!! Cannot compile external modules unless the '--module' flag is provided. + export import v = C; + export module M { + export module C { export interface I { } } + export var w: v.I; // Gets emitted as C.I, which is the wrong interface + } \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types deleted file mode 100644 index bd905943f4f..00000000000 --- a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.types +++ /dev/null @@ -1,21 +0,0 @@ -=== tests/cases/compiler/declarationEmit_nameConflictsWithAlias.ts === -export module C { export interface I { } } ->C : C ->I : I - -export import v = C; ->v : v ->C : C - -export module M { ->M : typeof M - - export module C { export interface I { } } ->C : C ->I : I - - export var w: v.I; // Gets emitted as C.I, which is the wrong interface ->w : I ->v : v ->I : I -} diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.js b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.js deleted file mode 100644 index c4acd795453..00000000000 --- a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.js +++ /dev/null @@ -1,41 +0,0 @@ -//// [declareFileExportAssignmentWithVarFromVariableStatement.ts] -module m2 { - export interface connectModule { - (res, req, next): void; - } - export interface connectExport { - use: (mod: connectModule) => connectExport; - listen: (port: number) => void; - } - -} - -var x = 10, m2: { - (): m2.connectExport; - test1: m2.connectModule; - test2(): m2.connectModule; -}; - -export = m2; - -//// [declareFileExportAssignmentWithVarFromVariableStatement.js] -var x = 10, m2; -module.exports = m2; - - -//// [declareFileExportAssignmentWithVarFromVariableStatement.d.ts] -declare module m2 { - interface connectModule { - (res: any, req: any, next: any): void; - } - interface connectExport { - use: (mod: connectModule) => connectExport; - listen: (port: number) => void; - } -} -declare var m2: { - (): m2.connectExport; - test1: m2.connectModule; - test2(): m2.connectModule; -}; -export = m2; diff --git a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types b/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types deleted file mode 100644 index 0b173f89f16..00000000000 --- a/tests/baselines/reference/declareFileExportAssignmentWithVarFromVariableStatement.types +++ /dev/null @@ -1,51 +0,0 @@ -=== tests/cases/compiler/declareFileExportAssignmentWithVarFromVariableStatement.ts === -module m2 { ->m2 : { (): connectExport; test1: connectModule; test2(): connectModule; } - - export interface connectModule { ->connectModule : connectModule - - (res, req, next): void; ->res : any ->req : any ->next : any - } - export interface connectExport { ->connectExport : connectExport - - use: (mod: connectModule) => connectExport; ->use : (mod: connectModule) => connectExport ->mod : connectModule ->connectModule : connectModule ->connectExport : connectExport - - listen: (port: number) => void; ->listen : (port: number) => void ->port : number - } - -} - -var x = 10, m2: { ->x : number ->m2 : { (): connectExport; test1: connectModule; test2(): connectModule; } - - (): m2.connectExport; ->m2 : m2 ->connectExport : connectExport - - test1: m2.connectModule; ->test1 : connectModule ->m2 : m2 ->connectModule : connectModule - - test2(): m2.connectModule; ->test2 : () => connectModule ->m2 : m2 ->connectModule : connectModule - -}; - -export = m2; ->m2 : { (): connectExport; test1: connectModule; test2(): connectModule; } - diff --git a/tests/baselines/reference/deleteOperatorWithBooleanType.types b/tests/baselines/reference/deleteOperatorWithBooleanType.types index fa8c375b0a5..eb5d657fcee 100644 --- a/tests/baselines/reference/deleteOperatorWithBooleanType.types +++ b/tests/baselines/reference/deleteOperatorWithBooleanType.types @@ -4,7 +4,7 @@ var BOOLEAN: boolean; >BOOLEAN : boolean function foo(): boolean { return true; } ->foo : () => boolean +>foo : typeof foo class A { >A : A @@ -13,7 +13,7 @@ class A { >a : boolean static foo() { return false; } ->foo : () => boolean +>foo : typeof foo } module M { >M : typeof M @@ -64,15 +64,15 @@ var ResultIsBoolean6 = delete foo(); >ResultIsBoolean6 : boolean >delete foo() : boolean >foo() : boolean ->foo : () => boolean +>foo : typeof foo var ResultIsBoolean7 = delete A.foo(); >ResultIsBoolean7 : boolean >delete A.foo() : boolean >A.foo() : boolean ->A.foo : () => boolean +>A.foo : typeof foo >A : typeof A ->foo : () => boolean +>foo : typeof foo // multiple delete operator var ResultIsBoolean8 = delete delete BOOLEAN; @@ -92,7 +92,7 @@ delete BOOLEAN; delete foo(); >delete foo() : boolean >foo() : boolean ->foo : () => boolean +>foo : typeof foo delete true, false; >delete true, false : boolean diff --git a/tests/baselines/reference/deleteOperatorWithNumberType.types b/tests/baselines/reference/deleteOperatorWithNumberType.types index 542efe04c34..f367ef438b0 100644 --- a/tests/baselines/reference/deleteOperatorWithNumberType.types +++ b/tests/baselines/reference/deleteOperatorWithNumberType.types @@ -8,7 +8,7 @@ var NUMBER1: number[] = [1, 2]; >[1, 2] : number[] function foo(): number { return 1; } ->foo : () => number +>foo : typeof foo class A { >A : A @@ -17,7 +17,7 @@ class A { >a : number static foo() { return 1; } ->foo : () => number +>foo : typeof foo } module M { >M : typeof M @@ -89,15 +89,15 @@ var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean >delete foo() : boolean >foo() : number ->foo : () => number +>foo : typeof foo var ResultIsBoolean10 = delete A.foo(); >ResultIsBoolean10 : boolean >delete A.foo() : boolean >A.foo() : number ->A.foo : () => number +>A.foo : typeof foo >A : typeof A ->foo : () => number +>foo : typeof foo var ResultIsBoolean11 = delete (NUMBER + NUMBER); >ResultIsBoolean11 : boolean @@ -139,7 +139,7 @@ delete NUMBER1; delete foo(); >delete foo() : boolean >foo() : number ->foo : () => number +>foo : typeof foo delete objA.a; >delete objA.a : boolean diff --git a/tests/baselines/reference/deleteOperatorWithStringType.types b/tests/baselines/reference/deleteOperatorWithStringType.types index f86afc39c49..17d0a77aa56 100644 --- a/tests/baselines/reference/deleteOperatorWithStringType.types +++ b/tests/baselines/reference/deleteOperatorWithStringType.types @@ -8,7 +8,7 @@ var STRING1: string[] = ["", "abc"]; >["", "abc"] : string[] function foo(): string { return "abc"; } ->foo : () => string +>foo : typeof foo class A { >A : A @@ -17,7 +17,7 @@ class A { >a : string static foo() { return ""; } ->foo : () => string +>foo : typeof foo } module M { >M : typeof M @@ -89,15 +89,15 @@ var ResultIsBoolean9 = delete foo(); >ResultIsBoolean9 : boolean >delete foo() : boolean >foo() : string ->foo : () => string +>foo : typeof foo var ResultIsBoolean10 = delete A.foo(); >ResultIsBoolean10 : boolean >delete A.foo() : boolean >A.foo() : string ->A.foo : () => string +>A.foo : typeof foo >A : typeof A ->foo : () => string +>foo : typeof foo var ResultIsBoolean11 = delete (STRING + STRING); >ResultIsBoolean11 : boolean @@ -147,7 +147,7 @@ delete STRING1; delete foo(); >delete foo() : boolean >foo() : string ->foo : () => string +>foo : typeof foo delete objA.a,M.n; >delete objA.a,M.n : string diff --git a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.types b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.types index 6ba99c0eca4..016a123c5c1 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.types +++ b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction1.types @@ -10,11 +10,7 @@ class TestFile { >message : string return (...x: string[]) => ->(...x: string[]) => - /// Test summary - /// - /// - message + this.name : (...x: string[]) => string +>(...x: string[]) => /// Test summary /// /// message + this.name : (...x: string[]) => string >x : string[] /// Test summary diff --git a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.types b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.types index 31f4fc73e9b..2199a4490b5 100644 --- a/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.types +++ b/tests/baselines/reference/detachedCommentAtStartOfLambdaFunction2.types @@ -10,12 +10,7 @@ class TestFile { >message : string return (...x: string[]) => ->(...x: string[]) => - /// Test summary - /// - /// - - message + this.name : (...x: string[]) => string +>(...x: string[]) => /// Test summary /// /// message + this.name : (...x: string[]) => string >x : string[] /// Test summary diff --git a/tests/baselines/reference/dottedSymbolResolution1.types b/tests/baselines/reference/dottedSymbolResolution1.types index 5155d067c41..11c52d494bb 100644 --- a/tests/baselines/reference/dottedSymbolResolution1.types +++ b/tests/baselines/reference/dottedSymbolResolution1.types @@ -26,14 +26,14 @@ class Base { foo() { } } >foo : () => void function each(collection: string, callback: (indexInArray: any, valueOfElement: any) => any): any; ->each : { (collection: string, callback: (indexInArray: any, valueOfElement: any) => any): any; (collection: JQuery, callback: (indexInArray: number, valueOfElement: Base) => any): any; } +>each : typeof each >collection : string >callback : (indexInArray: any, valueOfElement: any) => any >indexInArray : any >valueOfElement : any function each(collection: JQuery, callback: (indexInArray: number, valueOfElement: Base) => any): any; ->each : { (collection: string, callback: (indexInArray: any, valueOfElement: any) => any): any; (collection: JQuery, callback: (indexInArray: number, valueOfElement: Base) => any): any; } +>each : typeof each >collection : JQuery >JQuery : JQuery >callback : (indexInArray: number, valueOfElement: Base) => any @@ -42,7 +42,7 @@ function each(collection: JQuery, callback: (indexInArray: number, valueOfElemen >Base : Base function each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any { ->each : { (collection: string, callback: (indexInArray: any, valueOfElement: any) => any): any; (collection: JQuery, callback: (indexInArray: number, valueOfElement: Base) => any): any; } +>each : typeof each >collection : any >callback : (indexInArray: any, valueOfElement: any) => any >indexInArray : any @@ -52,7 +52,7 @@ function each(collection: any, callback: (indexInArray: any, valueOfElement: any } function _setBarAndText(): void { ->_setBarAndText : () => void +>_setBarAndText : typeof _setBarAndText var x: JQuery, $: JQueryStatic >x : JQuery @@ -61,19 +61,13 @@ function _setBarAndText(): void { >JQueryStatic : JQueryStatic each(x.find(" "), function () { ->each(x.find(" "), function () { - var $this: JQuery = $(''), - thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here - } ) : any ->each : { (collection: string, callback: (indexInArray: any, valueOfElement: any) => any): any; (collection: JQuery, callback: (indexInArray: number, valueOfElement: Base) => any): any; } +>each(x.find(" "), function () { var $this: JQuery = $(''), thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here } ) : any +>each : typeof each >x.find(" ") : JQuery >x.find : (selector: string) => JQuery >x : JQuery >find : (selector: string) => JQuery ->function () { - var $this: JQuery = $(''), - thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here - } : () => void +>function () { var $this: JQuery = $(''), thisBar = $this.find(".fx-usagebars-calloutbar-this"); // bug lead to 'could not find dotted symbol' here } : () => void var $this: JQuery = $(''), >$this : JQuery diff --git a/tests/baselines/reference/duplicateLabel1.errors.txt b/tests/baselines/reference/duplicateLabel1.errors.txt new file mode 100644 index 00000000000..7503b9b278f --- /dev/null +++ b/tests/baselines/reference/duplicateLabel1.errors.txt @@ -0,0 +1,7 @@ +==== tests/cases/compiler/duplicateLabel1.ts (1 errors) ==== + target: + target: + ~~~~~~ +!!! Duplicate label 'target' + while (true) { + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel2.errors.txt b/tests/baselines/reference/duplicateLabel2.errors.txt new file mode 100644 index 00000000000..da40c01d528 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel2.errors.txt @@ -0,0 +1,9 @@ +==== tests/cases/compiler/duplicateLabel2.ts (1 errors) ==== + target: + while (true) { + target: + ~~~~~~ +!!! Duplicate label 'target' + while (true) { + } + } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLabel3.js b/tests/baselines/reference/duplicateLabel3.js new file mode 100644 index 00000000000..37e9619e8f6 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel3.js @@ -0,0 +1,17 @@ +//// [duplicateLabel3.ts] +target: +while (true) { + function f() { + target: + while (true) { + } + } +} + +//// [duplicateLabel3.js] +target: while (true) { + function f() { + target: while (true) { + } + } +} diff --git a/tests/baselines/reference/duplicateLabel3.types b/tests/baselines/reference/duplicateLabel3.types new file mode 100644 index 00000000000..d4a26fa22a0 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel3.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/duplicateLabel3.ts === +target: +while (true) { + function f() { +>f : () => void + + target: + while (true) { + } + } +} diff --git a/tests/baselines/reference/duplicateLabel4.js b/tests/baselines/reference/duplicateLabel4.js new file mode 100644 index 00000000000..22d072d38d7 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel4.js @@ -0,0 +1,14 @@ +//// [duplicateLabel4.ts] +target: +while (true) { +} + +target: +while (true) { +} + +//// [duplicateLabel4.js] +target: while (true) { +} +target: while (true) { +} diff --git a/tests/baselines/reference/duplicateLabel4.types b/tests/baselines/reference/duplicateLabel4.types new file mode 100644 index 00000000000..c671abcef35 --- /dev/null +++ b/tests/baselines/reference/duplicateLabel4.types @@ -0,0 +1,9 @@ +=== tests/cases/compiler/duplicateLabel4.ts === +target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. +No type information for this code.target: +No type information for this code.while (true) { +No type information for this code.} +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt b/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt deleted file mode 100644 index e184b7761ea..00000000000 --- a/tests/baselines/reference/duplicatePropertiesInStrictMode.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -==== tests/cases/compiler/duplicatePropertiesInStrictMode.ts (2 errors) ==== - "use strict"; - var x = { - x: 1, - x: 2 - ~ -!!! An object literal cannot have multiple properties with the same name in strict mode. - ~ -!!! Duplicate identifier 'x'. - } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateStringIndexers.errors.txt b/tests/baselines/reference/duplicateStringIndexers.errors.txt deleted file mode 100644 index f4cfe243bd3..00000000000 --- a/tests/baselines/reference/duplicateStringIndexers.errors.txt +++ /dev/null @@ -1,47 +0,0 @@ -==== tests/cases/conformance/types/members/duplicateStringIndexers.ts (6 errors) ==== - // it is an error to have duplicate index signatures of the same kind in a type - - module test { - interface Number { - [x: string]: string; - [x: string]: string; - ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. - } - - interface String { - [x: string]: string; - [x: string]: string; - ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. - } - - interface Array { - [x: string]: T; - [x: string]: T; - ~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. - } - - class C { - [x: string]: string; - [x: string]: string; - ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. - } - - interface I { - [x: string]: string; - [x: string]: string; - ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. - } - - var a: { - [x: string]: string; - [x: string]: string; - ~~~~~~~~~~~~~~~~~~~~ -!!! Duplicate string index signature. - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/duplicateStringIndexers.js b/tests/baselines/reference/duplicateStringIndexers.js index e4f8b7c9f3c..af7952bce50 100644 --- a/tests/baselines/reference/duplicateStringIndexers.js +++ b/tests/baselines/reference/duplicateStringIndexers.js @@ -1,47 +1,43 @@ //// [duplicateStringIndexers.ts] // it is an error to have duplicate index signatures of the same kind in a type -module test { - interface Number { - [x: string]: string; - [x: string]: string; - } - - interface String { - [x: string]: string; - [x: string]: string; - } - - interface Array { - [x: string]: T; - [x: string]: T; - } - - class C { - [x: string]: string; - [x: string]: string; - } - - interface I { - [x: string]: string; - [x: string]: string; - } - - var a: { - [x: string]: string; - [x: string]: string; - } +interface Number { + [x: string]: string; + [x: string]: string; } + +interface String { + [x: string]: string; + [x: string]: string; +} + +interface Array { + [x: string]: T; + [x: string]: T; +} + +class C { + [x: string]: string; + [x: string]: string; +} + +interface I { + [x: string]: string; + [x: string]: string; +} + +var a: { + [x: string]: string; + [x: string]: string; +} + //// [duplicateStringIndexers.js] // it is an error to have duplicate index signatures of the same kind in a type -var test; -(function (test) { - var C = (function () { - function C() { - } - return C; - })(); - var a; -})(test || (test = {})); +var C = (function () { + function C() { + } + return C; +})(); +var a; diff --git a/tests/baselines/reference/duplicateVarAndImport.types b/tests/baselines/reference/duplicateVarAndImport.types deleted file mode 100644 index a21f68a27ff..00000000000 --- a/tests/baselines/reference/duplicateVarAndImport.types +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/compiler/duplicateVarAndImport.ts === -// no error since module is not instantiated - -var a; ->a : any - -module M { } ->M : M - -import a = M; ->a : any ->M : M - diff --git a/tests/baselines/reference/duplicateVarAndImport2.errors.txt b/tests/baselines/reference/duplicateVarAndImport2.errors.txt deleted file mode 100644 index b6f52fc23cb..00000000000 --- a/tests/baselines/reference/duplicateVarAndImport2.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/compiler/duplicateVarAndImport2.ts (1 errors) ==== - // error since module is instantiated - var a; - module M { export var x = 1; } - import a = M; - ~~~~~~~~~~~~~ -!!! Import declaration conflicts with local declaration of 'a' \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVariablesByScope.types b/tests/baselines/reference/duplicateVariablesByScope.types index ec20d665ad8..add12599a83 100644 --- a/tests/baselines/reference/duplicateVariablesByScope.types +++ b/tests/baselines/reference/duplicateVariablesByScope.types @@ -22,7 +22,7 @@ module M { } function foo() { ->foo : () => void +>foo : typeof foo var x = 2; >x : number diff --git a/tests/baselines/reference/emitBOM.types b/tests/baselines/reference/emitBOM.types deleted file mode 100644 index b38fd19c8f4..00000000000 --- a/tests/baselines/reference/emitBOM.types +++ /dev/null @@ -1,6 +0,0 @@ -=== tests/cases/compiler/emitBOM.ts === - -// JS and d.ts output should have a BOM but not the sourcemap -var x; ->x : any - diff --git a/tests/baselines/reference/emptyTypeArgumentList.errors.txt b/tests/baselines/reference/emptyTypeArgumentList.errors.txt deleted file mode 100644 index e05930401f7..00000000000 --- a/tests/baselines/reference/emptyTypeArgumentList.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/compiler/emptyTypeArgumentList.ts (2 errors) ==== - function foo() { } - foo<>(); - ~~ -!!! Type argument list cannot be empty. - ~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt b/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt deleted file mode 100644 index aad58ddfdce..00000000000 --- a/tests/baselines/reference/emptyTypeArgumentListWithNew.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/compiler/emptyTypeArgumentListWithNew.ts (2 errors) ==== - class foo { } - new foo<>(); - ~~ -!!! Type argument list cannot be empty. - ~~~~~~~~~~~ -!!! Supplied parameters do not match any signature of call target. \ No newline at end of file diff --git a/tests/baselines/reference/enumBasics.types b/tests/baselines/reference/enumBasics.types index 67c16c62620..f775295891a 100644 --- a/tests/baselines/reference/enumBasics.types +++ b/tests/baselines/reference/enumBasics.types @@ -158,9 +158,7 @@ enum E9 { // Enum constant members are propagated var doNotPropagate = [ >doNotPropagate : {}[] ->[ - E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z -] : {}[] +>[ E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z] : {}[] E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z >E8.B : E8 @@ -186,9 +184,7 @@ var doNotPropagate = [ // Enum computed members are not propagated var doPropagate = [ >doPropagate : {}[] ->[ - E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C -] : {}[] +>[ E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C] : {}[] E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C >E9.A : E9 diff --git a/tests/baselines/reference/enumBasics1.errors.txt b/tests/baselines/reference/enumBasics1.errors.txt index 6d9229341e2..d27def0a0bb 100644 --- a/tests/baselines/reference/enumBasics1.errors.txt +++ b/tests/baselines/reference/enumBasics1.errors.txt @@ -34,7 +34,7 @@ B, } - enum E2 { // should error for continued autonumbering + enum E2 { // shouldn't error C, ~ !!! In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element. diff --git a/tests/baselines/reference/enumBasics1.js b/tests/baselines/reference/enumBasics1.js index b6c8c75f334..67bd91b6e5f 100644 --- a/tests/baselines/reference/enumBasics1.js +++ b/tests/baselines/reference/enumBasics1.js @@ -32,7 +32,7 @@ enum E2 { B, } -enum E2 { // should error for continued autonumbering +enum E2 { // shouldn't error C, D, } diff --git a/tests/baselines/reference/enumInitializersWithExponents.errors.txt b/tests/baselines/reference/enumInitializersWithExponents.errors.txt deleted file mode 100644 index 60649475f78..00000000000 --- a/tests/baselines/reference/enumInitializersWithExponents.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -==== tests/cases/compiler/enumInitializersWithExponents.ts (2 errors) ==== - // Must be integer literals. - declare enum E { - a = 1e3, // ok - b = 1e25, // ok - c = 1e-3, // error - ~ -!!! Ambient enum elements can only have integer literal initializers. - d = 1e-9, // error - ~ -!!! Ambient enum elements can only have integer literal initializers. - e = 1e0, // ok - f = 1e+25 // ok - } \ No newline at end of file diff --git a/tests/baselines/reference/es6ClassTest5.types b/tests/baselines/reference/es6ClassTest5.types index d1d3ab1b780..887e103c0f4 100644 --- a/tests/baselines/reference/es6ClassTest5.types +++ b/tests/baselines/reference/es6ClassTest5.types @@ -8,9 +8,7 @@ class C1T5 { >s : string (i) => { ->(i) => { - return i; - } : (i: number) => number +>(i) => { return i; } : (i: number) => number >i : number return i; diff --git a/tests/baselines/reference/es6ClassTest8.types b/tests/baselines/reference/es6ClassTest8.types index 5272f192b85..ea78670bec5 100644 --- a/tests/baselines/reference/es6ClassTest8.types +++ b/tests/baselines/reference/es6ClassTest8.types @@ -1,6 +1,6 @@ === tests/cases/compiler/es6ClassTest8.ts === function f1(x:any) {return x;} ->f1 : (x: any) => any +>f1 : typeof f1 >x : any >x : any @@ -10,12 +10,8 @@ class C { constructor() { var bar:any = (function() { >bar : any ->(function() { - return bar; // 'bar' should be resolvable - }) : () => any ->function() { - return bar; // 'bar' should be resolvable - } : () => any +>(function() { return bar; // 'bar' should be resolvable }) : () => any +>function() { return bar; // 'bar' should be resolvable } : () => any return bar; // 'bar' should be resolvable >bar : any @@ -24,9 +20,9 @@ class C { var b = f1(f1(bar)); >b : any >f1(f1(bar)) : any ->f1 : (x: any) => any +>f1 : typeof f1 >f1(bar) : any ->f1 : (x: any) => any +>f1 : typeof f1 >bar : any } @@ -36,13 +32,13 @@ class Vector { >Vector : Vector static norm(v:Vector):Vector {return null;} ->norm : (v: Vector) => Vector +>norm : typeof norm >v : Vector >Vector : Vector >Vector : Vector static minus(v1:Vector, v2:Vector):Vector {return null;} ->minus : (v1: Vector, v2: Vector) => Vector +>minus : typeof minus >v1 : Vector >Vector : Vector >v2 : Vector @@ -50,7 +46,7 @@ class Vector { >Vector : Vector static times(v1:Vector, v2:Vector):Vector {return null;} ->times : (v1: Vector, v2: Vector) => Vector +>times : typeof times >v1 : Vector >Vector : Vector >v2 : Vector @@ -58,7 +54,7 @@ class Vector { >Vector : Vector static cross(v1:Vector, v2:Vector):Vector {return null;} ->cross : (v1: Vector, v2: Vector) => Vector +>cross : typeof cross >v1 : Vector >Vector : Vector >v2 : Vector @@ -76,7 +72,7 @@ class Vector { } static dot(v1:Vector, v2:Vector):Vector {return null;} ->dot : (v1: Vector, v2: Vector) => Vector +>dot : typeof dot >v1 : Vector >Vector : Vector >v2 : Vector @@ -118,13 +114,13 @@ class Camera { >this : Camera >forward : Vector >Vector.norm(Vector.minus(lookAt,this.pos)) : Vector ->Vector.norm : (v: Vector) => Vector +>Vector.norm : typeof norm >Vector : typeof Vector ->norm : (v: Vector) => Vector +>norm : typeof norm >Vector.minus(lookAt,this.pos) : Vector ->Vector.minus : (v1: Vector, v2: Vector) => Vector +>Vector.minus : typeof minus >Vector : typeof Vector ->minus : (v1: Vector, v2: Vector) => Vector +>minus : typeof minus >lookAt : Vector >this.pos : Vector >this : Camera @@ -136,18 +132,18 @@ class Camera { >this : Camera >right : Vector >Vector.times(down, Vector.norm(Vector.cross(this.forward, down))) : Vector ->Vector.times : (v1: Vector, v2: Vector) => Vector +>Vector.times : typeof times >Vector : typeof Vector ->times : (v1: Vector, v2: Vector) => Vector +>times : typeof times >down : Vector >Vector.norm(Vector.cross(this.forward, down)) : Vector ->Vector.norm : (v: Vector) => Vector +>Vector.norm : typeof norm >Vector : typeof Vector ->norm : (v: Vector) => Vector +>norm : typeof norm >Vector.cross(this.forward, down) : Vector ->Vector.cross : (v1: Vector, v2: Vector) => Vector +>Vector.cross : typeof cross >Vector : typeof Vector ->cross : (v1: Vector, v2: Vector) => Vector +>cross : typeof cross >this.forward : Vector >this : Camera >forward : Vector @@ -159,18 +155,18 @@ class Camera { >this : Camera >up : Vector >Vector.times(down, Vector.norm(Vector.cross(this.forward, this.right))) : Vector ->Vector.times : (v1: Vector, v2: Vector) => Vector +>Vector.times : typeof times >Vector : typeof Vector ->times : (v1: Vector, v2: Vector) => Vector +>times : typeof times >down : Vector >Vector.norm(Vector.cross(this.forward, this.right)) : Vector ->Vector.norm : (v: Vector) => Vector +>Vector.norm : typeof norm >Vector : typeof Vector ->norm : (v: Vector) => Vector +>norm : typeof norm >Vector.cross(this.forward, this.right) : Vector ->Vector.cross : (v1: Vector, v2: Vector) => Vector +>Vector.cross : typeof cross >Vector : typeof Vector ->cross : (v1: Vector, v2: Vector) => Vector +>cross : typeof cross >this.forward : Vector >this : Camera >forward : Vector diff --git a/tests/baselines/reference/everyTypeAssignableToAny.types b/tests/baselines/reference/everyTypeAssignableToAny.types index 89af4f4b7c0..850a906ff9a 100644 --- a/tests/baselines/reference/everyTypeAssignableToAny.types +++ b/tests/baselines/reference/everyTypeAssignableToAny.types @@ -180,7 +180,7 @@ a = ae; >ae : E function foo(x: T, y: U, z: V) { ->foo : (x: T, y: U, z: V) => void +>foo : typeof foo >T : T >U : U >V : V diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types index 49f2ac2a781..a51aada11a7 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.types @@ -35,7 +35,7 @@ class D{ } function F(x: string): number { return 42; } ->F : (x: string) => number +>F : typeof F >x : string module M { @@ -49,7 +49,7 @@ module M { } export function F2(x: number): string { return x.toString(); } ->F2 : (x: number) => string +>F2 : typeof F2 >x : number >x.toString() : string >x.toString : (radix?: number) => string @@ -117,18 +117,18 @@ var anOtherObjectLiteral: { id: number } = new C(); >C : typeof C var aFunction: typeof F = F; ->aFunction : (x: string) => number ->F : (x: string) => number ->F : (x: string) => number +>aFunction : typeof F +>F : typeof F +>F : typeof F var anOtherFunction: (x: string) => number = F; >anOtherFunction : (x: string) => number >x : string ->F : (x: string) => number +>F : typeof F var aLambda: typeof F = (x) => 2; ->aLambda : (x: string) => number ->F : (x: string) => number +>aLambda : typeof F +>F : typeof F >(x) => 2 : (x: string) => number >x : string @@ -147,9 +147,9 @@ var aClassInModule: M.A = new M.A(); >A : typeof A var aFunctionInModule: typeof M.F2 = (x) => 'this is a string'; ->aFunctionInModule : (x: number) => string +>aFunctionInModule : typeof F2 >M : typeof M ->F2 : (x: number) => string +>F2 : typeof F2 >(x) => 'this is a string' : (x: number) => string >x : number diff --git a/tests/baselines/reference/everyTypeWithInitializer.types b/tests/baselines/reference/everyTypeWithInitializer.types index a721a88a5ca..4fdc818e830 100644 --- a/tests/baselines/reference/everyTypeWithInitializer.types +++ b/tests/baselines/reference/everyTypeWithInitializer.types @@ -35,7 +35,7 @@ class D{ } function F(x: string): number { return 42; } ->F : (x: string) => number +>F : typeof F >x : string module M { @@ -49,7 +49,7 @@ module M { } export function F2(x: number): string { return x.toString(); } ->F2 : (x: number) => string +>F2 : typeof F2 >x : number >x.toString() : string >x.toString : (radix?: number) => string @@ -103,8 +103,8 @@ var anObjectLiteral = { id: 12 }; >id : number var aFunction = F; ->aFunction : (x: string) => number ->F : (x: string) => number +>aFunction : typeof F +>F : typeof F var aLambda = (x) => 2; >aLambda : (x: any) => number @@ -123,10 +123,10 @@ var aClassInModule = new M.A(); >A : typeof A var aFunctionInModule = M.F2; ->aFunctionInModule : (x: number) => string ->M.F2 : (x: number) => string +>aFunctionInModule : typeof F2 +>M.F2 : typeof F2 >M : typeof M ->F2 : (x: number) => string +>F2 : typeof F2 // no initializer or annotation, so this is an 'any' var x; diff --git a/tests/baselines/reference/exportAssignmentFunction.types b/tests/baselines/reference/exportAssignmentFunction.types index 023a8c234d2..95e50be2c71 100644 --- a/tests/baselines/reference/exportAssignmentFunction.types +++ b/tests/baselines/reference/exportAssignmentFunction.types @@ -1,16 +1,16 @@ === tests/cases/compiler/exportAssignmentFunction_B.ts === import fooFunc = require("exportAssignmentFunction_A"); ->fooFunc : () => number +>fooFunc : typeof foo var n: number = fooFunc(); >n : number >fooFunc() : number ->fooFunc : () => number +>fooFunc : typeof foo === tests/cases/compiler/exportAssignmentFunction_A.ts === function foo() { return 0; } ->foo : () => number +>foo : typeof foo export = foo; ->foo : () => number +>foo : typeof foo diff --git a/tests/baselines/reference/exportAssignmentMergedModule.types b/tests/baselines/reference/exportAssignmentMergedModule.types index 42dfe518d33..a71b94c7b1b 100644 --- a/tests/baselines/reference/exportAssignmentMergedModule.types +++ b/tests/baselines/reference/exportAssignmentMergedModule.types @@ -5,9 +5,9 @@ import foo = require("./foo_0"); var a: number = foo.a(); >a : number >foo.a() : number ->foo.a : () => number +>foo.a : typeof a >foo : typeof Foo ->a : () => number +>a : typeof a if(!!foo.b){ >!!foo.b : boolean @@ -24,16 +24,16 @@ if(!!foo.b){ >Test : typeof Test >answer : number >foo.c(42) : number ->foo.c : (a: number) => number +>foo.c : typeof c >foo : typeof Foo ->c : (a: number) => number +>c : typeof c } === tests/cases/conformance/externalModules/foo_0.ts === module Foo { >Foo : typeof Foo export function a(){ ->a : () => number +>a : typeof a return 5; } @@ -44,7 +44,7 @@ module Foo { >Foo : typeof Foo export function c(a: number){ ->c : (a: number) => number +>c : typeof c >a : number return a; diff --git a/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt b/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt deleted file mode 100644 index 2dd71ce0d07..00000000000 --- a/tests/baselines/reference/exportAssignmentWithDeclareAndExportModifiers.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/compiler/exportAssignmentWithDeclareAndExportModifiers.ts (2 errors) ==== - var x; - export declare export = x; - ~~~~~~~~~~~~~~ -!!! An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt b/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt deleted file mode 100644 index 27b202ce0c8..00000000000 --- a/tests/baselines/reference/exportAssignmentWithDeclareModifier.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/compiler/exportAssignmentWithDeclareModifier.ts (2 errors) ==== - var x; - declare export = x; - ~~~~~~~ -!!! An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt b/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt deleted file mode 100644 index dc3d6cb4cc5..00000000000 --- a/tests/baselines/reference/exportAssignmentWithExportModifier.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/compiler/exportAssignmentWithExportModifier.ts (2 errors) ==== - var x; - export export = x; - ~~~~~~ -!!! An export assignment cannot have modifiers. - ~~~~~~~~~~~~~~~~~~ -!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/exportCodeGen.types b/tests/baselines/reference/exportCodeGen.types index 89cb16fdf4c..348d8f9c46f 100644 --- a/tests/baselines/reference/exportCodeGen.types +++ b/tests/baselines/reference/exportCodeGen.types @@ -9,7 +9,7 @@ module A { >x : number function lt12() { ->lt12 : () => boolean +>lt12 : typeof lt12 return x < 12; >x < 12 : boolean @@ -25,7 +25,7 @@ module B { >x : number function lt12() { ->lt12 : () => boolean +>lt12 : typeof lt12 return x < 12; >x < 12 : boolean @@ -38,7 +38,7 @@ module C { >C : typeof C function no() { ->no : () => boolean +>no : typeof no return false; } @@ -49,7 +49,7 @@ module D { >D : typeof D export function yes() { ->yes : () => boolean +>yes : typeof yes return true; } @@ -64,7 +64,7 @@ module E { >Red : Color export function fn() { } ->fn : () => void +>fn : typeof fn export interface I { id: number } >I : I @@ -92,7 +92,7 @@ module F { >Red : Color function fn() { } ->fn : () => void +>fn : typeof fn interface I { id: number } >I : I diff --git a/tests/baselines/reference/exportImport.types b/tests/baselines/reference/exportImport.types index 3fa93127cc8..7f7bdba5d03 100644 --- a/tests/baselines/reference/exportImport.types +++ b/tests/baselines/reference/exportImport.types @@ -3,7 +3,7 @@ import e = require('./exporter'); >e : typeof "tests/cases/compiler/exporter" export function w(): e.w { // Should be OK ->w : () => Widget1 +>w : typeof w >e : e >w : Widget1 diff --git a/tests/baselines/reference/exportImportMultipleFiles.types b/tests/baselines/reference/exportImportMultipleFiles.types index 02b17bd4101..a46732e4de2 100644 --- a/tests/baselines/reference/exportImportMultipleFiles.types +++ b/tests/baselines/reference/exportImportMultipleFiles.types @@ -4,15 +4,15 @@ import lib = require('./exportImportMultipleFiles_library'); lib.math.add(3, 4); // Shouldnt be error >lib.math.add(3, 4) : any ->lib.math.add : (a: any, b: any) => any +>lib.math.add : typeof add >lib.math : typeof "tests/cases/compiler/exportImportMultipleFiles_math" >lib : typeof "tests/cases/compiler/exportImportMultipleFiles_library" >math : typeof "tests/cases/compiler/exportImportMultipleFiles_math" ->add : (a: any, b: any) => any +>add : typeof add === tests/cases/compiler/exportImportMultipleFiles_math.ts === export function add(a, b) { return a + b; } ->add : (a: any, b: any) => any +>add : typeof add >a : any >b : any >a + b : any @@ -25,7 +25,7 @@ export import math = require("exportImportMultipleFiles_math"); math.add(3, 4); // OK >math.add(3, 4) : any ->math.add : (a: any, b: any) => any +>math.add : typeof add >math : typeof "tests/cases/compiler/exportImportMultipleFiles_math" ->add : (a: any, b: any) => any +>add : typeof add diff --git a/tests/baselines/reference/exportImportNonInstantiatedModule2.types b/tests/baselines/reference/exportImportNonInstantiatedModule2.types index 2138bce4831..5d4ba1650e2 100644 --- a/tests/baselines/reference/exportImportNonInstantiatedModule2.types +++ b/tests/baselines/reference/exportImportNonInstantiatedModule2.types @@ -3,7 +3,7 @@ import e = require('./exporter'); >e : typeof "tests/cases/compiler/exporter" export function w(): e.w { // Should be OK ->w : () => Widget1 +>w : typeof w >e : e >w : Widget1 diff --git a/tests/baselines/reference/exportVisibility.types b/tests/baselines/reference/exportVisibility.types index 59936828275..c972bd0e5d6 100644 --- a/tests/baselines/reference/exportVisibility.types +++ b/tests/baselines/reference/exportVisibility.types @@ -9,7 +9,7 @@ export var foo = new Foo(); >Foo : typeof Foo export function test(foo: Foo) { ->test : (foo: Foo) => boolean +>test : typeof test >foo : Foo >Foo : Foo diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types index 20a683c5968..11875e105b4 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.types @@ -25,10 +25,7 @@ var moduleMap: { [key: string]: IHasVisualizationModel } = { >moduleMap : { [x: string]: IHasVisualizationModel; } >key : string >IHasVisualizationModel : IHasVisualizationModel ->{ - "moduleA": moduleA, - "moduleB": moduleB -} : { [x: string]: IHasVisualizationModel; "moduleA": typeof "tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleA"; "moduleB": typeof "tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleB"; } +>{ "moduleA": moduleA, "moduleB": moduleB} : { [x: string]: IHasVisualizationModel; "moduleA": typeof "tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleA"; "moduleB": typeof "tests/cases/compiler/extendingClassFromAliasAndUsageInIndexer_moduleB"; } "moduleA": moduleA, >moduleA : moduleA diff --git a/tests/baselines/reference/externFunc.types b/tests/baselines/reference/externFunc.types index 5aac52ac125..2ba2886873d 100644 --- a/tests/baselines/reference/externFunc.types +++ b/tests/baselines/reference/externFunc.types @@ -1,9 +1,9 @@ === tests/cases/compiler/externFunc.ts === declare function parseInt(s:string):number; ->parseInt : { (s: string, radix?: number): number; (s: string): number; } +>parseInt : typeof parseInt >s : string parseInt("2"); >parseInt("2") : number ->parseInt : { (s: string, radix?: number): number; (s: string): number; } +>parseInt : typeof parseInt diff --git a/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.types b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.types index d0e60ad36ed..56cf4188cba 100644 --- a/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.types +++ b/tests/baselines/reference/externalModuleReferenceOfImportDeclarationWithExportModifier.types @@ -4,11 +4,11 @@ export import file1 = require('externalModuleReferenceOfImportDeclarationWithExp file1.foo(); >file1.foo() : void ->file1.foo : () => void +>file1.foo : typeof foo >file1 : typeof "tests/cases/compiler/externalModuleReferenceOfImportDeclarationWithExportModifier_0" ->foo : () => void +>foo : typeof foo === tests/cases/compiler/externalModuleReferenceOfImportDeclarationWithExportModifier_0.ts === export function foo() { }; ->foo : () => void +>foo : typeof foo diff --git a/tests/baselines/reference/fatArrowSelf.types b/tests/baselines/reference/fatArrowSelf.types index 19d0b2d61b0..e018600dc4f 100644 --- a/tests/baselines/reference/fatArrowSelf.types +++ b/tests/baselines/reference/fatArrowSelf.types @@ -35,17 +35,13 @@ module Consumer { >register : () => void this.emitter.addListener('change', (e) => { ->this.emitter.addListener('change', (e) => { - this.changed(); - }) : void +>this.emitter.addListener('change', (e) => { this.changed(); }) : void >this.emitter.addListener : (type: string, listener: ListenerCallback) => void >this.emitter : EventEmitter >this : EventEmitterConsummer >emitter : EventEmitter >addListener : (type: string, listener: ListenerCallback) => void ->(e) => { - this.changed(); - } : (e: any) => void +>(e) => { this.changed(); } : (e: any) => void >e : any this.changed(); diff --git a/tests/baselines/reference/fatarrowfunctions.types b/tests/baselines/reference/fatarrowfunctions.types index 5863436ef4e..0ac210f1b4e 100644 --- a/tests/baselines/reference/fatarrowfunctions.types +++ b/tests/baselines/reference/fatarrowfunctions.types @@ -1,7 +1,7 @@ === tests/cases/compiler/fatarrowfunctions.ts === function foo(x:any) { ->foo : (x: any) => any +>foo : typeof foo >x : any return x(); @@ -12,7 +12,7 @@ function foo(x:any) { foo((x:number,y,z)=>{return x+y+z;}); >foo((x:number,y,z)=>{return x+y+z;}) : any ->foo : (x: any) => any +>foo : typeof foo >(x:number,y,z)=>{return x+y+z;} : (x: number, y: any, z: any) => any >x : number >y : any @@ -25,7 +25,7 @@ foo((x:number,y,z)=>{return x+y+z;}); foo((x,y,z)=>{return x+y+z;}); >foo((x,y,z)=>{return x+y+z;}) : any ->foo : (x: any) => any +>foo : typeof foo >(x,y,z)=>{return x+y+z;} : (x: any, y: any, z: any) => any >x : any >y : any @@ -38,7 +38,7 @@ foo((x,y,z)=>{return x+y+z;}); foo((x,y:number,z)=>{return x+y+z;}); >foo((x,y:number,z)=>{return x+y+z;}) : any ->foo : (x: any) => any +>foo : typeof foo >(x,y:number,z)=>{return x+y+z;} : (x: any, y: number, z: any) => any >x : any >y : number @@ -51,7 +51,7 @@ foo((x,y:number,z)=>{return x+y+z;}); foo((x,y:number,z:number)=>{return x+y+z;}); >foo((x,y:number,z:number)=>{return x+y+z;}) : any ->foo : (x: any) => any +>foo : typeof foo >(x,y:number,z:number)=>{return x+y+z;} : (x: any, y: number, z: number) => any >x : any >y : number @@ -64,7 +64,7 @@ foo((x,y:number,z:number)=>{return x+y+z;}); foo((x,y,z:number)=>{return x+y+z;}); >foo((x,y,z:number)=>{return x+y+z;}) : any ->foo : (x: any) => any +>foo : typeof foo >(x,y,z:number)=>{return x+y+z;} : (x: any, y: any, z: number) => any >x : any >y : any @@ -77,12 +77,12 @@ foo((x,y,z:number)=>{return x+y+z;}); foo(()=>{return 0;}); >foo(()=>{return 0;}) : any ->foo : (x: any) => any +>foo : typeof foo >()=>{return 0;} : () => number foo((x:number,y,z)=>x+y+z); >foo((x:number,y,z)=>x+y+z) : any ->foo : (x: any) => any +>foo : typeof foo >(x:number,y,z)=>x+y+z : (x: number, y: any, z: any) => any >x : number >y : any @@ -95,7 +95,7 @@ foo((x:number,y,z)=>x+y+z); foo((x,y,z)=>x+y+z); >foo((x,y,z)=>x+y+z) : any ->foo : (x: any) => any +>foo : typeof foo >(x,y,z)=>x+y+z : (x: any, y: any, z: any) => any >x : any >y : any @@ -108,7 +108,7 @@ foo((x,y,z)=>x+y+z); foo((x,y:number,z)=>{return x+y+z;}); >foo((x,y:number,z)=>{return x+y+z;}) : any ->foo : (x: any) => any +>foo : typeof foo >(x,y:number,z)=>{return x+y+z;} : (x: any, y: number, z: any) => any >x : any >y : number @@ -121,7 +121,7 @@ foo((x,y:number,z)=>{return x+y+z;}); foo((x,y:number,z:number)=>{return x+y+z;}); >foo((x,y:number,z:number)=>{return x+y+z;}) : any ->foo : (x: any) => any +>foo : typeof foo >(x,y:number,z:number)=>{return x+y+z;} : (x: any, y: number, z: number) => any >x : any >y : number @@ -134,7 +134,7 @@ foo((x,y:number,z:number)=>{return x+y+z;}); foo((x,y,z:number)=>{return x+y+z;}); >foo((x,y,z:number)=>{return x+y+z;}) : any ->foo : (x: any) => any +>foo : typeof foo >(x,y,z:number)=>{return x+y+z;} : (x: any, y: any, z: number) => any >x : any >y : any @@ -147,13 +147,13 @@ foo((x,y,z:number)=>{return x+y+z;}); foo(()=>{return 0;}); >foo(()=>{return 0;}) : any ->foo : (x: any) => any +>foo : typeof foo >()=>{return 0;} : () => number foo(((x) => x)); >foo(((x) => x)) : any ->foo : (x: any) => any +>foo : typeof foo >((x) => x) : (x: any) => any >(x) => x : (x: any) => any >x : any @@ -161,7 +161,7 @@ foo(((x) => x)); foo(x => x*x); >foo(x => x*x) : any ->foo : (x: any) => any +>foo : typeof foo >x => x*x : (x: any) => number >x : any >x*x : number @@ -189,7 +189,7 @@ var w = () => 3; >() => 3 : () => number function ternaryTest(isWhile:boolean) { ->ternaryTest : (isWhile: boolean) => void +>ternaryTest : typeof ternaryTest >isWhile : boolean var f = isWhile ? function (n) { return n > 0; } : function (n) { return n === 0; }; @@ -208,32 +208,25 @@ function ternaryTest(isWhile:boolean) { } declare function setTimeout(expression: any, msec?: number, language?: any): number; ->setTimeout : (expression: any, msec?: number, language?: any) => number +>setTimeout : typeof setTimeout >expression : any >msec : number >language : any var messenger = { >messenger : { message: string; start: () => void; } ->{ - message: "Hello World", - start: function() { - setTimeout(() => { this.message.toString(); }, 3000); - } -} : { message: string; start: () => void; } +>{ message: "Hello World", start: function() { setTimeout(() => { this.message.toString(); }, 3000); }} : { message: string; start: () => void; } message: "Hello World", >message : string start: function() { >start : () => void ->function() { - setTimeout(() => { this.message.toString(); }, 3000); - } : () => void +>function() { setTimeout(() => { this.message.toString(); }, 3000); } : () => void setTimeout(() => { this.message.toString(); }, 3000); >setTimeout(() => { this.message.toString(); }, 3000) : number ->setTimeout : (expression: any, msec?: number, language?: any) => number +>setTimeout : typeof setTimeout >() => { this.message.toString(); } : () => void >this.message.toString() : any >this.message.toString : any diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types index cf561eb08af..57cfb46b109 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctionParameterDefaults.types @@ -1,6 +1,6 @@ === tests/cases/compiler/fatarrowfunctionsInFunctionParameterDefaults.ts === function fn(x = () => this, y = x()) { ->fn : (x?: () => any, y?: any) => any +>fn : typeof fn >x : () => any >() => this : () => any >this : any @@ -17,6 +17,6 @@ function fn(x = () => this, y = x()) { fn.call(4); // Should be 4 >fn.call(4) : any >fn.call : (thisArg: any, ...argArray: any[]) => any ->fn : (x?: () => any, y?: any) => any +>fn : typeof fn >call : (thisArg: any, ...argArray: any[]) => any diff --git a/tests/baselines/reference/fatarrowfunctionsInFunctions.types b/tests/baselines/reference/fatarrowfunctionsInFunctions.types index f92f2ae2cb1..7a91fa42d6f 100644 --- a/tests/baselines/reference/fatarrowfunctionsInFunctions.types +++ b/tests/baselines/reference/fatarrowfunctionsInFunctions.types @@ -1,46 +1,29 @@ === tests/cases/compiler/fatarrowfunctionsInFunctions.ts === declare function setTimeout(expression: any, msec?: number, language?: any): number; ->setTimeout : (expression: any, msec?: number, language?: any) => number +>setTimeout : typeof setTimeout >expression : any >msec : number >language : any var messenger = { >messenger : { message: string; start: () => void; } ->{ - message: "Hello World", - start: function() { - var _self = this; - setTimeout(function() { - _self.message.toString(); - }, 3000); - } -} : { message: string; start: () => void; } +>{ message: "Hello World", start: function() { var _self = this; setTimeout(function() { _self.message.toString(); }, 3000); }} : { message: string; start: () => void; } message: "Hello World", >message : string start: function() { >start : () => void ->function() { - var _self = this; - setTimeout(function() { - _self.message.toString(); - }, 3000); - } : () => void +>function() { var _self = this; setTimeout(function() { _self.message.toString(); }, 3000); } : () => void var _self = this; >_self : any >this : any setTimeout(function() { ->setTimeout(function() { - _self.message.toString(); - }, 3000) : number ->setTimeout : (expression: any, msec?: number, language?: any) => number ->function() { - _self.message.toString(); - } : () => void +>setTimeout(function() { _self.message.toString(); }, 3000) : number +>setTimeout : typeof setTimeout +>function() { _self.message.toString(); } : () => void _self.message.toString(); >_self.message.toString() : any diff --git a/tests/baselines/reference/fileReferencesWithNoExtensions.types b/tests/baselines/reference/fileReferencesWithNoExtensions.types deleted file mode 100644 index ec58e338345..00000000000 --- a/tests/baselines/reference/fileReferencesWithNoExtensions.types +++ /dev/null @@ -1,32 +0,0 @@ -=== tests/cases/compiler/t.ts === -/// -/// -/// -var a = aa; // Check that a.ts is referenced ->a : number ->aa : number - -var b = bb; // Check that b.d.ts is referenced ->b : number ->bb : number - -var c = cc; // Check that c.ts has precedence over c.d.ts ->c : number ->cc : number - -=== tests/cases/compiler/a.ts === -var aa = 1; ->aa : number - -=== tests/cases/compiler/b.d.ts === -declare var bb: number; ->bb : number - -=== tests/cases/compiler/c.ts === -var cc = 1; ->cc : number - -=== tests/cases/compiler/c.d.ts === -declare var xx: number; ->xx : number - diff --git a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types index 95214571df9..d3781874b56 100644 --- a/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types +++ b/tests/baselines/reference/fixTypeParameterInSignatureWithRestParameters.types @@ -1,6 +1,6 @@ === tests/cases/compiler/fixTypeParameterInSignatureWithRestParameters.ts === function bar(item1: T, item2: T) { } ->bar : (item1: T, item2: T) => void +>bar : typeof bar >T : T >item1 : T >T : T @@ -9,5 +9,5 @@ function bar(item1: T, item2: T) { } bar(1, ""); // Should be ok >bar(1, "") : void ->bar : (item1: T, item2: T) => void +>bar : typeof bar diff --git a/tests/baselines/reference/forInStatement3.types b/tests/baselines/reference/forInStatement3.types index 1d3803065bd..e98730e48b9 100644 --- a/tests/baselines/reference/forInStatement3.types +++ b/tests/baselines/reference/forInStatement3.types @@ -1,6 +1,6 @@ === tests/cases/compiler/forInStatement3.ts === function F() { ->F : () => void +>F : typeof F >T : T var expr: T; diff --git a/tests/baselines/reference/forStatements.types b/tests/baselines/reference/forStatements.types index d8c9d444168..06b162c0f6e 100644 --- a/tests/baselines/reference/forStatements.types +++ b/tests/baselines/reference/forStatements.types @@ -35,7 +35,7 @@ class D{ } function F(x: string): number { return 42; } ->F : (x: string) => number +>F : typeof F >x : string module M { @@ -49,7 +49,7 @@ module M { } export function F2(x: number): string { return x.toString(); } ->F2 : (x: number) => string +>F2 : typeof F2 >x : number >x.toString() : string >x.toString : (radix?: number) => string @@ -117,18 +117,18 @@ for(var anOtherObjectLiteral: { id: number } = new C();;){} >C : typeof C for(var aFunction: typeof F = F;;){} ->aFunction : (x: string) => number ->F : (x: string) => number ->F : (x: string) => number +>aFunction : typeof F +>F : typeof F +>F : typeof F for(var anOtherFunction: (x: string) => number = F;;){} >anOtherFunction : (x: string) => number >x : string ->F : (x: string) => number +>F : typeof F for(var aLambda: typeof F = (x) => 2;;){} ->aLambda : (x: string) => number ->F : (x: string) => number +>aLambda : typeof F +>F : typeof F >(x) => 2 : (x: string) => number >x : string @@ -147,9 +147,9 @@ for(var aClassInModule: M.A = new M.A();;){} >A : typeof A for(var aFunctionInModule: typeof M.F2 = (x) => 'this is a string';;){} ->aFunctionInModule : (x: number) => string +>aFunctionInModule : typeof F2 >M : typeof M ->F2 : (x: number) => string +>F2 : typeof F2 >(x) => 'this is a string' : (x: number) => string >x : number diff --git a/tests/baselines/reference/forStatementsMultipleValidDecl.types b/tests/baselines/reference/forStatementsMultipleValidDecl.types index f894eef1404..f5401754e29 100644 --- a/tests/baselines/reference/forStatementsMultipleValidDecl.types +++ b/tests/baselines/reference/forStatementsMultipleValidDecl.types @@ -14,7 +14,7 @@ for (var x = undefined; ;) { } // new declaration space, making redeclaring x as a string valid function declSpace() { ->declSpace : () => void +>declSpace : typeof declSpace for (var x = 'this is a string'; ;) { } >x : string diff --git a/tests/baselines/reference/funcdecl.types b/tests/baselines/reference/funcdecl.types index 52f73f2a06c..a5e288b8394 100644 --- a/tests/baselines/reference/funcdecl.types +++ b/tests/baselines/reference/funcdecl.types @@ -1,42 +1,42 @@ === tests/cases/compiler/funcdecl.ts === function simpleFunc() { ->simpleFunc : () => string +>simpleFunc : typeof simpleFunc return "this is my simple func"; } var simpleFuncVar = simpleFunc; ->simpleFuncVar : () => string ->simpleFunc : () => string +>simpleFuncVar : typeof simpleFunc +>simpleFunc : typeof simpleFunc function anotherFuncNoReturn() { ->anotherFuncNoReturn : () => void +>anotherFuncNoReturn : typeof anotherFuncNoReturn } var anotherFuncNoReturnVar = anotherFuncNoReturn; ->anotherFuncNoReturnVar : () => void ->anotherFuncNoReturn : () => void +>anotherFuncNoReturnVar : typeof anotherFuncNoReturn +>anotherFuncNoReturn : typeof anotherFuncNoReturn function withReturn() : string{ ->withReturn : () => string +>withReturn : typeof withReturn return "Hello"; } var withReturnVar = withReturn; ->withReturnVar : () => string ->withReturn : () => string +>withReturnVar : typeof withReturn +>withReturn : typeof withReturn function withParams(a : string) : string{ ->withParams : (a: string) => string +>withParams : typeof withParams >a : string return a; >a : string } var withparamsVar = withParams; ->withparamsVar : (a: string) => string ->withParams : (a: string) => string +>withparamsVar : typeof withParams +>withParams : typeof withParams function withMultiParams(a : number, b, c: Object) { ->withMultiParams : (a: number, b: any, c: Object) => number +>withMultiParams : typeof withMultiParams >a : number >b : any >c : Object @@ -46,39 +46,39 @@ function withMultiParams(a : number, b, c: Object) { >a : number } var withMultiParamsVar = withMultiParams; ->withMultiParamsVar : (a: number, b: any, c: Object) => number ->withMultiParams : (a: number, b: any, c: Object) => number +>withMultiParamsVar : typeof withMultiParams +>withMultiParams : typeof withMultiParams function withOptionalParams(a?: string) { ->withOptionalParams : (a?: string) => void +>withOptionalParams : typeof withOptionalParams >a : string } var withOptionalParamsVar = withOptionalParams; ->withOptionalParamsVar : (a?: string) => void ->withOptionalParams : (a?: string) => void +>withOptionalParamsVar : typeof withOptionalParams +>withOptionalParams : typeof withOptionalParams function withInitializedParams(a: string, b0, b = 30, c = "string value") { ->withInitializedParams : (a: string, b0: any, b?: number, c?: string) => void +>withInitializedParams : typeof withInitializedParams >a : string >b0 : any >b : number >c : string } var withInitializedParamsVar = withInitializedParams; ->withInitializedParamsVar : (a: string, b0: any, b?: number, c?: string) => void ->withInitializedParams : (a: string, b0: any, b?: number, c?: string) => void +>withInitializedParamsVar : typeof withInitializedParams +>withInitializedParams : typeof withInitializedParams function withOptionalInitializedParams(a: string, c: string = "hello string") { ->withOptionalInitializedParams : (a: string, c?: string) => void +>withOptionalInitializedParams : typeof withOptionalInitializedParams >a : string >c : string } var withOptionalInitializedParamsVar = withOptionalInitializedParams; ->withOptionalInitializedParamsVar : (a: string, c?: string) => void ->withOptionalInitializedParams : (a: string, c?: string) => void +>withOptionalInitializedParamsVar : typeof withOptionalInitializedParams +>withOptionalInitializedParams : typeof withOptionalInitializedParams function withRestParams(a: string, ... myRestParameter : number[]) { ->withRestParams : (a: string, ...myRestParameter: number[]) => number[] +>withRestParams : typeof withRestParams >a : string >myRestParameter : number[] @@ -86,19 +86,19 @@ function withRestParams(a: string, ... myRestParameter : number[]) { >myRestParameter : number[] } var withRestParamsVar = withRestParams; ->withRestParamsVar : (a: string, ...myRestParameter: number[]) => number[] ->withRestParams : (a: string, ...myRestParameter: number[]) => number[] +>withRestParamsVar : typeof withRestParams +>withRestParams : typeof withRestParams function overload1(n: number) : string; ->overload1 : { (n: number): string; (s: string): string; } +>overload1 : typeof overload1 >n : number function overload1(s: string) : string; ->overload1 : { (n: number): string; (s: string): string; } +>overload1 : typeof overload1 >s : string function overload1(ns: any) { ->overload1 : { (n: number): string; (s: string): string; } +>overload1 : typeof overload1 >ns : any return ns.toString(); @@ -108,37 +108,29 @@ function overload1(ns: any) { >toString : any } var withOverloadSignature = overload1; ->withOverloadSignature : { (n: number): string; (s: string): string; } ->overload1 : { (n: number): string; (s: string): string; } +>withOverloadSignature : typeof overload1 +>overload1 : typeof overload1 function f(n: () => void) { } ->f : (n: () => void) => void +>f : typeof f >n : () => void module m2 { >m2 : typeof m2 export function foo(n: () => void ) { ->foo : (n: () => void) => void +>foo : typeof foo >n : () => void } } m2.foo(() => { ->m2.foo(() => { - - var b = 30; - return b; -}) : void ->m2.foo : (n: () => void) => void +>m2.foo(() => { var b = 30; return b;}) : void +>m2.foo : typeof foo >m2 : typeof m2 ->foo : (n: () => void) => void ->() => { - - var b = 30; - return b; -} : () => number +>foo : typeof foo +>() => { var b = 30; return b;} : () => number var b = 30; >b : number @@ -150,22 +142,20 @@ m2.foo(() => { declare function fooAmbient(n: number): string; ->fooAmbient : (n: number) => string +>fooAmbient : typeof fooAmbient >n : number declare function overloadAmbient(n: number): string; ->overloadAmbient : { (n: number): string; (s: string): string; } +>overloadAmbient : typeof overloadAmbient >n : number declare function overloadAmbient(s: string): string; ->overloadAmbient : { (n: number): string; (s: string): string; } +>overloadAmbient : typeof overloadAmbient >s : string var f2 = () => { >f2 : () => string ->() => { - return "string"; -} : () => string +>() => { return "string";} : () => string return "string"; } diff --git a/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.errors.txt b/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.errors.txt deleted file mode 100644 index 58936d29dbb..00000000000 --- a/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -==== tests/cases/compiler/functionAndInterfaceWithSeparateErrors.ts (2 errors) ==== - function Foo(s: string); - ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! Overload signature is not compatible with function implementation. - function Foo(n: number) { } - - interface Foo { - [s: string]: string; - prop: number; - ~~~~~~~~~~~~~ -!!! Property 'prop' of type 'number' is not assignable to string index type 'string'. - } \ No newline at end of file diff --git a/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.js b/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.js deleted file mode 100644 index 004e65d92af..00000000000 --- a/tests/baselines/reference/functionAndInterfaceWithSeparateErrors.js +++ /dev/null @@ -1,12 +0,0 @@ -//// [functionAndInterfaceWithSeparateErrors.ts] -function Foo(s: string); -function Foo(n: number) { } - -interface Foo { - [s: string]: string; - prop: number; -} - -//// [functionAndInterfaceWithSeparateErrors.js] -function Foo(n) { -} diff --git a/tests/baselines/reference/functionCall1.types b/tests/baselines/reference/functionCall1.types index 1b06379860c..fbd17de66c7 100644 --- a/tests/baselines/reference/functionCall1.types +++ b/tests/baselines/reference/functionCall1.types @@ -1,9 +1,9 @@ === tests/cases/compiler/functionCall1.ts === function foo():any{return ""}; ->foo : () => any +>foo : typeof foo var x = foo(); >x : any >foo() : any ->foo : () => any +>foo : typeof foo diff --git a/tests/baselines/reference/functionCall2.types b/tests/baselines/reference/functionCall2.types index 92bb0f0be23..a40eefe5bb7 100644 --- a/tests/baselines/reference/functionCall2.types +++ b/tests/baselines/reference/functionCall2.types @@ -1,9 +1,9 @@ === tests/cases/compiler/functionCall2.ts === function foo():number{return 1}; ->foo : () => number +>foo : typeof foo var x = foo(); >x : number >foo() : number ->foo : () => number +>foo : typeof foo diff --git a/tests/baselines/reference/functionCall3.types b/tests/baselines/reference/functionCall3.types index a9b8e46069c..242ac83fed1 100644 --- a/tests/baselines/reference/functionCall3.types +++ b/tests/baselines/reference/functionCall3.types @@ -1,10 +1,10 @@ === tests/cases/compiler/functionCall3.ts === function foo():any[]{return [1];} ->foo : () => any[] +>foo : typeof foo >[1] : any[] var x = foo(); >x : any[] >foo() : any[] ->foo : () => any[] +>foo : typeof foo diff --git a/tests/baselines/reference/functionCall4.types b/tests/baselines/reference/functionCall4.types index 37a0b980a00..0a51873350b 100644 --- a/tests/baselines/reference/functionCall4.types +++ b/tests/baselines/reference/functionCall4.types @@ -1,13 +1,13 @@ === tests/cases/compiler/functionCall4.ts === function foo():any{return ""}; ->foo : () => any +>foo : typeof foo function bar():()=>any{return foo}; ->bar : () => () => any ->foo : () => any +>bar : typeof bar +>foo : typeof foo var x = bar(); >x : () => any >bar() : () => any ->bar : () => () => any +>bar : typeof bar diff --git a/tests/baselines/reference/functionCall5.types b/tests/baselines/reference/functionCall5.types index 2485185bb49..c46f425a18f 100644 --- a/tests/baselines/reference/functionCall5.types +++ b/tests/baselines/reference/functionCall5.types @@ -5,7 +5,7 @@ module m1 { export class c1 { public a; }} >a : any function foo():m1.c1{return new m1.c1();}; ->foo : () => c1 +>foo : typeof foo >m1 : m1 >c1 : c1 >new m1.c1() : c1 @@ -16,5 +16,5 @@ function foo():m1.c1{return new m1.c1();}; var x = foo(); >x : c1 >foo() : c1 ->foo : () => c1 +>foo : typeof foo diff --git a/tests/baselines/reference/functionConstraintSatisfaction.types b/tests/baselines/reference/functionConstraintSatisfaction.types index 70200af6fa9..56ebbe1fb01 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction.types +++ b/tests/baselines/reference/functionConstraintSatisfaction.types @@ -2,7 +2,7 @@ // satisfaction of a constraint to Function, no errors expected function foo(x: T): T { return x; } ->foo : (x: T) => T +>foo : typeof foo >T : T >Function : Function >x : T @@ -39,14 +39,14 @@ var c: { (): string; (x): string }; var r = foo(new Function()); >r : Function >foo(new Function()) : Function ->foo : (x: T) => T +>foo : typeof foo >new Function() : Function >Function : { (...args: string[]): Function; new (...args: string[]): Function; prototype: Function; } var r1 = foo((x) => x); >r1 : (x: any) => any >foo((x) => x) : (x: any) => any ->foo : (x: T) => T +>foo : typeof foo >(x) => x : (x: any) => any >x : any >x : any @@ -54,7 +54,7 @@ var r1 = foo((x) => x); var r2 = foo((x: string[]) => x); >r2 : (x: string[]) => string[] >foo((x: string[]) => x) : (x: string[]) => string[] ->foo : (x: T) => T +>foo : typeof foo >(x: string[]) => x : (x: string[]) => string[] >x : string[] >x : string[] @@ -62,7 +62,7 @@ var r2 = foo((x: string[]) => x); var r3 = foo(function (x) { return x }); >r3 : (x: any) => any >foo(function (x) { return x }) : (x: any) => any ->foo : (x: T) => T +>foo : typeof foo >function (x) { return x } : (x: any) => any >x : any >x : any @@ -70,7 +70,7 @@ var r3 = foo(function (x) { return x }); var r4 = foo(function (x: string[]) { return x }); >r4 : (x: string[]) => string[] >foo(function (x: string[]) { return x }) : (x: string[]) => string[] ->foo : (x: T) => T +>foo : typeof foo >function (x: string[]) { return x } : (x: string[]) => string[] >x : string[] >x : string[] @@ -78,25 +78,25 @@ var r4 = foo(function (x: string[]) { return x }); var r5 = foo(i); >r5 : I >foo(i) : I ->foo : (x: T) => T +>foo : typeof foo >i : I var r6 = foo(C); >r6 : typeof C >foo(C) : typeof C ->foo : (x: T) => T +>foo : typeof foo >C : typeof C var r7 = foo(b); >r7 : new () => string >foo(b) : new () => string ->foo : (x: T) => T +>foo : typeof foo >b : new () => string var r8 = foo(c); >r8 : { (): string; (x: any): string; } >foo(c) : { (): string; (x: any): string; } ->foo : (x: T) => T +>foo : typeof foo >c : { (): string; (x: any): string; } interface I2 { @@ -151,7 +151,7 @@ var c2: { (x: T): T; (x: T, y: T): T }; var r9 = foo((x: U) => x); >r9 : (x: U) => U >foo((x: U) => x) : (x: U) => U ->foo : (x: T) => T +>foo : typeof foo >(x: U) => x : (x: U) => U >U : U >x : U @@ -161,7 +161,7 @@ var r9 = foo((x: U) => x); var r10 = foo(function (x: U) { return x; }); >r10 : (x: U) => U >foo(function (x: U) { return x; }) : (x: U) => U ->foo : (x: T) => T +>foo : typeof foo >function (x: U) { return x; } : (x: U) => U >U : U >x : U @@ -171,7 +171,7 @@ var r10 = foo(function (x: U) { return x; }); var r11 = foo((x: U) => x); >r11 : (x: U) => U >foo((x: U) => x) : (x: U) => U ->foo : (x: T) => T +>foo : typeof foo >(x: U) => x : (x: U) => U >U : U >Date : Date @@ -182,7 +182,7 @@ var r11 = foo((x: U) => x); var r12 = foo((x: U, y: V) => x); >r12 : (x: U, y: V) => U >foo((x: U, y: V) => x) : (x: U, y: V) => U ->foo : (x: T) => T +>foo : typeof foo >(x: U, y: V) => x : (x: U, y: V) => U >U : U >V : V @@ -195,25 +195,25 @@ var r12 = foo((x: U, y: V) => x); var r13 = foo(i2); >r13 : I2 >foo(i2) : I2 ->foo : (x: T) => T +>foo : typeof foo >i2 : I2 var r14 = foo(C2); >r14 : typeof C2 >foo(C2) : typeof C2 ->foo : (x: T) => T +>foo : typeof foo >C2 : typeof C2 var r15 = foo(b2); >r15 : new (x: T) => T >foo(b2) : new (x: T) => T ->foo : (x: T) => T +>foo : typeof foo >b2 : new (x: T) => T var r16 = foo(c2); >r16 : { (x: T): T; (x: T, y: T): T; } >foo(c2) : { (x: T): T; (x: T, y: T): T; } ->foo : (x: T) => T +>foo : typeof foo >c2 : { (x: T): T; (x: T, y: T): T; } interface F2 extends Function { foo: string; } @@ -228,11 +228,11 @@ var f2: F2; var r17 = foo(f2); >r17 : F2 >foo(f2) : F2 ->foo : (x: T) => T +>foo : typeof foo >f2 : F2 function foo2(x: T, y: U) { ->foo2 : void, U extends () => void>(x: T, y: U) => void +>foo2 : typeof foo2 >T : T >U : U >x : T @@ -242,12 +242,12 @@ function foo2(x: T, y: U) { foo(x); >foo(x) : T ->foo : (x: T) => T +>foo : typeof foo >x : T foo(y); >foo(y) : U ->foo : (x: T) => T +>foo : typeof foo >y : U } //function foo2(x: T, y: U) { diff --git a/tests/baselines/reference/functionConstraintSatisfaction3.types b/tests/baselines/reference/functionConstraintSatisfaction3.types index 04963c36519..f260cc568da 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction3.types +++ b/tests/baselines/reference/functionConstraintSatisfaction3.types @@ -2,7 +2,7 @@ // satisfaction of a constraint to Function, no errors expected function foo string>(x: T): T { return x; } ->foo : string>(x: T) => T +>foo : typeof foo >T : T >x : string >x : T @@ -39,7 +39,7 @@ var c: { (): string; (x): string }; var r1 = foo((x) => x); >r1 : (x: any) => any >foo((x) => x) : (x: any) => any ->foo : string>(x: T) => T +>foo : typeof foo >(x) => x : (x: any) => any >x : any >x : any @@ -47,7 +47,7 @@ var r1 = foo((x) => x); var r2 = foo((x: string) => x); >r2 : (x: string) => string >foo((x: string) => x) : (x: string) => string ->foo : string>(x: T) => T +>foo : typeof foo >(x: string) => x : (x: string) => string >x : string >x : string @@ -55,7 +55,7 @@ var r2 = foo((x: string) => x); var r3 = foo(function (x) { return x }); >r3 : (x: any) => any >foo(function (x) { return x }) : (x: any) => any ->foo : string>(x: T) => T +>foo : typeof foo >function (x) { return x } : (x: any) => any >x : any >x : any @@ -63,7 +63,7 @@ var r3 = foo(function (x) { return x }); var r4 = foo(function (x: string) { return x }); >r4 : (x: string) => string >foo(function (x: string) { return x }) : (x: string) => string ->foo : string>(x: T) => T +>foo : typeof foo >function (x: string) { return x } : (x: string) => string >x : string >x : string @@ -71,13 +71,13 @@ var r4 = foo(function (x: string) { return x }); var r5 = foo(i); >r5 : I >foo(i) : I ->foo : string>(x: T) => T +>foo : typeof foo >i : I var r8 = foo(c); >r8 : { (): string; (x: any): string; } >foo(c) : { (): string; (x: any): string; } ->foo : string>(x: T) => T +>foo : typeof foo >c : { (): string; (x: any): string; } interface I2 { @@ -132,7 +132,7 @@ var c2: { (x: T): T; (x: T, y: T): T }; var r9 = foo(function (x: U) { return x; }); >r9 : (x: U) => U >foo(function (x: U) { return x; }) : (x: U) => U ->foo : string>(x: T) => T +>foo : typeof foo >function (x: U) { return x; } : (x: U) => U >U : U >x : U @@ -142,7 +142,7 @@ var r9 = foo(function (x: U) { return x; }); var r10 = foo((x: U) => x); >r10 : (x: U) => U >foo((x: U) => x) : (x: U) => U ->foo : string>(x: T) => T +>foo : typeof foo >(x: U) => x : (x: U) => U >U : U >x : U @@ -152,12 +152,12 @@ var r10 = foo((x: U) => x); var r12 = foo(i2); >r12 : I2 >foo(i2) : I2 ->foo : string>(x: T) => T +>foo : typeof foo >i2 : I2 var r15 = foo(c2); >r15 : { (x: T): T; (x: T, y: T): T; } >foo(c2) : { (x: T): T; (x: T, y: T): T; } ->foo : string>(x: T) => T +>foo : typeof foo >c2 : { (x: T): T; (x: T, y: T): T; } diff --git a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.types b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.types index af751fbb0e9..fefa0168edb 100644 --- a/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.types +++ b/tests/baselines/reference/functionDeclarationWithArgumentOfTypeFunctionTypeArray.types @@ -1,6 +1,6 @@ === tests/cases/compiler/functionDeclarationWithArgumentOfTypeFunctionTypeArray.ts === function foo(args: { (x): number }[]) { ->foo : (args: { (x: any): number; }[]) => number +>foo : typeof foo >args : { (x: any): number; }[] >x : any diff --git a/tests/baselines/reference/functionImplementations.types b/tests/baselines/reference/functionImplementations.types index b9c100e49b0..eeb3cb02a5c 100644 --- a/tests/baselines/reference/functionImplementations.types +++ b/tests/baselines/reference/functionImplementations.types @@ -8,9 +8,7 @@ var v: void = function () { } (); // FunctionExpression f with no return type annotation and directly references f in its body returns any var a: any = function f() { >a : any ->function f() { - return f; -} : () => any +>function f() { return f;} : () => any >f : () => any return f; @@ -19,9 +17,7 @@ var a: any = function f() { }; var a: any = function f() { >a : any ->function f() { - return f(); -} : () => any +>function f() { return f();} : () => any >f : () => any return f(); @@ -33,10 +29,7 @@ var a: any = function f() { // FunctionExpression f with no return type annotation and indirectly references f in its body returns any var a: any = function f() { >a : any ->function f() { - var x = f; - return x; -} : () => any +>function f() { var x = f; return x;} : () => any >f : () => any var x = f; @@ -50,43 +43,43 @@ var a: any = function f() { // Two mutually recursive function implementations with no return type annotations function rec1() { ->rec1 : () => any +>rec1 : typeof rec1 return rec2(); >rec2() : any ->rec2 : () => any +>rec2 : typeof rec2 } function rec2() { ->rec2 : () => any +>rec2 : typeof rec2 return rec1(); >rec1() : any ->rec1 : () => any +>rec1 : typeof rec1 } var a = rec1(); >a : any >rec1() : any ->rec1 : () => any +>rec1 : typeof rec1 var a = rec2(); >a : any >rec2() : any ->rec2 : () => any +>rec2 : typeof rec2 // Two mutually recursive function implementations with return type annotation in one function rec3(): number { ->rec3 : () => number +>rec3 : typeof rec3 return rec4(); >rec4() : number ->rec4 : () => number +>rec4 : typeof rec4 } function rec4() { ->rec4 : () => number +>rec4 : typeof rec4 return rec3(); >rec3() : number ->rec3 : () => number +>rec3 : typeof rec3 } var n: number; >n : number @@ -94,22 +87,18 @@ var n: number; var n = rec3(); >n : number >rec3() : number ->rec3 : () => number +>rec3 : typeof rec3 var n = rec4(); >n : number >rec4() : number ->rec4 : () => number +>rec4 : typeof rec4 // FunctionExpression with no return type annotation and returns a number var n = function () { >n : number ->function () { - return 3; -} () : number ->function () { - return 3; -} : () => number +>function () { return 3;} () : number +>function () { return 3;} : () => number return 3; } (); @@ -120,12 +109,8 @@ var nu = null; var nu = function () { >nu : any ->function () { - return null; -} () : any ->function () { - return null; -} : () => any +>function () { return null;} () : any +>function () { return null;} : () => any return null; } (); @@ -137,12 +122,8 @@ var un = undefined; var un = function () { >un : any ->function () { - return undefined; -} () : any ->function () { - return undefined; -} : () => any +>function () { return undefined;} () : any +>function () { return undefined;} : () => any return undefined; >undefined : undefined @@ -152,12 +133,8 @@ var un = function () { // FunctionExpression with no return type annotation and returns a type parameter type var n = function (x: T) { >n : number ->function (x: T) { - return x; -} (4) : number ->function (x: T) { - return x; -} : (x: T) => T +>function (x: T) { return x;} (4) : number +>function (x: T) { return x;} : (x: T) => T >T : T >x : T >T : T @@ -170,12 +147,8 @@ var n = function (x: T) { // FunctionExpression with no return type annotation and returns a constrained type parameter type var n = function (x: T) { >n : number ->function (x: T) { - return x; -} (4) : number ->function (x: T) { - return x; -} : (x: T) => T +>function (x: T) { return x;} (4) : number +>function (x: T) { return x;} : (x: T) => T >T : T >x : T >T : T @@ -188,14 +161,8 @@ var n = function (x: T) { // FunctionExpression with no return type annotation with multiple return statements with identical types var n = function () { >n : number ->function () { - return 3; - return 5; -}() : number ->function () { - return 3; - return 5; -} : () => number +>function () { return 3; return 5;}() : number +>function () { return 3; return 5;} : () => number return 3; return 5; @@ -217,12 +184,8 @@ var b: Base; var b = function () { >b : Base ->function () { - return new Base(); return new Derived(); -} () : Base ->function () { - return new Base(); return new Derived(); -} : () => Base +>function () { return new Base(); return new Derived();} () : Base +>function () { return new Base(); return new Derived();} : () => Base return new Base(); return new Derived(); >new Base() : Base @@ -235,12 +198,8 @@ var b = function () { // FunctionExpression with no return type annotation with multiple return statements with one a recursive call var a = function f() { >a : any ->function f() { - return new Base(); return new Derived(); return f(); // ? -} () : any ->function f() { - return new Base(); return new Derived(); return f(); // ? -} : () => any +>function f() { return new Base(); return new Derived(); return f(); // ?} () : any +>function f() { return new Base(); return new Derived(); return f(); // ?} : () => any >f : () => any return new Base(); return new Derived(); return f(); // ? @@ -255,13 +214,9 @@ var a = function f() { // FunctionExpression with non -void return type annotation with a single throw statement undefined === function (): number { ->undefined === function (): number { - throw undefined; -} : boolean +>undefined === function (): number { throw undefined;} : boolean >undefined : undefined ->function (): number { - throw undefined; -} : () => number +>function (): number { throw undefined;} : () => number throw undefined; >undefined : undefined @@ -270,7 +225,7 @@ undefined === function (): number { // Type of 'this' in function implementation is 'any' function thisFunc() { ->thisFunc : () => void +>thisFunc : typeof thisFunc var x = this; >x : any @@ -282,7 +237,7 @@ function thisFunc() { // Function signature with optional parameter, no type annotation and initializer has initializer's type function opt1(n = 4) { ->opt1 : (n?: number) => void +>opt1 : typeof opt1 >n : number var m = n; @@ -295,7 +250,7 @@ function opt1(n = 4) { // Function signature with optional parameter, no type annotation and initializer has initializer's widened type function opt2(n = { x: null, y: undefined }) { ->opt2 : (n?: { x: any; y: any; }) => void +>opt2 : typeof opt2 >n : { x: any; y: any; } >{ x: null, y: undefined } : { x: null; y: undefined; } >x : any @@ -314,7 +269,7 @@ function opt2(n = { x: null, y: undefined }) { // Function signature with initializer referencing other parameter to the left function opt3(n: number, m = n) { ->opt3 : (n: number, m?: number) => void +>opt3 : typeof opt3 >n : number >m : number >n : number @@ -332,7 +287,7 @@ function opt3(n: number, m = n) { // FunctionExpression with non -void return type annotation return with no expression function f6(): number { ->f6 : () => number +>f6 : typeof f6 return; } diff --git a/tests/baselines/reference/functionMergedWithModule.types b/tests/baselines/reference/functionMergedWithModule.types index d0c711ab39a..357762b9acd 100644 --- a/tests/baselines/reference/functionMergedWithModule.types +++ b/tests/baselines/reference/functionMergedWithModule.types @@ -12,7 +12,7 @@ module foo.Bar { >Bar : typeof Bar export function f() { ->f : () => void +>f : typeof f } } @@ -21,12 +21,12 @@ module foo.Baz { >Baz : typeof Baz export function g() { ->g : () => void +>g : typeof g Bar.f(); >Bar.f() : void ->Bar.f : () => void +>Bar.f : typeof f >Bar : typeof Bar ->f : () => void +>f : typeof f } } diff --git a/tests/baselines/reference/functionOnlyHasThrow.types b/tests/baselines/reference/functionOnlyHasThrow.types index 0f76f4be39d..33237c3c78a 100644 --- a/tests/baselines/reference/functionOnlyHasThrow.types +++ b/tests/baselines/reference/functionOnlyHasThrow.types @@ -1,6 +1,6 @@ === tests/cases/compiler/functionOnlyHasThrow.ts === function clone():number { ->clone : () => number +>clone : typeof clone throw new Error("To be implemented"); >new Error("To be implemented") : Error diff --git a/tests/baselines/reference/functionOverloads10.types b/tests/baselines/reference/functionOverloads10.types index 8ec2bc7c589..8637862a87e 100644 --- a/tests/baselines/reference/functionOverloads10.types +++ b/tests/baselines/reference/functionOverloads10.types @@ -1,14 +1,14 @@ === tests/cases/compiler/functionOverloads10.ts === function foo(foo:string, bar:number); ->foo : { (foo: string, bar: number): any; (foo: string): any; } +>foo : typeof foo >foo : string >bar : number function foo(foo:string); ->foo : { (foo: string, bar: number): any; (foo: string): any; } +>foo : typeof foo >foo : string function foo(foo:any){ } ->foo : { (foo: string, bar: number): any; (foo: string): any; } +>foo : typeof foo >foo : any diff --git a/tests/baselines/reference/functionOverloads12.types b/tests/baselines/reference/functionOverloads12.types index 6e4c2d9189e..2b46367ecbb 100644 --- a/tests/baselines/reference/functionOverloads12.types +++ b/tests/baselines/reference/functionOverloads12.types @@ -1,10 +1,10 @@ === tests/cases/compiler/functionOverloads12.ts === function foo():string; ->foo : { (): string; (): number; } +>foo : typeof foo function foo():number; ->foo : { (): string; (): number; } +>foo : typeof foo function foo():any { if (true) return ""; else return 0;} ->foo : { (): string; (): number; } +>foo : typeof foo diff --git a/tests/baselines/reference/functionOverloads13.types b/tests/baselines/reference/functionOverloads13.types index ee65bc296e7..438a3008e9b 100644 --- a/tests/baselines/reference/functionOverloads13.types +++ b/tests/baselines/reference/functionOverloads13.types @@ -1,13 +1,13 @@ === tests/cases/compiler/functionOverloads13.ts === function foo(bar:number):string; ->foo : { (bar: number): string; (bar: number): number; } +>foo : typeof foo >bar : number function foo(bar:number):number; ->foo : { (bar: number): string; (bar: number): number; } +>foo : typeof foo >bar : number function foo(bar?:number):any { return "" } ->foo : { (bar: number): string; (bar: number): number; } +>foo : typeof foo >bar : number diff --git a/tests/baselines/reference/functionOverloads14.types b/tests/baselines/reference/functionOverloads14.types index 562c43965c7..60c8a44e996 100644 --- a/tests/baselines/reference/functionOverloads14.types +++ b/tests/baselines/reference/functionOverloads14.types @@ -1,14 +1,14 @@ === tests/cases/compiler/functionOverloads14.ts === function foo():{a:number;} ->foo : { (): { a: number; }; (): { a: string; }; } +>foo : typeof foo >a : number function foo():{a:string;} ->foo : { (): { a: number; }; (): { a: string; }; } +>foo : typeof foo >a : string function foo():{a:any;} { return {a:1} } ->foo : { (): { a: number; }; (): { a: string; }; } +>foo : typeof foo >a : any >{a:1} : { a: number; } >a : number diff --git a/tests/baselines/reference/functionOverloads15.types b/tests/baselines/reference/functionOverloads15.types index 6ca5b6709cb..ab5b25fb369 100644 --- a/tests/baselines/reference/functionOverloads15.types +++ b/tests/baselines/reference/functionOverloads15.types @@ -1,18 +1,18 @@ === tests/cases/compiler/functionOverloads15.ts === function foo(foo:{a:string; b:number;}):string; ->foo : { (foo: { a: string; b: number; }): string; (foo: { a: string; b: number; }): number; } +>foo : typeof foo >foo : { a: string; b: number; } >a : string >b : number function foo(foo:{a:string; b:number;}):number; ->foo : { (foo: { a: string; b: number; }): string; (foo: { a: string; b: number; }): number; } +>foo : typeof foo >foo : { a: string; b: number; } >a : string >b : number function foo(foo:{a:string; b?:number;}):any { return "" } ->foo : { (foo: { a: string; b: number; }): string; (foo: { a: string; b: number; }): number; } +>foo : typeof foo >foo : { a: string; b?: number; } >a : string >b : number diff --git a/tests/baselines/reference/functionOverloads16.types b/tests/baselines/reference/functionOverloads16.types index 6974d0dab98..ae3d08d6479 100644 --- a/tests/baselines/reference/functionOverloads16.types +++ b/tests/baselines/reference/functionOverloads16.types @@ -1,16 +1,16 @@ === tests/cases/compiler/functionOverloads16.ts === function foo(foo:{a:string;}):string; ->foo : { (foo: { a: string; }): string; (foo: { a: string; }): number; } +>foo : typeof foo >foo : { a: string; } >a : string function foo(foo:{a:string;}):number; ->foo : { (foo: { a: string; }): string; (foo: { a: string; }): number; } +>foo : typeof foo >foo : { a: string; } >a : string function foo(foo:{a:string; b?:number;}):any { return "" } ->foo : { (foo: { a: string; }): string; (foo: { a: string; }): number; } +>foo : typeof foo >foo : { a: string; b?: number; } >a : string >b : number diff --git a/tests/baselines/reference/functionOverloads21.types b/tests/baselines/reference/functionOverloads21.types index dc9e28b7b57..e3a8be004d5 100644 --- a/tests/baselines/reference/functionOverloads21.types +++ b/tests/baselines/reference/functionOverloads21.types @@ -1,17 +1,17 @@ === tests/cases/compiler/functionOverloads21.ts === function foo(bar:{a:number;}[]); ->foo : { (bar: { a: number; }[]): any; (bar: { a: number; b: string; }[]): any; } +>foo : typeof foo >bar : { a: number; }[] >a : number function foo(bar:{a:number; b:string;}[]); ->foo : { (bar: { a: number; }[]): any; (bar: { a: number; b: string; }[]): any; } +>foo : typeof foo >bar : { a: number; b: string; }[] >a : number >b : string function foo(bar:{a:any; b?:string;}[]) { return 0 } ->foo : { (bar: { a: number; }[]): any; (bar: { a: number; b: string; }[]): any; } +>foo : typeof foo >bar : { a: any; b?: string; }[] >a : any >b : string diff --git a/tests/baselines/reference/functionOverloads23.types b/tests/baselines/reference/functionOverloads23.types index 40b67a78c55..4bdbc646fcf 100644 --- a/tests/baselines/reference/functionOverloads23.types +++ b/tests/baselines/reference/functionOverloads23.types @@ -1,16 +1,16 @@ === tests/cases/compiler/functionOverloads23.ts === function foo(bar:(b:string)=>void); ->foo : { (bar: (b: string) => void): any; (bar: (a: number) => void): any; } +>foo : typeof foo >bar : (b: string) => void >b : string function foo(bar:(a:number)=>void); ->foo : { (bar: (b: string) => void): any; (bar: (a: number) => void): any; } +>foo : typeof foo >bar : (a: number) => void >a : number function foo(bar:(a?)=>void) { return 0 } ->foo : { (bar: (b: string) => void): any; (bar: (a: number) => void): any; } +>foo : typeof foo >bar : (a?: any) => void >a : any diff --git a/tests/baselines/reference/functionOverloads24.types b/tests/baselines/reference/functionOverloads24.types index f6f090d904f..cea176a6e05 100644 --- a/tests/baselines/reference/functionOverloads24.types +++ b/tests/baselines/reference/functionOverloads24.types @@ -1,16 +1,16 @@ === tests/cases/compiler/functionOverloads24.ts === function foo(bar:number):(b:string)=>void; ->foo : { (bar: number): (b: string) => void; (bar: string): (a: number) => void; } +>foo : typeof foo >bar : number >b : string function foo(bar:string):(a:number)=>void; ->foo : { (bar: number): (b: string) => void; (bar: string): (a: number) => void; } +>foo : typeof foo >bar : string >a : number function foo(bar:any):(a)=>void { return function(){} } ->foo : { (bar: number): (b: string) => void; (bar: string): (a: number) => void; } +>foo : typeof foo >bar : any >a : any >function(){} : () => void diff --git a/tests/baselines/reference/functionOverloads25.types b/tests/baselines/reference/functionOverloads25.types index ace77ebc9e4..e84ac94b798 100644 --- a/tests/baselines/reference/functionOverloads25.types +++ b/tests/baselines/reference/functionOverloads25.types @@ -1,17 +1,17 @@ === tests/cases/compiler/functionOverloads25.ts === function foo():string; ->foo : { (): string; (bar: string): number; } +>foo : typeof foo function foo(bar:string):number; ->foo : { (): string; (bar: string): number; } +>foo : typeof foo >bar : string function foo(bar?:any):any{ return '' }; ->foo : { (): string; (bar: string): number; } +>foo : typeof foo >bar : any var x = foo(); >x : string >foo() : string ->foo : { (): string; (bar: string): number; } +>foo : typeof foo diff --git a/tests/baselines/reference/functionOverloads26.types b/tests/baselines/reference/functionOverloads26.types index 402003d7e7b..40aad4298da 100644 --- a/tests/baselines/reference/functionOverloads26.types +++ b/tests/baselines/reference/functionOverloads26.types @@ -1,17 +1,17 @@ === tests/cases/compiler/functionOverloads26.ts === function foo():string; ->foo : { (): string; (bar: string): number; } +>foo : typeof foo function foo(bar:string):number; ->foo : { (): string; (bar: string): number; } +>foo : typeof foo >bar : string function foo(bar?:any):any{ return '' } ->foo : { (): string; (bar: string): number; } +>foo : typeof foo >bar : any var x = foo('baz'); >x : number >foo('baz') : number ->foo : { (): string; (bar: string): number; } +>foo : typeof foo diff --git a/tests/baselines/reference/functionOverloads28.types b/tests/baselines/reference/functionOverloads28.types index 034d35c64f7..f27ae1b8c0c 100644 --- a/tests/baselines/reference/functionOverloads28.types +++ b/tests/baselines/reference/functionOverloads28.types @@ -1,19 +1,19 @@ === tests/cases/compiler/functionOverloads28.ts === function foo():string; ->foo : { (): string; (bar: string): number; } +>foo : typeof foo function foo(bar:string):number; ->foo : { (): string; (bar: string): number; } +>foo : typeof foo >bar : string function foo(bar?:any):any{ return '' } ->foo : { (): string; (bar: string): number; } +>foo : typeof foo >bar : any var t:any; var x = foo(t); >t : any >x : number >foo(t) : number ->foo : { (): string; (bar: string): number; } +>foo : typeof foo >t : any diff --git a/tests/baselines/reference/functionOverloads30.types b/tests/baselines/reference/functionOverloads30.types index 80d43c952d9..088e6f51127 100644 --- a/tests/baselines/reference/functionOverloads30.types +++ b/tests/baselines/reference/functionOverloads30.types @@ -1,19 +1,19 @@ === tests/cases/compiler/functionOverloads30.ts === function foo(bar:string):string; ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >bar : string function foo(bar:number):number; ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >bar : number function foo(bar:any):any{ return bar } ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >bar : any >bar : any var x = foo('bar'); >x : string >foo('bar') : string ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo diff --git a/tests/baselines/reference/functionOverloads31.types b/tests/baselines/reference/functionOverloads31.types index 4d7816166bc..1005a2dc55c 100644 --- a/tests/baselines/reference/functionOverloads31.types +++ b/tests/baselines/reference/functionOverloads31.types @@ -1,19 +1,19 @@ === tests/cases/compiler/functionOverloads31.ts === function foo(bar:string):string; ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >bar : string function foo(bar:number):number; ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >bar : number function foo(bar:any):any{ return bar } ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >bar : any >bar : any var x = foo(5); >x : number >foo(5) : number ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo diff --git a/tests/baselines/reference/functionOverloads32.types b/tests/baselines/reference/functionOverloads32.types index df997e5d52a..c858f2a54d1 100644 --- a/tests/baselines/reference/functionOverloads32.types +++ b/tests/baselines/reference/functionOverloads32.types @@ -1,14 +1,14 @@ === tests/cases/compiler/functionOverloads32.ts === function foo(bar:string):string; ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >bar : string function foo(bar:number):number; ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >bar : number function foo(bar:any):any{ return bar } ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >bar : any >bar : any @@ -16,6 +16,6 @@ var baz:number; var x = foo(baz); >baz : number >x : number >foo(baz) : number ->foo : { (bar: string): string; (bar: number): number; } +>foo : typeof foo >baz : number diff --git a/tests/baselines/reference/functionOverloads33.types b/tests/baselines/reference/functionOverloads33.types index 0199277180d..fd510ea959e 100644 --- a/tests/baselines/reference/functionOverloads33.types +++ b/tests/baselines/reference/functionOverloads33.types @@ -1,19 +1,19 @@ === tests/cases/compiler/functionOverloads33.ts === function foo(bar:string):string; ->foo : { (bar: string): string; (bar: any): number; } +>foo : typeof foo >bar : string function foo(bar:any):number; ->foo : { (bar: string): string; (bar: any): number; } +>foo : typeof foo >bar : any function foo(bar:any):any{ return bar } ->foo : { (bar: string): string; (bar: any): number; } +>foo : typeof foo >bar : any >bar : any var x = foo(5); >x : number >foo(5) : number ->foo : { (bar: string): string; (bar: any): number; } +>foo : typeof foo diff --git a/tests/baselines/reference/functionOverloads35.types b/tests/baselines/reference/functionOverloads35.types index 567f9512e3d..db42ed0d47b 100644 --- a/tests/baselines/reference/functionOverloads35.types +++ b/tests/baselines/reference/functionOverloads35.types @@ -1,16 +1,16 @@ === tests/cases/compiler/functionOverloads35.ts === function foo(bar:{a:number;}):number; ->foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } +>foo : typeof foo >bar : { a: number; } >a : number function foo(bar:{a:string;}):string; ->foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } +>foo : typeof foo >bar : { a: string; } >a : string function foo(bar:{a:any;}):any{ return bar } ->foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } +>foo : typeof foo >bar : { a: any; } >a : any >bar : { a: any; } @@ -18,7 +18,7 @@ function foo(bar:{a:any;}):any{ return bar } var x = foo({a:1}); >x : number >foo({a:1}) : number ->foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } +>foo : typeof foo >{a:1} : { a: number; } >a : number diff --git a/tests/baselines/reference/functionOverloads36.types b/tests/baselines/reference/functionOverloads36.types index 8118a1c113a..3726bbea87d 100644 --- a/tests/baselines/reference/functionOverloads36.types +++ b/tests/baselines/reference/functionOverloads36.types @@ -1,16 +1,16 @@ === tests/cases/compiler/functionOverloads36.ts === function foo(bar:{a:number;}):number; ->foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } +>foo : typeof foo >bar : { a: number; } >a : number function foo(bar:{a:string;}):string; ->foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } +>foo : typeof foo >bar : { a: string; } >a : string function foo(bar:{a:any;}):any{ return bar } ->foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } +>foo : typeof foo >bar : { a: any; } >a : any >bar : { a: any; } @@ -18,7 +18,7 @@ function foo(bar:{a:any;}):any{ return bar } var x = foo({a:'foo'}); >x : string >foo({a:'foo'}) : string ->foo : { (bar: { a: number; }): number; (bar: { a: string; }): string; } +>foo : typeof foo >{a:'foo'} : { a: string; } >a : string diff --git a/tests/baselines/reference/functionOverloads38.types b/tests/baselines/reference/functionOverloads38.types index 852191ba07f..021ac7490ba 100644 --- a/tests/baselines/reference/functionOverloads38.types +++ b/tests/baselines/reference/functionOverloads38.types @@ -1,16 +1,16 @@ === tests/cases/compiler/functionOverloads38.ts === function foo(bar:{a:number;}[]):string; ->foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } +>foo : typeof foo >bar : { a: number; }[] >a : number function foo(bar:{a:boolean;}[]):number; ->foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } +>foo : typeof foo >bar : { a: boolean; }[] >a : boolean function foo(bar:{a:any;}[]):any{ return bar } ->foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } +>foo : typeof foo >bar : { a: any; }[] >a : any >bar : { a: any; }[] @@ -18,7 +18,7 @@ function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:1}]); >x : string >foo([{a:1}]) : string ->foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } +>foo : typeof foo >[{a:1}] : { a: number; }[] >{a:1} : { a: number; } >a : number diff --git a/tests/baselines/reference/functionOverloads39.types b/tests/baselines/reference/functionOverloads39.types index 70eee2b5163..1cb1ebc43c1 100644 --- a/tests/baselines/reference/functionOverloads39.types +++ b/tests/baselines/reference/functionOverloads39.types @@ -1,16 +1,16 @@ === tests/cases/compiler/functionOverloads39.ts === function foo(bar:{a:number;}[]):string; ->foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } +>foo : typeof foo >bar : { a: number; }[] >a : number function foo(bar:{a:boolean;}[]):number; ->foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } +>foo : typeof foo >bar : { a: boolean; }[] >a : boolean function foo(bar:{a:any;}[]):any{ return bar } ->foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } +>foo : typeof foo >bar : { a: any; }[] >a : any >bar : { a: any; }[] @@ -18,7 +18,7 @@ function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:true}]); >x : number >foo([{a:true}]) : number ->foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; } +>foo : typeof foo >[{a:true}] : { a: boolean; }[] >{a:true} : { a: boolean; } >a : boolean diff --git a/tests/baselines/reference/functionOverloads42.types b/tests/baselines/reference/functionOverloads42.types index dec6a041440..298ffcbc437 100644 --- a/tests/baselines/reference/functionOverloads42.types +++ b/tests/baselines/reference/functionOverloads42.types @@ -1,16 +1,16 @@ === tests/cases/compiler/functionOverloads42.ts === function foo(bar:{a:number;}[]):string; ->foo : { (bar: { a: number; }[]): string; (bar: { a: any; }[]): number; } +>foo : typeof foo >bar : { a: number; }[] >a : number function foo(bar:{a:any;}[]):number; ->foo : { (bar: { a: number; }[]): string; (bar: { a: any; }[]): number; } +>foo : typeof foo >bar : { a: any; }[] >a : any function foo(bar:{a:any;}[]):any{ return bar } ->foo : { (bar: { a: number; }[]): string; (bar: { a: any; }[]): number; } +>foo : typeof foo >bar : { a: any; }[] >a : any >bar : { a: any; }[] @@ -18,7 +18,7 @@ function foo(bar:{a:any;}[]):any{ return bar } var x = foo([{a:'s'}]); >x : number >foo([{a:'s'}]) : number ->foo : { (bar: { a: number; }[]): string; (bar: { a: any; }[]): number; } +>foo : typeof foo >[{a:'s'}] : { a: any; }[] >{a:'s'} : { a: string; } >a : string diff --git a/tests/baselines/reference/functionOverloads6.types b/tests/baselines/reference/functionOverloads6.types index 6e195b1ca90..177ff0eac6b 100644 --- a/tests/baselines/reference/functionOverloads6.types +++ b/tests/baselines/reference/functionOverloads6.types @@ -3,14 +3,14 @@ class foo { >foo : foo static fnOverload(); ->fnOverload : { (): any; (foo: string): any; } +>fnOverload : typeof fnOverload static fnOverload(foo:string); ->fnOverload : { (): any; (foo: string): any; } +>fnOverload : typeof fnOverload >foo : string static fnOverload(foo?: any){ } ->fnOverload : { (): any; (foo: string): any; } +>fnOverload : typeof fnOverload >foo : any } diff --git a/tests/baselines/reference/functionOverloads8.types b/tests/baselines/reference/functionOverloads8.types index e342db5d174..9155a06e82e 100644 --- a/tests/baselines/reference/functionOverloads8.types +++ b/tests/baselines/reference/functionOverloads8.types @@ -1,12 +1,12 @@ === tests/cases/compiler/functionOverloads8.ts === function foo(); ->foo : { (): any; (foo: string): any; } +>foo : typeof foo function foo(foo:string); ->foo : { (): any; (foo: string): any; } +>foo : typeof foo >foo : string function foo(foo?:any){ return '' } ->foo : { (): any; (foo: string): any; } +>foo : typeof foo >foo : any diff --git a/tests/baselines/reference/functionOverloads9.types b/tests/baselines/reference/functionOverloads9.types index a844aee7df1..f27d1ba797c 100644 --- a/tests/baselines/reference/functionOverloads9.types +++ b/tests/baselines/reference/functionOverloads9.types @@ -1,14 +1,14 @@ === tests/cases/compiler/functionOverloads9.ts === function foo(foo:string); ->foo : (foo: string) => any +>foo : typeof foo >foo : string function foo(foo?:string){ return '' }; ->foo : (foo: string) => any +>foo : typeof foo >foo : string var x = foo('foo'); >x : any >foo('foo') : any ->foo : (foo: string) => any +>foo : typeof foo diff --git a/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.types b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.types index 9fe33890b55..7e9e07aff68 100644 --- a/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.types +++ b/tests/baselines/reference/functionOverloadsRecursiveGenericReturnType.types @@ -19,7 +19,7 @@ class A{ } function Choice(args: T[]): A; ->Choice : { (args: T[]): A; (...v_args: T[]): A; } +>Choice : typeof Choice >T : T >args : T[] >T : T @@ -27,7 +27,7 @@ function Choice(args: T[]): A; >T : T function Choice(...v_args: T[]): A; ->Choice : { (args: T[]): A; (...v_args: T[]): A; } +>Choice : typeof Choice >T : T >v_args : T[] >T : T @@ -35,7 +35,7 @@ function Choice(...v_args: T[]): A; >T : T function Choice(...v_args: any[]): A{ ->Choice : { (args: T[]): A; (...v_args: T[]): A; } +>Choice : typeof Choice >T : T >v_args : any[] >A : A diff --git a/tests/baselines/reference/functionReturn.types b/tests/baselines/reference/functionReturn.types index 0c1ee8eafc2..1eb0342040f 100644 --- a/tests/baselines/reference/functionReturn.types +++ b/tests/baselines/reference/functionReturn.types @@ -1,29 +1,29 @@ === tests/cases/compiler/functionReturn.ts === function f0(): void { } ->f0 : () => void +>f0 : typeof f0 function f1() { ->f1 : () => void +>f1 : typeof f1 var n: any = f0(); >n : any >f0() : void ->f0 : () => void +>f0 : typeof f0 } function f2(): any { } ->f2 : () => any +>f2 : typeof f2 function f3(): string { return; } ->f3 : () => string +>f3 : typeof f3 function f4(): string { ->f4 : () => string +>f4 : typeof f4 return ''; return; } function f5(): string { ->f5 : () => string +>f5 : typeof f5 return ''; return undefined; diff --git a/tests/baselines/reference/functionReturningItself.types b/tests/baselines/reference/functionReturningItself.types index 597202a55e2..6505e574c5e 100644 --- a/tests/baselines/reference/functionReturningItself.types +++ b/tests/baselines/reference/functionReturningItself.types @@ -1,7 +1,7 @@ === tests/cases/compiler/functionReturningItself.ts === function somefn() { ->somefn : () => typeof somefn +>somefn : typeof somefn return somefn; ->somefn : () => typeof somefn +>somefn : typeof somefn } diff --git a/tests/baselines/reference/functionType.types b/tests/baselines/reference/functionType.types index 4bbce7e096a..74aafc7c8d0 100644 --- a/tests/baselines/reference/functionType.types +++ b/tests/baselines/reference/functionType.types @@ -1,11 +1,11 @@ === tests/cases/compiler/functionType.ts === function salt() {} ->salt : () => void +>salt : typeof salt salt.apply("hello", []); >salt.apply("hello", []) : any >salt.apply : (thisArg: any, argArray?: any) => any ->salt : () => void +>salt : typeof salt >apply : (thisArg: any, argArray?: any) => any >[] : undefined[] diff --git a/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.types b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.types index a5096d464d8..6b0208b6b64 100644 --- a/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.types +++ b/tests/baselines/reference/functionWithAnyReturnTypeAndNoReturnExpression.types @@ -1,7 +1,7 @@ === tests/cases/compiler/functionWithAnyReturnTypeAndNoReturnExpression.ts === // All should be allowed function f(): any { } ->f : () => any +>f : typeof f var f2: () => any = () => { }; >f2 : () => any diff --git a/tests/baselines/reference/functionWithMultipleReturnStatements2.types b/tests/baselines/reference/functionWithMultipleReturnStatements2.types index 706aca40c94..99aa5457f7b 100644 --- a/tests/baselines/reference/functionWithMultipleReturnStatements2.types +++ b/tests/baselines/reference/functionWithMultipleReturnStatements2.types @@ -3,7 +3,7 @@ // no errors expected here function f1() { ->f1 : () => number +>f1 : typeof f1 if (true) { return 1; @@ -13,7 +13,7 @@ function f1() { } function f2() { ->f2 : () => number +>f2 : typeof f2 if (true) { return 1; @@ -25,7 +25,7 @@ function f2() { } function f4() { ->f4 : () => number +>f4 : typeof f4 try { return 1; @@ -42,7 +42,7 @@ function f4() { } function f5() { ->f5 : () => Object +>f5 : typeof f5 return 1; return new Object(); @@ -51,7 +51,7 @@ function f5() { } function f6(x: T) { ->f6 : (x: T) => T +>f6 : typeof f6 >T : T >x : T >T : T @@ -85,7 +85,7 @@ var b: { x: number; z?: number }; // returns typeof a function f9() { ->f9 : () => { x: number; y?: number; } +>f9 : typeof f9 if (true) { return a; @@ -99,7 +99,7 @@ function f9() { // returns typeof b function f10() { ->f10 : () => { x: number; z?: number; } +>f10 : typeof f10 if (true) { return b; @@ -113,7 +113,7 @@ function f10() { // returns number => void function f11() { ->f11 : () => (x: number) => void +>f11 : typeof f11 if (true) { return (x: number) => { } @@ -130,7 +130,7 @@ function f11() { // returns Object => void function f12() { ->f12 : () => (x: Object) => void +>f12 : typeof f12 if (true) { return (x: Object) => { } diff --git a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt b/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt deleted file mode 100644 index 6ddbc91db57..00000000000 --- a/tests/baselines/reference/functionsMissingReturnStatementsAndExpressions.errors.txt +++ /dev/null @@ -1,129 +0,0 @@ -==== tests/cases/compiler/functionsMissingReturnStatementsAndExpressions.ts (5 errors) ==== - - function f1(): string { - ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - // errors because there are no return statements - } - - function f2(): string { - // Permissible; returns undefined. - return; - } - - function f3(): string { - return "Okay, because this is a return expression."; - } - - function f4(): void { - // Fine since we are typed void. - } - - function f5(): void { - // Fine since we are typed void. - return; - } - - function f6(): void { - // Fine since we are typed void and return undefined - return undefined; - } - - function f7(): void { - // Fine since we are typed void and return null - return null; - } - - function f8(): void { - // Fine since are typed any. - return; - } - - function f9(): void { - // Fine since we are typed any and return undefined - return undefined; - } - - function f10(): void { - // Fine since we are typed any and return null - return null; - } - - function f11(): string { - // Fine since we consist of a single throw statement. - throw undefined; - } - - function f12(): void { - // Fine since we consist of a single throw statement. - throw undefined; - } - - function f13(): any { - // Fine since we consist of a single throw statement. - throw undefined; - } - - function f14(): number { - ~~~~~~ -!!! A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement. - // Not fine, since we can *only* consist of a single throw statement - // if no return statements are present but we are annotated. - throw undefined; - throw null; - } - - function f15(): number { - // Fine, since we have a return statement somewhere. - throw undefined; - throw null; - return; - } - - - function f16() { - // Okay; not type annotated. - } - - function f17() { - // Okay; not type annotated. - return; - } - - function f18() { - return "Okay, not type annotated."; - } - - - class C { - public get m1() { - ~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. - // Errors; get accessors must return a value. - } - - public get m2() { - // Permissible; returns undefined. - return; - } - - public get m3() { - return "Okay, because this is a return expression."; - } - - public get m4() { - // Fine since this consists of a single throw statement. - throw null; - } - - public get m5() { - ~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. - // Not fine, since we can *only* consist of a single throw statement - // if no return statements are present but we are a get accessor. - throw null; - throw undefined. - } - ~ -!!! Identifier expected. - } \ No newline at end of file diff --git a/tests/baselines/reference/funduleUsedAcrossFileBoundary.types b/tests/baselines/reference/funduleUsedAcrossFileBoundary.types index a7924e89fac..a468e471bd2 100644 --- a/tests/baselines/reference/funduleUsedAcrossFileBoundary.types +++ b/tests/baselines/reference/funduleUsedAcrossFileBoundary.types @@ -16,13 +16,13 @@ declare module Q { >foo : string } export function defer(): string; ->defer : () => string +>defer : typeof defer >T : T } === tests/cases/compiler/funduleUsedAcrossFileBoundary_file2.ts === function promiseWithCancellation(promise: Q.Promise) { ->promiseWithCancellation : (promise: Promise) => void +>promiseWithCancellation : typeof promiseWithCancellation >T : T >promise : Promise >Q : Q @@ -32,8 +32,8 @@ function promiseWithCancellation(promise: Q.Promise) { var deferred = Q.defer(); // used to be an error >deferred : string >Q.defer() : string ->Q.defer : () => string +>Q.defer : typeof defer >Q : typeof Q ->defer : () => string +>defer : typeof defer >T : T } diff --git a/tests/baselines/reference/generatedContextualTyping.types b/tests/baselines/reference/generatedContextualTyping.types index 57b5408eabe..13254eb8d22 100644 --- a/tests/baselines/reference/generatedContextualTyping.types +++ b/tests/baselines/reference/generatedContextualTyping.types @@ -1180,7 +1180,7 @@ class x120 { constructor(private parm: Genric = { func: n => { return [d1, >d2 : Derived2 function x121(parm: () => Base[] = () => [d1, d2]) { } ->x121 : (parm?: () => Base[]) => void +>x121 : typeof x121 >parm : () => Base[] >Base : Base >() => [d1, d2] : () => Base[] @@ -1189,7 +1189,7 @@ function x121(parm: () => Base[] = () => [d1, d2]) { } >d2 : Derived2 function x122(parm: () => Base[] = function() { return [d1, d2] }) { } ->x122 : (parm?: () => Base[]) => void +>x122 : typeof x122 >parm : () => Base[] >Base : Base >function() { return [d1, d2] } : () => Base[] @@ -1198,7 +1198,7 @@ function x122(parm: () => Base[] = function() { return [d1, d2] }) { } >d2 : Derived2 function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } ->x123 : (parm?: () => Base[]) => void +>x123 : typeof x123 >parm : () => Base[] >Base : Base >function named() { return [d1, d2] } : () => Base[] @@ -1208,7 +1208,7 @@ function x123(parm: () => Base[] = function named() { return [d1, d2] }) { } >d2 : Derived2 function x124(parm: { (): Base[]; } = () => [d1, d2]) { } ->x124 : (parm?: () => Base[]) => void +>x124 : typeof x124 >parm : () => Base[] >Base : Base >() => [d1, d2] : () => Base[] @@ -1217,7 +1217,7 @@ function x124(parm: { (): Base[]; } = () => [d1, d2]) { } >d2 : Derived2 function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } ->x125 : (parm?: () => Base[]) => void +>x125 : typeof x125 >parm : () => Base[] >Base : Base >function() { return [d1, d2] } : () => Base[] @@ -1226,7 +1226,7 @@ function x125(parm: { (): Base[]; } = function() { return [d1, d2] }) { } >d2 : Derived2 function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } ->x126 : (parm?: () => Base[]) => void +>x126 : typeof x126 >parm : () => Base[] >Base : Base >function named() { return [d1, d2] } : () => Base[] @@ -1236,7 +1236,7 @@ function x126(parm: { (): Base[]; } = function named() { return [d1, d2] }) { } >d2 : Derived2 function x127(parm: Base[] = [d1, d2]) { } ->x127 : (parm?: Base[]) => void +>x127 : typeof x127 >parm : Base[] >Base : Base >[d1, d2] : Base[] @@ -1244,7 +1244,7 @@ function x127(parm: Base[] = [d1, d2]) { } >d2 : Derived2 function x128(parm: Array = [d1, d2]) { } ->x128 : (parm?: Base[]) => void +>x128 : typeof x128 >parm : Base[] >Array : T[] >Base : Base @@ -1253,7 +1253,7 @@ function x128(parm: Array = [d1, d2]) { } >d2 : Derived2 function x129(parm: { [n: number]: Base; } = [d1, d2]) { } ->x129 : (parm?: { [x: number]: Base; }) => void +>x129 : typeof x129 >parm : { [x: number]: Base; } >n : number >Base : Base @@ -1262,7 +1262,7 @@ function x129(parm: { [n: number]: Base; } = [d1, d2]) { } >d2 : Derived2 function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } ->x130 : (parm?: { n: Base[]; }) => void +>x130 : typeof x130 >parm : { n: Base[]; } >n : Base[] >Base : Base @@ -1273,7 +1273,7 @@ function x130(parm: {n: Base[]; } = { n: [d1, d2] }) { } >d2 : Derived2 function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { } ->x131 : (parm?: (s: Base[]) => any) => void +>x131 : typeof x131 >parm : (s: Base[]) => any >s : Base[] >Base : Base @@ -1283,7 +1283,7 @@ function x131(parm: (s: Base[]) => any = n => { var n: Base[]; return null; }) { >Base : Base function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } ->x132 : (parm?: Genric) => void +>x132 : typeof x132 >parm : Genric >Genric : Genric >Base : Base @@ -1296,7 +1296,7 @@ function x132(parm: Genric = { func: n => { return [d1, d2]; } }) { } >d2 : Derived2 function x133(): () => Base[] { return () => [d1, d2]; } ->x133 : () => () => Base[] +>x133 : typeof x133 >Base : Base >() => [d1, d2] : () => Base[] >[d1, d2] : Base[] @@ -1304,7 +1304,7 @@ function x133(): () => Base[] { return () => [d1, d2]; } >d2 : Derived2 function x134(): () => Base[] { return function() { return [d1, d2] }; } ->x134 : () => () => Base[] +>x134 : typeof x134 >Base : Base >function() { return [d1, d2] } : () => Base[] >[d1, d2] : Base[] @@ -1312,7 +1312,7 @@ function x134(): () => Base[] { return function() { return [d1, d2] }; } >d2 : Derived2 function x135(): () => Base[] { return function named() { return [d1, d2] }; } ->x135 : () => () => Base[] +>x135 : typeof x135 >Base : Base >function named() { return [d1, d2] } : () => Base[] >named : () => Base[] @@ -1321,7 +1321,7 @@ function x135(): () => Base[] { return function named() { return [d1, d2] }; } >d2 : Derived2 function x136(): { (): Base[]; } { return () => [d1, d2]; } ->x136 : () => () => Base[] +>x136 : typeof x136 >Base : Base >() => [d1, d2] : () => Base[] >[d1, d2] : Base[] @@ -1329,7 +1329,7 @@ function x136(): { (): Base[]; } { return () => [d1, d2]; } >d2 : Derived2 function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } ->x137 : () => () => Base[] +>x137 : typeof x137 >Base : Base >function() { return [d1, d2] } : () => Base[] >[d1, d2] : Base[] @@ -1337,7 +1337,7 @@ function x137(): { (): Base[]; } { return function() { return [d1, d2] }; } >d2 : Derived2 function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; } ->x138 : () => () => Base[] +>x138 : typeof x138 >Base : Base >function named() { return [d1, d2] } : () => Base[] >named : () => Base[] @@ -1346,14 +1346,14 @@ function x138(): { (): Base[]; } { return function named() { return [d1, d2] }; >d2 : Derived2 function x139(): Base[] { return [d1, d2]; } ->x139 : () => Base[] +>x139 : typeof x139 >Base : Base >[d1, d2] : Base[] >d1 : Derived1 >d2 : Derived2 function x140(): Array { return [d1, d2]; } ->x140 : () => Base[] +>x140 : typeof x140 >Array : T[] >Base : Base >[d1, d2] : Base[] @@ -1361,7 +1361,7 @@ function x140(): Array { return [d1, d2]; } >d2 : Derived2 function x141(): { [n: number]: Base; } { return [d1, d2]; } ->x141 : () => { [x: number]: Base; } +>x141 : typeof x141 >n : number >Base : Base >[d1, d2] : Base[] @@ -1369,7 +1369,7 @@ function x141(): { [n: number]: Base; } { return [d1, d2]; } >d2 : Derived2 function x142(): {n: Base[]; } { return { n: [d1, d2] }; } ->x142 : () => { n: Base[]; } +>x142 : typeof x142 >n : Base[] >Base : Base >{ n: [d1, d2] } : { n: Base[]; } @@ -1379,7 +1379,7 @@ function x142(): {n: Base[]; } { return { n: [d1, d2] }; } >d2 : Derived2 function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; } ->x143 : () => (s: Base[]) => any +>x143 : typeof x143 >s : Base[] >Base : Base >n => { var n: Base[]; return null; } : (n: Base[]) => any @@ -1388,7 +1388,7 @@ function x143(): (s: Base[]) => any { return n => { var n: Base[]; return null; >Base : Base function x144(): Genric { return { func: n => { return [d1, d2]; } }; } ->x144 : () => Genric +>x144 : typeof x144 >Genric : Genric >Base : Base >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } @@ -1400,7 +1400,7 @@ function x144(): Genric { return { func: n => { return [d1, d2]; } }; } >d2 : Derived2 function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } ->x145 : () => () => Base[] +>x145 : typeof x145 >Base : Base >() => [d1, d2] : () => Base[] >[d1, d2] : Base[] @@ -1412,7 +1412,7 @@ function x145(): () => Base[] { return () => [d1, d2]; return () => [d1, d2]; } >d2 : Derived2 function x146(): () => Base[] { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } ->x146 : () => () => Base[] +>x146 : typeof x146 >Base : Base >function() { return [d1, d2] } : () => Base[] >[d1, d2] : Base[] @@ -1424,7 +1424,7 @@ function x146(): () => Base[] { return function() { return [d1, d2] }; return fu >d2 : Derived2 function x147(): () => Base[] { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } ->x147 : () => () => Base[] +>x147 : typeof x147 >Base : Base >function named() { return [d1, d2] } : () => Base[] >named : () => Base[] @@ -1438,7 +1438,7 @@ function x147(): () => Base[] { return function named() { return [d1, d2] }; ret >d2 : Derived2 function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; } ->x148 : () => () => Base[] +>x148 : typeof x148 >Base : Base >() => [d1, d2] : () => Base[] >[d1, d2] : Base[] @@ -1450,7 +1450,7 @@ function x148(): { (): Base[]; } { return () => [d1, d2]; return () => [d1, d2]; >d2 : Derived2 function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return function() { return [d1, d2] }; } ->x149 : () => () => Base[] +>x149 : typeof x149 >Base : Base >function() { return [d1, d2] } : () => Base[] >[d1, d2] : Base[] @@ -1462,7 +1462,7 @@ function x149(): { (): Base[]; } { return function() { return [d1, d2] }; return >d2 : Derived2 function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; return function named() { return [d1, d2] }; } ->x150 : () => () => Base[] +>x150 : typeof x150 >Base : Base >function named() { return [d1, d2] } : () => Base[] >named : () => Base[] @@ -1476,7 +1476,7 @@ function x150(): { (): Base[]; } { return function named() { return [d1, d2] }; >d2 : Derived2 function x151(): Base[] { return [d1, d2]; return [d1, d2]; } ->x151 : () => Base[] +>x151 : typeof x151 >Base : Base >[d1, d2] : Base[] >d1 : Derived1 @@ -1486,7 +1486,7 @@ function x151(): Base[] { return [d1, d2]; return [d1, d2]; } >d2 : Derived2 function x152(): Array { return [d1, d2]; return [d1, d2]; } ->x152 : () => Base[] +>x152 : typeof x152 >Array : T[] >Base : Base >[d1, d2] : Base[] @@ -1497,7 +1497,7 @@ function x152(): Array { return [d1, d2]; return [d1, d2]; } >d2 : Derived2 function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } ->x153 : () => { [x: number]: Base; } +>x153 : typeof x153 >n : number >Base : Base >[d1, d2] : Base[] @@ -1508,7 +1508,7 @@ function x153(): { [n: number]: Base; } { return [d1, d2]; return [d1, d2]; } >d2 : Derived2 function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] }; } ->x154 : () => { n: Base[]; } +>x154 : typeof x154 >n : Base[] >Base : Base >{ n: [d1, d2] } : { n: Base[]; } @@ -1523,7 +1523,7 @@ function x154(): {n: Base[]; } { return { n: [d1, d2] }; return { n: [d1, d2] } >d2 : Derived2 function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; }; return n => { var n: Base[]; return null; }; } ->x155 : () => (s: Base[]) => any +>x155 : typeof x155 >s : Base[] >Base : Base >n => { var n: Base[]; return null; } : (n: Base[]) => any @@ -1536,7 +1536,7 @@ function x155(): (s: Base[]) => any { return n => { var n: Base[]; return null; >Base : Base function x156(): Genric { return { func: n => { return [d1, d2]; } }; return { func: n => { return [d1, d2]; } }; } ->x156 : () => Genric +>x156 : typeof x156 >Genric : Genric >Base : Base >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } @@ -3248,33 +3248,33 @@ var x320: Genric = true ? { func: n => { return [d1, d2]; } } : undefined; >undefined : undefined function x321(n: () => Base[]) { }; x321(() => [d1, d2]); ->x321 : (n: () => Base[]) => void +>x321 : typeof x321 >n : () => Base[] >Base : Base >x321(() => [d1, d2]) : void ->x321 : (n: () => Base[]) => void +>x321 : typeof x321 >() => [d1, d2] : () => Base[] >[d1, d2] : Base[] >d1 : Derived1 >d2 : Derived2 function x322(n: () => Base[]) { }; x322(function() { return [d1, d2] }); ->x322 : (n: () => Base[]) => void +>x322 : typeof x322 >n : () => Base[] >Base : Base >x322(function() { return [d1, d2] }) : void ->x322 : (n: () => Base[]) => void +>x322 : typeof x322 >function() { return [d1, d2] } : () => Base[] >[d1, d2] : Base[] >d1 : Derived1 >d2 : Derived2 function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); ->x323 : (n: () => Base[]) => void +>x323 : typeof x323 >n : () => Base[] >Base : Base >x323(function named() { return [d1, d2] }) : void ->x323 : (n: () => Base[]) => void +>x323 : typeof x323 >function named() { return [d1, d2] } : () => Base[] >named : () => Base[] >[d1, d2] : Base[] @@ -3282,33 +3282,33 @@ function x323(n: () => Base[]) { }; x323(function named() { return [d1, d2] }); >d2 : Derived2 function x324(n: { (): Base[]; }) { }; x324(() => [d1, d2]); ->x324 : (n: () => Base[]) => void +>x324 : typeof x324 >n : () => Base[] >Base : Base >x324(() => [d1, d2]) : void ->x324 : (n: () => Base[]) => void +>x324 : typeof x324 >() => [d1, d2] : () => Base[] >[d1, d2] : Base[] >d1 : Derived1 >d2 : Derived2 function x325(n: { (): Base[]; }) { }; x325(function() { return [d1, d2] }); ->x325 : (n: () => Base[]) => void +>x325 : typeof x325 >n : () => Base[] >Base : Base >x325(function() { return [d1, d2] }) : void ->x325 : (n: () => Base[]) => void +>x325 : typeof x325 >function() { return [d1, d2] } : () => Base[] >[d1, d2] : Base[] >d1 : Derived1 >d2 : Derived2 function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] }); ->x326 : (n: () => Base[]) => void +>x326 : typeof x326 >n : () => Base[] >Base : Base >x326(function named() { return [d1, d2] }) : void ->x326 : (n: () => Base[]) => void +>x326 : typeof x326 >function named() { return [d1, d2] } : () => Base[] >named : () => Base[] >[d1, d2] : Base[] @@ -3316,44 +3316,44 @@ function x326(n: { (): Base[]; }) { }; x326(function named() { return [d1, d2] } >d2 : Derived2 function x327(n: Base[]) { }; x327([d1, d2]); ->x327 : (n: Base[]) => void +>x327 : typeof x327 >n : Base[] >Base : Base >x327([d1, d2]) : void ->x327 : (n: Base[]) => void +>x327 : typeof x327 >[d1, d2] : Base[] >d1 : Derived1 >d2 : Derived2 function x328(n: Array) { }; x328([d1, d2]); ->x328 : (n: Base[]) => void +>x328 : typeof x328 >n : Base[] >Array : T[] >Base : Base >x328([d1, d2]) : void ->x328 : (n: Base[]) => void +>x328 : typeof x328 >[d1, d2] : Base[] >d1 : Derived1 >d2 : Derived2 function x329(n: { [n: number]: Base; }) { }; x329([d1, d2]); ->x329 : (n: { [x: number]: Base; }) => void +>x329 : typeof x329 >n : { [x: number]: Base; } >n : number >Base : Base >x329([d1, d2]) : void ->x329 : (n: { [x: number]: Base; }) => void +>x329 : typeof x329 >[d1, d2] : Base[] >d1 : Derived1 >d2 : Derived2 function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); ->x330 : (n: { n: Base[]; }) => void +>x330 : typeof x330 >n : { n: Base[]; } >n : Base[] >Base : Base >x330({ n: [d1, d2] }) : void ->x330 : (n: { n: Base[]; }) => void +>x330 : typeof x330 >{ n: [d1, d2] } : { n: Base[]; } >n : Base[] >[d1, d2] : Base[] @@ -3361,24 +3361,24 @@ function x330(n: {n: Base[]; } ) { }; x330({ n: [d1, d2] }); >d2 : Derived2 function x331(n: (s: Base[]) => any) { }; x331(n => { var n: Base[]; return null; }); ->x331 : (n: (s: Base[]) => any) => void +>x331 : typeof x331 >n : (s: Base[]) => any >s : Base[] >Base : Base >x331(n => { var n: Base[]; return null; }) : void ->x331 : (n: (s: Base[]) => any) => void +>x331 : typeof x331 >n => { var n: Base[]; return null; } : (n: Base[]) => any >n : Base[] >n : Base[] >Base : Base function x332(n: Genric) { }; x332({ func: n => { return [d1, d2]; } }); ->x332 : (n: Genric) => void +>x332 : typeof x332 >n : Genric >Genric : Genric >Base : Base >x332({ func: n => { return [d1, d2]; } }) : void ->x332 : (n: Genric) => void +>x332 : typeof x332 >{ func: n => { return [d1, d2]; } } : { func: (n: Base[]) => {}[]; } >func : (n: Base[]) => {}[] >n => { return [d1, d2]; } : (n: Base[]) => {}[] diff --git a/tests/baselines/reference/generativeRecursionWithTypeOf.types b/tests/baselines/reference/generativeRecursionWithTypeOf.types index 1447c51358f..a781b308c13 100644 --- a/tests/baselines/reference/generativeRecursionWithTypeOf.types +++ b/tests/baselines/reference/generativeRecursionWithTypeOf.types @@ -4,7 +4,7 @@ class C { >T : T static foo(x: number) { } ->foo : (x: number) => void +>foo : typeof foo >x : number type: T; @@ -16,7 +16,7 @@ module M { >M : typeof M export function f(x: typeof C) { ->f : (x: typeof C) => C +>f : typeof f >x : typeof C >C : typeof C diff --git a/tests/baselines/reference/genericArray0.types b/tests/baselines/reference/genericArray0.types index 80a9d5199bd..9118e312cd2 100644 --- a/tests/baselines/reference/genericArray0.types +++ b/tests/baselines/reference/genericArray0.types @@ -10,7 +10,7 @@ var y = x; >x : number[] function map() { ->map : () => void +>map : typeof map >U : U var ys: U[] = []; diff --git a/tests/baselines/reference/genericArrayPropertyAssignment.types b/tests/baselines/reference/genericArrayPropertyAssignment.types index ab3f47de813..a0eea6f20f1 100644 --- a/tests/baselines/reference/genericArrayPropertyAssignment.types +++ b/tests/baselines/reference/genericArrayPropertyAssignment.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericArrayPropertyAssignment.ts === function isEmpty(list: {length:number;}) ->isEmpty : (list: { length: number; }) => boolean +>isEmpty : typeof isEmpty >list : { length: number; } >length : number { @@ -13,7 +13,7 @@ return list.length ===0; isEmpty([]); // error >isEmpty([]) : boolean ->isEmpty : (list: { length: number; }) => boolean +>isEmpty : typeof isEmpty >[] : undefined[] diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.types b/tests/baselines/reference/genericCallTypeArgumentInference.types index ced2daee38d..f53018bddb1 100644 --- a/tests/baselines/reference/genericCallTypeArgumentInference.types +++ b/tests/baselines/reference/genericCallTypeArgumentInference.types @@ -2,7 +2,7 @@ // Basic type inference with generic calls, no errors expected function foo(t: T) { ->foo : (t: T) => T +>foo : typeof foo >T : T >t : T >T : T @@ -14,10 +14,10 @@ function foo(t: T) { var r = foo(''); // string >r : string >foo('') : string ->foo : (t: T) => T +>foo : typeof foo function foo2(t: T, u: U) { ->foo2 : (t: T, u: U) => U +>foo2 : typeof foo2 >T : T >U : U >t : T @@ -30,7 +30,7 @@ function foo2(t: T, u: U) { } function foo2b(u: U) { ->foo2b : (u: U) => T +>foo2b : typeof foo2b >T : T >U : U >u : U @@ -47,12 +47,12 @@ function foo2b(u: U) { var r2 = foo2('', 1); // number >r2 : number >foo2('', 1) : number ->foo2 : (t: T, u: U) => U +>foo2 : typeof foo2 var r3 = foo2b(1); // {} >r3 : {} >foo2b(1) : {} ->foo2b : (u: U) => T +>foo2b : typeof foo2b class C { >C : C diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types index c79efb0792c..09da2dd2e41 100644 --- a/tests/baselines/reference/genericCallWithArrayLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.types @@ -1,6 +1,6 @@ === tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithArrayLiteralArgs.ts === function foo(t: T) { ->foo : (t: T) => T +>foo : typeof foo >T : T >t : T >T : T @@ -12,49 +12,49 @@ function foo(t: T) { var r = foo([1, 2]); // number[] >r : number[] >foo([1, 2]) : number[] ->foo : (t: T) => T +>foo : typeof foo >[1, 2] : number[] var r = foo([1, 2]); // number[] >r : number[] >foo([1, 2]) : number[] ->foo : (t: T) => T +>foo : typeof foo >[1, 2] : number[] var ra = foo([1, 2]); // any[] >ra : any[] >foo([1, 2]) : any[] ->foo : (t: T) => T +>foo : typeof foo >[1, 2] : any[] var r2 = foo([]); // any[] >r2 : any[] >foo([]) : any[] ->foo : (t: T) => T +>foo : typeof foo >[] : any[] var r3 = foo([]); // number[] >r3 : number[] >foo([]) : number[] ->foo : (t: T) => T +>foo : typeof foo >[] : number[] var r4 = foo([1, '']); // {}[] >r4 : {}[] >foo([1, '']) : {}[] ->foo : (t: T) => T +>foo : typeof foo >[1, ''] : {}[] var r5 = foo([1, '']); // any[] >r5 : any[] >foo([1, '']) : any[] ->foo : (t: T) => T +>foo : typeof foo >[1, ''] : any[] var r6 = foo([1, '']); // Object[] >r6 : Object[] >foo([1, '']) : Object[] ->foo : (t: T) => T +>foo : typeof foo >Object : Object >[1, ''] : Object[] diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.types b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.types index dcff9ef8a16..31e4ad647c5 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.types +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.types @@ -28,7 +28,7 @@ var d2: Derived2; >Derived2 : Derived2 function foo(t: T) { ->foo : (t: T) => T +>foo : typeof foo >T : T >Base : Base >t : T @@ -41,17 +41,17 @@ function foo(t: T) { var r = foo(b); // Base >r : Base >foo(b) : Base ->foo : (t: T) => T +>foo : typeof foo >b : Base var r2 = foo(d1); // Derived >r2 : Derived >foo(d1) : Derived ->foo : (t: T) => T +>foo : typeof foo >d1 : Derived function foo2(t: T, u: U) { ->foo2 : (t: T, u: U) => U +>foo2 : typeof foo2 >T : T >Base : Base >U : U @@ -66,7 +66,7 @@ function foo2(t: T, u: U) { } function foo2b(u: U) { ->foo2b : (u: U) => T +>foo2b : typeof foo2b >T : T >Base : Base >U : U @@ -83,7 +83,7 @@ function foo2b(u: U) { } function foo2c() { ->foo2c : () => T +>foo2c : typeof foo2c >T : T >Base : Base >U : U @@ -100,13 +100,13 @@ function foo2c() { var r3 = foo2b(d1); // Base >r3 : Base >foo2b(d1) : Base ->foo2b : (u: U) => T +>foo2b : typeof foo2b >d1 : Derived var r3b = foo2c(); // Base >r3b : Base >foo2c() : Base ->foo2c : () => T +>foo2c : typeof foo2c class C { >C : C diff --git a/tests/baselines/reference/genericCallWithFixedArguments.types b/tests/baselines/reference/genericCallWithFixedArguments.types index acfad45a0f2..3d40ceb3a06 100644 --- a/tests/baselines/reference/genericCallWithFixedArguments.types +++ b/tests/baselines/reference/genericCallWithFixedArguments.types @@ -8,14 +8,14 @@ class B { bar() { }} >bar : () => void function g(x) { } ->g : (x: any) => void +>g : typeof g >T : T >U : U >x : any g(7) // the parameter list is fixed, so this should not error >g(7) : void ->g : (x: any) => void +>g : typeof g >A : A >B : B diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments.types index 2d3b234d0e1..aec40c508df 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.types @@ -3,7 +3,7 @@ // Using function arguments, no errors expected function foo(x: (a: T) => T) { ->foo : (x: (a: T) => T) => T +>foo : typeof foo >T : T >x : (a: T) => T >a : T @@ -18,7 +18,7 @@ function foo(x: (a: T) => T) { var r = foo((x: U) => ''); // {} >r : {} >foo((x: U) => '') : {} ->foo : (x: (a: T) => T) => T +>foo : typeof foo >(x: U) => '' : (x: U) => string >U : U >x : U @@ -27,7 +27,7 @@ var r = foo((x: U) => ''); // {} var r2 = foo((x: U) => ''); // string >r2 : string >foo((x: U) => '') : string ->foo : (x: (a: T) => T) => T +>foo : typeof foo >(x: U) => '' : (x: U) => string >U : U >x : U @@ -36,12 +36,12 @@ var r2 = foo((x: U) => ''); // string var r3 = foo(x => ''); // {} >r3 : {} >foo(x => '') : {} ->foo : (x: (a: T) => T) => T +>foo : typeof foo >x => '' : (x: {}) => string >x : {} function foo2(x: T, cb: (a: T) => U) { ->foo2 : (x: T, cb: (a: T) => U) => U +>foo2 : typeof foo2 >T : T >U : U >x : T @@ -60,7 +60,7 @@ function foo2(x: T, cb: (a: T) => U) { var r4 = foo2(1, function (a: Z) { return '' }); // string, contextual signature instantiation is applied to generic functions >r4 : string >foo2(1, function (a: Z) { return '' }) : string ->foo2 : (x: T, cb: (a: T) => U) => U +>foo2 : typeof foo2 >function (a: Z) { return '' } : (a: Z) => string >Z : Z >a : Z @@ -69,21 +69,21 @@ var r4 = foo2(1, function (a: Z) { return '' }); // string, contextual signat var r5 = foo2(1, (a) => ''); // string >r5 : string >foo2(1, (a) => '') : string ->foo2 : (x: T, cb: (a: T) => U) => U +>foo2 : typeof foo2 >(a) => '' : (a: number) => string >a : number var r6 = foo2('', (a: Z) => 1); >r6 : number >foo2('', (a: Z) => 1) : number ->foo2 : (x: T, cb: (a: T) => U) => U +>foo2 : typeof foo2 >(a: Z) => 1 : (a: Z) => number >Z : Z >a : Z >Z : Z function foo3(x: T, cb: (a: T) => U, y: U) { ->foo3 : (x: T, cb: (a: T) => U, y: U) => U +>foo3 : typeof foo3 >T : T >U : U >x : T @@ -104,7 +104,7 @@ function foo3(x: T, cb: (a: T) => U, y: U) { var r7 = foo3(1, (a: Z) => '', ''); // string >r7 : string >foo3(1, (a: Z) => '', '') : string ->foo3 : (x: T, cb: (a: T) => U, y: U) => U +>foo3 : typeof foo3 >(a: Z) => '' : (a: Z) => string >Z : Z >a : Z @@ -113,19 +113,19 @@ var r7 = foo3(1, (a: Z) => '', ''); // string var r8 = foo3(1, function (a) { return '' }, 1); // {} >r8 : {} >foo3(1, function (a) { return '' }, 1) : {} ->foo3 : (x: T, cb: (a: T) => U, y: U) => U +>foo3 : typeof foo3 >function (a) { return '' } : (a: number) => string >a : number var r9 = foo3(1, (a) => '', ''); // string >r9 : string >foo3(1, (a) => '', '') : string ->foo3 : (x: T, cb: (a: T) => U, y: U) => U +>foo3 : typeof foo3 >(a) => '' : (a: number) => string >a : number function other(t: T, u: U) { ->other : (t: T, u: U) => void +>other : typeof other >T : T >U : U >t : T @@ -136,7 +136,7 @@ function other(t: T, u: U) { var r10 = foo2(1, (x: T) => ''); // string, non-generic signature allows inferences to be made >r10 : string >foo2(1, (x: T) => '') : string ->foo2 : (x: T, cb: (a: T) => U) => U +>foo2 : typeof foo2 >(x: T) => '' : (x: T) => string >x : T >T : T @@ -144,14 +144,14 @@ function other(t: T, u: U) { var r10 = foo2(1, (x) => ''); // string >r10 : string >foo2(1, (x) => '') : string ->foo2 : (x: T, cb: (a: T) => U) => U +>foo2 : typeof foo2 >(x) => '' : (x: number) => string >x : number var r11 = foo3(1, (x: T) => '', ''); // string >r11 : string >foo3(1, (x: T) => '', '') : string ->foo3 : (x: T, cb: (a: T) => U, y: U) => U +>foo3 : typeof foo3 >(x: T) => '' : (x: T) => string >x : T >T : T @@ -159,7 +159,7 @@ function other(t: T, u: U) { var r11b = foo3(1, (x: T) => '', 1); // {} >r11b : {} >foo3(1, (x: T) => '', 1) : {} ->foo3 : (x: T, cb: (a: T) => U, y: U) => U +>foo3 : typeof foo3 >(x: T) => '' : (x: T) => string >x : T >T : T @@ -167,7 +167,7 @@ function other(t: T, u: U) { var r12 = foo3(1, function (a) { return '' }, 1); // {} >r12 : {} >foo3(1, function (a) { return '' }, 1) : {} ->foo3 : (x: T, cb: (a: T) => U, y: U) => U +>foo3 : typeof foo3 >function (a) { return '' } : (a: number) => string >a : number } diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types index 89d7afd94e2..09f86b64463 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.types @@ -3,7 +3,7 @@ // Using construct signature arguments, no errors expected function foo(x: new(a: T) => T) { ->foo : (x: new (a: T) => T) => T +>foo : typeof foo >T : T >x : new (a: T) => T >a : T @@ -54,29 +54,29 @@ var a: { var r = foo(i); // any >r : any >foo(i) : any ->foo : (x: new (a: T) => T) => T +>foo : typeof foo >i : I var r2 = foo(i); // string >r2 : string >foo(i) : string ->foo : (x: new (a: T) => T) => T +>foo : typeof foo >i : I var r3 = foo(i2); // string >r3 : string >foo(i2) : string ->foo : (x: new (a: T) => T) => T +>foo : typeof foo >i2 : I2 var r3b = foo(a); // any >r3b : any >foo(a) : any ->foo : (x: new (a: T) => T) => T +>foo : typeof foo >a : new (x: T) => T function foo2(x: T, cb: new(a: T) => U) { ->foo2 : (x: T, cb: new (a: T) => U) => U +>foo2 : typeof foo2 >T : T >U : U >x : T @@ -95,29 +95,29 @@ function foo2(x: T, cb: new(a: T) => U) { var r4 = foo2(1, i2); // string, instantiated generic >r4 : string >foo2(1, i2) : string ->foo2 : (x: T, cb: new (a: T) => U) => U +>foo2 : typeof foo2 >i2 : I2 var r4b = foo2(1, a); // any >r4b : any >foo2(1, a) : any ->foo2 : (x: T, cb: new (a: T) => U) => U +>foo2 : typeof foo2 >a : new (x: T) => T var r5 = foo2(1, i); // any >r5 : any >foo2(1, i) : any ->foo2 : (x: T, cb: new (a: T) => U) => U +>foo2 : typeof foo2 >i : I var r6 = foo2('', i2); // string >r6 : string >foo2('', i2) : string ->foo2 : (x: T, cb: new (a: T) => U) => U +>foo2 : typeof foo2 >i2 : I2 function foo3(x: T, cb: new(a: T) => U, y: U) { ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U +>foo3 : typeof foo3 >T : T >U : U >x : T @@ -138,24 +138,24 @@ function foo3(x: T, cb: new(a: T) => U, y: U) { var r7 = foo3(null, i, ''); // any >r7 : any >foo3(null, i, '') : any ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U +>foo3 : typeof foo3 >i : I var r7b = foo3(null, a, ''); // any >r7b : any >foo3(null, a, '') : any ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U +>foo3 : typeof foo3 >a : new (x: T) => T var r8 = foo3(1, i2, 1); // {} >r8 : {} >foo3(1, i2, 1) : {} ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U +>foo3 : typeof foo3 >i2 : I2 var r9 = foo3('', i2, ''); // string >r9 : string >foo3('', i2, '') : string ->foo3 : (x: T, cb: new (a: T) => U, y: U) => U +>foo3 : typeof foo3 >i2 : I2 diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments3.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.types index a6e491d3eb8..988dcaa9c15 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments3.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.types @@ -12,7 +12,7 @@ var a: { } function foo4(cb: (x: T) => U) { ->foo4 : (cb: (x: T) => U) => U +>foo4 : typeof foo4 >T : T >U : U >cb : (x: T) => U @@ -31,7 +31,7 @@ function foo4(cb: (x: T) => U) { var r = foo4(a); // T is {} (candidates boolean and string), U is any (candidates any and boolean) >r : any >foo4(a) : any ->foo4 : (cb: (x: T) => U) => U +>foo4 : typeof foo4 >a : { (x: boolean): boolean; (x: string): any; } var b: { @@ -51,6 +51,6 @@ var b: { var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {}) >r2 : any >foo4(b) : any ->foo4 : (cb: (x: T) => U) => U +>foo4 : typeof foo4 >b : { (x: boolean): T; (x: T): any; } diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments4.types b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.types index bf4e1eb749c..7e2100be048 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments4.types +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.types @@ -22,7 +22,7 @@ var a: { } function foo4(cb: new(x: T) => U) { ->foo4 : (cb: new (x: T) => U) => U +>foo4 : typeof foo4 >T : T >U : U >cb : new (x: T) => U @@ -41,7 +41,7 @@ function foo4(cb: new(x: T) => U) { var r = foo4(a); // T is {} (candidates boolean and string), U is {} (candidates C and D) >r : D >foo4(a) : D ->foo4 : (cb: new (x: T) => U) => U +>foo4 : typeof foo4 >a : { new (x: boolean): C; new (x: string): D; } var b: { @@ -61,6 +61,6 @@ var b: { var r2 = foo4(b); // T is {} (candidates boolean and {}), U is any (candidates any and {}) >r2 : any >foo4(b) : any ->foo4 : (cb: new (x: T) => U) => U +>foo4 : typeof foo4 >b : { new (x: boolean): T; new (x: T): any; } diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.types b/tests/baselines/reference/genericCallWithGenericSignatureArguments.types index 9f634070b56..768bca10bdd 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments.types +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments.types @@ -3,7 +3,7 @@ // the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. function foo(a: (x: T) => T, b: (x: T) => T) { ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >T : T >a : (x: T) => T >x : T @@ -28,7 +28,7 @@ function foo(a: (x: T) => T, b: (x: T) => T) { var r1b = foo((x) => 1, (x) => ''); // {} => {} >r1b : (x: {}) => {} >foo((x) => 1, (x) => '') : (x: {}) => {} ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x) => 1 : (x: {}) => number >x : {} >(x) => '' : (x: {}) => string @@ -37,7 +37,7 @@ var r1b = foo((x) => 1, (x) => ''); // {} => {} var r2 = foo((x: Object) => null, (x: string) => ''); // Object => Object >r2 : (x: any) => any >foo((x: Object) => null, (x: string) => '') : (x: any) => any ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x: Object) => null : (x: Object) => any >x : Object >Object : Object @@ -47,7 +47,7 @@ var r2 = foo((x: Object) => null, (x: string) => ''); // Object => Object var r3 = foo((x: number) => 1, (x: Object) => null); // number => number >r3 : (x: any) => any >foo((x: number) => 1, (x: Object) => null) : (x: any) => any ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x: number) => 1 : (x: number) => number >x : number >(x: Object) => null : (x: Object) => any @@ -57,7 +57,7 @@ var r3 = foo((x: number) => 1, (x: Object) => null); // number => number var r3ii = foo((x: number) => 1, (x: number) => 1); // number => number >r3ii : (x: number) => number >foo((x: number) => 1, (x: number) => 1) : (x: number) => number ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x: number) => 1 : (x: number) => number >x : number >(x: number) => 1 : (x: number) => number @@ -76,7 +76,7 @@ var b: { x: number; z?: number; }; var r4 = foo((x: typeof a) => a, (x: typeof b) => b); // typeof a => typeof a >r4 : (x: { x: number; y?: number; }) => { x: number; y?: number; } >foo((x: typeof a) => a, (x: typeof b) => b) : (x: { x: number; y?: number; }) => { x: number; y?: number; } ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x: typeof a) => a : (x: { x: number; y?: number; }) => { x: number; y?: number; } >x : { x: number; y?: number; } >a : { x: number; y?: number; } @@ -89,7 +89,7 @@ var r4 = foo((x: typeof a) => a, (x: typeof b) => b); // typeof a => typeof a var r5 = foo((x: typeof b) => b, (x: typeof a) => a); // typeof b => typeof b >r5 : (x: { x: number; z?: number; }) => { x: number; z?: number; } >foo((x: typeof b) => b, (x: typeof a) => a) : (x: { x: number; z?: number; }) => { x: number; z?: number; } ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x: typeof b) => b : (x: { x: number; z?: number; }) => { x: number; z?: number; } >x : { x: number; z?: number; } >b : { x: number; z?: number; } @@ -100,7 +100,7 @@ var r5 = foo((x: typeof b) => b, (x: typeof a) => a); // typeof b => typeof b >a : { x: number; y?: number; } function other(x: T) { ->other : (x: T) => void +>other : typeof other >T : T >x : T >T : T @@ -108,7 +108,7 @@ function other(x: T) { var r6 = foo((a: T) => a, (b: T) => b); // T => T >r6 : (x: T) => T >foo((a: T) => a, (b: T) => b) : (x: T) => T ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(a: T) => a : (a: T) => T >a : T >T : T @@ -121,7 +121,7 @@ function other(x: T) { var r6b = foo((a) => a, (b) => b); // {} => {} >r6b : (x: {}) => {} >foo((a) => a, (b) => b) : (x: {}) => {} ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(a) => a : (a: {}) => {} >a : {} >a : {} @@ -131,7 +131,7 @@ function other(x: T) { } function other2(x: T) { ->other2 : (x: T) => void +>other2 : typeof other2 >T : T >Date : Date >x : T @@ -140,7 +140,7 @@ function other2(x: T) { var r7 = foo((a: T) => a, (b: T) => b); // T => T >r7 : (x: T) => T >foo((a: T) => a, (b: T) => b) : (x: T) => T ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(a: T) => a : (a: T) => T >a : T >T : T @@ -153,7 +153,7 @@ function other2(x: T) { var r7b = foo((a) => a, (b) => b); // {} => {} >r7b : (x: {}) => {} >foo((a) => a, (b) => b) : (x: {}) => {} ->foo : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(a) => a : (a: {}) => {} >a : {} >a : {} @@ -172,7 +172,7 @@ function other2(x: T) { function foo2(a: (x: T) => T, b: (x: T) => T) { ->foo2 : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo2 : typeof foo2 >T : T >Date : Date >a : (x: T) => T @@ -195,7 +195,7 @@ function foo2(a: (x: T) => T, b: (x: T) => T) { } function other3(x: T) { ->other3 : (x: T) => void +>other3 : typeof other3 >T : T >RegExp : RegExp >x : T @@ -204,7 +204,7 @@ function other3(x: T) { var r8 = foo2((a: Date) => a, (b: Date) => b); // Date => Date >r8 : (x: Date) => Date >foo2((a: Date) => a, (b: Date) => b) : (x: Date) => Date ->foo2 : (a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo2 : typeof foo2 >(a: Date) => a : (a: Date) => Date >a : Date >Date : Date diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types index 2c0d21a5a07..fc512f8eeb4 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.types @@ -3,7 +3,7 @@ // the corresponding inferred type arguments to become fixed and no further candidate inferences are made for them. function foo(x: T, a: (x: T) => T, b: (x: T) => T) { ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >T : T >x : T >T : T @@ -29,7 +29,7 @@ function foo(x: T, a: (x: T) => T, b: (x: T) => T) { var r1 = foo('', (x: string) => '', (x: Object) => null); // any => any >r1 : (x: any) => any >foo('', (x: string) => '', (x: Object) => null) : (x: any) => any ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x: string) => '' : (x: string) => string >x : string >(x: Object) => null : (x: Object) => any @@ -39,7 +39,7 @@ var r1 = foo('', (x: string) => '', (x: Object) => null); // any => any var r1ii = foo('', (x) => '', (x) => null); // string => string >r1ii : (x: string) => string >foo('', (x) => '', (x) => null) : (x: string) => string ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x) => '' : (x: string) => string >x : string >(x) => null : (x: string) => any @@ -48,7 +48,7 @@ var r1ii = foo('', (x) => '', (x) => null); // string => string var r2 = foo('', (x: string) => '', (x: Object) => ''); // string => string >r2 : (x: Object) => Object >foo('', (x: string) => '', (x: Object) => '') : (x: Object) => Object ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x: string) => '' : (x: string) => string >x : string >(x: Object) => '' : (x: Object) => string @@ -58,7 +58,7 @@ var r2 = foo('', (x: string) => '', (x: Object) => ''); // string => string var r3 = foo(null, (x: Object) => '', (x: string) => ''); // Object => Object >r3 : (x: Object) => Object >foo(null, (x: Object) => '', (x: string) => '') : (x: Object) => Object ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x: Object) => '' : (x: Object) => string >x : Object >Object : Object @@ -68,7 +68,7 @@ var r3 = foo(null, (x: Object) => '', (x: string) => ''); // Object => Object var r4 = foo(null, (x) => '', (x) => ''); // any => any >r4 : (x: any) => any >foo(null, (x) => '', (x) => '') : (x: any) => any ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >(x) => '' : (x: any) => string >x : any >(x) => '' : (x: any) => string @@ -77,7 +77,7 @@ var r4 = foo(null, (x) => '', (x) => ''); // any => any var r5 = foo(new Object(), (x) => '', (x) => ''); // Object => Object >r5 : (x: Object) => Object >foo(new Object(), (x) => '', (x) => '') : (x: Object) => Object ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >new Object() : Object >Object : { (): any; (value: any): any; new (value?: any): Object; prototype: Object; getPrototypeOf(o: any): any; getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: any): any; freeze(o: any): any; preventExtensions(o: any): any; isSealed(o: any): boolean; isFrozen(o: any): boolean; isExtensible(o: any): boolean; keys(o: any): string[]; } >(x) => '' : (x: Object) => string @@ -96,7 +96,7 @@ enum F { A } var r6 = foo(E.A, (x: number) => E.A, (x: F) => F.A); // number => number >r6 : (x: number) => number >foo(E.A, (x: number) => E.A, (x: F) => F.A) : (x: number) => number ->foo : (x: T, a: (x: T) => T, b: (x: T) => T) => (x: T) => T +>foo : typeof foo >E.A : E >E : typeof E >A : E @@ -114,7 +114,7 @@ var r6 = foo(E.A, (x: number) => E.A, (x: F) => F.A); // number => number function foo2(x: T, a: (x: T) => U, b: (x: T) => U) { ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U +>foo2 : typeof foo2 >T : T >U : U >x : T @@ -141,7 +141,7 @@ function foo2(x: T, a: (x: T) => U, b: (x: T) => U) { var r8 = foo2('', (x) => '', (x) => null); // string => string >r8 : (x: string) => any >foo2('', (x) => '', (x) => null) : (x: string) => any ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U +>foo2 : typeof foo2 >(x) => '' : (x: string) => string >x : string >(x) => null : (x: string) => any @@ -150,7 +150,7 @@ var r8 = foo2('', (x) => '', (x) => null); // string => string var r9 = foo2(null, (x) => '', (x) => ''); // any => any >r9 : (x: any) => string >foo2(null, (x) => '', (x) => '') : (x: any) => string ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U +>foo2 : typeof foo2 >(x) => '' : (x: any) => string >x : any >(x) => '' : (x: any) => string @@ -159,7 +159,7 @@ var r9 = foo2(null, (x) => '', (x) => ''); // any => any var r10 = foo2(null, (x: Object) => '', (x: string) => ''); // Object => Object >r10 : (x: Object) => string >foo2(null, (x: Object) => '', (x: string) => '') : (x: Object) => string ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U +>foo2 : typeof foo2 >(x: Object) => '' : (x: Object) => string >x : Object >Object : Object @@ -173,7 +173,7 @@ var x: (a: string) => boolean; var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2); // {} => {} >r11 : (x: {}) => {} >foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: string) => string) => 2) : (x: {}) => {} ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U +>foo2 : typeof foo2 >x : (a: string) => boolean >(a1: (y: string) => string) => (n: Object) => 1 : (a1: (y: string) => string) => (n: Object) => number >a1 : (y: string) => string @@ -188,7 +188,7 @@ var r11 = foo2(x, (a1: (y: string) => string) => (n: Object) => 1, (a2: (z: stri var r12 = foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2); // (string => boolean) => {} >r12 : (x: (a: string) => boolean) => {} >foo2(x, (a1: (y: string) => boolean) => (n: Object) => 1, (a2: (z: string) => boolean) => 2) : (x: (a: string) => boolean) => {} ->foo2 : (x: T, a: (x: T) => U, b: (x: T) => U) => (x: T) => U +>foo2 : typeof foo2 >x : (a: string) => boolean >(a1: (y: string) => boolean) => (n: Object) => 1 : (a1: (y: string) => boolean) => (n: Object) => number >a1 : (y: string) => boolean diff --git a/tests/baselines/reference/genericCallWithNonGenericArgs1.types b/tests/baselines/reference/genericCallWithNonGenericArgs1.types index f08f8503075..8b885d4f677 100644 --- a/tests/baselines/reference/genericCallWithNonGenericArgs1.types +++ b/tests/baselines/reference/genericCallWithNonGenericArgs1.types @@ -1,10 +1,10 @@ === tests/cases/compiler/genericCallWithNonGenericArgs1.ts === function f(x: any) { } ->f : (x: any) => void +>f : typeof f >T : T >x : any f(null) >f(null) : void ->f : (x: any) => void +>f : typeof f diff --git a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.types b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.types index e37a010baed..dd08de2ab05 100644 --- a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.types +++ b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.types @@ -3,7 +3,7 @@ // we choose the first candidate so the result is dependent on the order of the arguments provided function foo(x: T, y: T) { ->foo : (x: T, y: T) => T +>foo : typeof foo >T : T >x : T >T : T @@ -31,14 +31,14 @@ var b: { x: number; z?: number; }; var r = foo(a, b); // { x: number; y?: number; }; >r : { x: number; y?: number; } >foo(a, b) : { x: number; y?: number; } ->foo : (x: T, y: T) => T +>foo : typeof foo >a : { x: number; y?: number; } >b : { x: number; z?: number; } var r2 = foo(b, a); // { x: number; z?: number; }; >r2 : { x: number; z?: number; } >foo(b, a) : { x: number; z?: number; } ->foo : (x: T, y: T) => T +>foo : typeof foo >b : { x: number; z?: number; } >a : { x: number; y?: number; } @@ -53,42 +53,42 @@ var y: { x?: number; }; var r3 = foo(a, x); // { x: number; y?: number; }; >r3 : { x: number; y?: number; } >foo(a, x) : { x: number; y?: number; } ->foo : (x: T, y: T) => T +>foo : typeof foo >a : { x: number; y?: number; } >x : { x: number; } var r4 = foo(x, a); // { x: number; }; >r4 : { x: number; } >foo(x, a) : { x: number; } ->foo : (x: T, y: T) => T +>foo : typeof foo >x : { x: number; } >a : { x: number; y?: number; } var r5 = foo(a, y); // { x?: number; }; >r5 : { x?: number; } >foo(a, y) : { x?: number; } ->foo : (x: T, y: T) => T +>foo : typeof foo >a : { x: number; y?: number; } >y : { x?: number; } var r5 = foo(y, a); // { x?: number; }; >r5 : { x?: number; } >foo(y, a) : { x?: number; } ->foo : (x: T, y: T) => T +>foo : typeof foo >y : { x?: number; } >a : { x: number; y?: number; } var r6 = foo(x, y); // { x?: number; }; >r6 : { x?: number; } >foo(x, y) : { x?: number; } ->foo : (x: T, y: T) => T +>foo : typeof foo >x : { x: number; } >y : { x?: number; } var r6 = foo(y, x); // { x?: number; }; >r6 : { x?: number; } >foo(y, x) : { x?: number; } ->foo : (x: T, y: T) => T +>foo : typeof foo >y : { x?: number; } >x : { x: number; } @@ -104,14 +104,14 @@ var s2: (x: string) => string; var r7 = foo(s1, s2); // (x: Object) => string; >r7 : (x: Object) => string >foo(s1, s2) : (x: Object) => string ->foo : (x: T, y: T) => T +>foo : typeof foo >s1 : (x: Object) => string >s2 : (x: string) => string var r8 = foo(s2, s1); // (x: string) => string; >r8 : (x: string) => string >foo(s2, s1) : (x: string) => string ->foo : (x: T, y: T) => T +>foo : typeof foo >s2 : (x: string) => string >s1 : (x: Object) => string diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.types b/tests/baselines/reference/genericCallWithObjectLiteralArgs.types index 5cf8f12164a..2b825fb06f2 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.types +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.types @@ -1,6 +1,6 @@ === tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectLiteralArgs.ts === function foo(x: { bar: T; baz: T }) { ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } +>foo : typeof foo >T : T >x : { bar: T; baz: T; } >bar : T @@ -15,7 +15,7 @@ function foo(x: { bar: T; baz: T }) { var r = foo({ bar: 1, baz: '' }); // T = {} >r : { bar: {}; baz: {}; } >foo({ bar: 1, baz: '' }) : { bar: {}; baz: {}; } ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } +>foo : typeof foo >{ bar: 1, baz: '' } : { bar: number; baz: string; } >bar : number >baz : string @@ -23,26 +23,26 @@ var r = foo({ bar: 1, baz: '' }); // T = {} 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; } +>foo : typeof foo >{ bar: 1, baz: 1 } : { bar: number; baz: number; } >bar : number >baz : number // BUG 835724 var r3 = foo({ bar: foo, baz: foo }); // T = any ->r3 : { bar: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; baz: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; } ->foo({ bar: foo, baz: foo }) : { bar: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; baz: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; } ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } ->{ bar: foo, baz: foo } : { bar: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; baz: (x: { bar: T; baz: T; }) => { bar: T; baz: T; }; } ->bar : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } +>r3 : { bar: typeof foo; baz: typeof foo; } +>foo({ bar: foo, baz: foo }) : { bar: typeof foo; baz: typeof foo; } +>foo : typeof foo +>{ bar: foo, baz: foo } : { bar: typeof foo; baz: typeof foo; } +>bar : typeof foo >foo : foo ->baz : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } +>baz : typeof foo >foo : foo var r4 = foo({ bar: 1, baz: '' }); // T = Object >r4 : { bar: Object; baz: Object; } >foo({ bar: 1, baz: '' }) : { bar: Object; baz: Object; } ->foo : (x: { bar: T; baz: T; }) => { bar: T; baz: T; } +>foo : typeof foo >Object : Object >{ bar: 1, baz: '' } : { bar: number; baz: string; } >bar : number diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs.types b/tests/baselines/reference/genericCallWithObjectTypeArgs.types index ddbd7d83054..c2bb114c455 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs.types @@ -23,7 +23,7 @@ class X { } function foo(t: X, t2: X) { ->foo : (t: X, t2: X) => T +>foo : typeof foo >T : T >t : X >X : X @@ -55,14 +55,14 @@ var d1 = new X(); var r = foo(c1, d1); // error >r : {} >foo(c1, d1) : {} ->foo : (t: X, t2: X) => T +>foo : typeof foo >c1 : X >d1 : X var r2 = foo(c1, c1); // ok >r2 : C >foo(c1, c1) : C ->foo : (t: X, t2: X) => T +>foo : typeof foo >c1 : X >c1 : X diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.types b/tests/baselines/reference/genericCallWithObjectTypeArgs2.types index 0065811fdc1..35d38e3f065 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.types @@ -22,7 +22,7 @@ class Derived2 extends Base { // returns {}[] function f(a: { x: T; y: U }) { ->f : (a: { x: T; y: U; }) => {}[] +>f : typeof f >T : T >Base : Base >U : U @@ -46,7 +46,7 @@ function f(a: { x: T; y: U }) { var r = f({ x: new Derived(), y: new Derived2() }); // {}[] >r : {}[] >f({ x: new Derived(), y: new Derived2() }) : {}[] ->f : (a: { x: T; y: U; }) => {}[] +>f : typeof f >{ x: new Derived(), y: new Derived2() } : { x: Derived; y: Derived2; } >x : Derived >new Derived() : Derived @@ -58,7 +58,7 @@ var r = f({ x: new Derived(), y: new Derived2() }); // {}[] var r2 = f({ x: new Base(), y: new Derived2() }); // {}[] >r2 : {}[] >f({ x: new Base(), y: new Derived2() }) : {}[] ->f : (a: { x: T; y: U; }) => {}[] +>f : typeof f >{ x: new Base(), y: new Derived2() } : { x: Base; y: Derived2; } >x : Base >new Base() : Base @@ -69,7 +69,7 @@ var r2 = f({ x: new Base(), y: new Derived2() }); // {}[] function f2(a: { x: T; y: U }) { ->f2 : (a: { x: T; y: U; }) => (x: T) => U +>f2 : typeof f2 >T : T >Base : Base >U : U @@ -92,7 +92,7 @@ function f2(a: { x: T; y: U }) { var r3 = f2({ x: new Derived(), y: new Derived2() }); // Derived => Derived2 >r3 : (x: Derived) => Derived2 >f2({ x: new Derived(), y: new Derived2() }) : (x: Derived) => Derived2 ->f2 : (a: { x: T; y: U; }) => (x: T) => U +>f2 : typeof f2 >{ x: new Derived(), y: new Derived2() } : { x: Derived; y: Derived2; } >x : Derived >new Derived() : Derived @@ -124,6 +124,6 @@ var i: I; var r4 = f2(i); // Base => Derived >r4 : (x: Base) => Derived >f2(i) : (x: Base) => Derived ->f2 : (a: { x: T; y: U; }) => (x: T) => U +>f2 : typeof f2 >i : I diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.types index 8e062a8d5bf..852196e93f9 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints.types @@ -29,7 +29,7 @@ class X { } function foo(t: X, t2: X) { ->foo : (t: X, t2: X) => T +>foo : typeof foo >T : T >x : string >t : X @@ -62,19 +62,19 @@ var d1 = new X(); var r = foo(c1, d1); >r : C >foo(c1, d1) : C ->foo : (t: X, t2: X) => T +>foo : typeof foo >c1 : X >d1 : X var r2 = foo(c1, c1); >r2 : C >foo(c1, c1) : C ->foo : (t: X, t2: X) => T +>foo : typeof foo >c1 : X >c1 : X function foo2(t: X, t2: X) { ->foo2 : (t: X, t2: X) => T +>foo2 : typeof foo2 >T : T >C : C >t : X @@ -95,14 +95,14 @@ function foo2(t: X, t2: X) { var r = foo2(c1, d1); >r : C >foo2(c1, d1) : C ->foo2 : (t: X, t2: X) => T +>foo2 : typeof foo2 >c1 : X >d1 : X var r2 = foo2(c1, c1); >r2 : C >foo2(c1, c1) : C ->foo2 : (t: X, t2: X) => T +>foo2 : typeof foo2 >c1 : X >c1 : X diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types index 29706ba7e3d..db9db6422e1 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.types @@ -17,7 +17,7 @@ class Derived extends Base { } function f(x: { foo: T; bar: T }) { ->f : (x: { foo: T; bar: T; }) => T +>f : typeof f >T : T >Base : Base >x : { foo: T; bar: T; } @@ -36,7 +36,7 @@ function f(x: { foo: T; bar: T }) { var r = f({ foo: new Base(), bar: new Derived() }); >r : Base >f({ foo: new Base(), bar: new Derived() }) : Base ->f : (x: { foo: T; bar: T; }) => T +>f : typeof f >{ foo: new Base(), bar: new Derived() } : { foo: Base; bar: Derived; } >foo : Base >new Base() : Base @@ -48,7 +48,7 @@ var r = f({ foo: new Base(), bar: new Derived() }); var r2 = f({ foo: new Derived(), bar: new Derived() }); >r2 : Derived >f({ foo: new Derived(), bar: new Derived() }) : Derived ->f : (x: { foo: T; bar: T; }) => T +>f : typeof f >{ foo: new Derived(), bar: new Derived() } : { foo: Derived; bar: Derived; } >foo : Derived >new Derived() : Derived @@ -67,7 +67,7 @@ interface I { >T : T } function f2(x: I) { ->f2 : (x: I) => T +>f2 : typeof f2 >T : T >Base : Base >x : I @@ -89,12 +89,12 @@ var i: I; var r3 = f2(i); >r3 : Derived >f2(i) : Derived ->f2 : (x: I) => T +>f2 : typeof f2 >i : I function f3(x: T, y: (a: T) => T) { ->f3 : (x: T, y: (a: T) => T) => T +>f3 : typeof f3 >T : T >Base : Base >x : T @@ -111,7 +111,7 @@ function f3(x: T, y: (a: T) => T) { var r4 = f3(new Base(), x => x); >r4 : Base >f3(new Base(), x => x) : Base ->f3 : (x: T, y: (a: T) => T) => T +>f3 : typeof f3 >new Base() : Base >Base : typeof Base >x => x : (x: Base) => Base @@ -121,7 +121,7 @@ var r4 = f3(new Base(), x => x); var r5 = f3(new Derived(), x => x); >r5 : Derived >f3(new Derived(), x => x) : Derived ->f3 : (x: T, y: (a: T) => T) => T +>f3 : typeof f3 >new Derived() : Derived >Derived : typeof Derived >x => x : (x: Derived) => Derived @@ -131,12 +131,12 @@ var r5 = f3(new Derived(), x => x); var r6 = f3(null, null); // any >r6 : any >f3(null, null) : any ->f3 : (x: T, y: (a: T) => T) => T +>f3 : typeof f3 var r7 = f3(null, x => x); // any >r7 : any >f3(null, x => x) : any ->f3 : (x: T, y: (a: T) => T) => T +>f3 : typeof f3 >x => x : (x: any) => any >x : any >x : any diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types index 9a7ca1dbb91..81f4fe5f6d2 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.types @@ -2,7 +2,7 @@ // Type inference infers from indexers in target type, no errors expected function foo(x: T) { ->foo : (x: T) => T +>foo : typeof foo >T : T >x : T >T : T @@ -26,11 +26,11 @@ var a: { var r = foo(a); >r : { [x: string]: Object; [x: number]: Date; } >foo(a) : { [x: string]: Object; [x: number]: Date; } ->foo : (x: T) => T +>foo : typeof foo >a : { [x: string]: Object; [x: number]: Date; } function other(arg: T) { ->other : (arg: T) => void +>other : typeof other >T : T >Date : Date >arg : T @@ -51,7 +51,7 @@ function other(arg: T) { var r2 = foo(b); >r2 : { [x: string]: Object; [x: number]: T; } >foo(b) : { [x: string]: Object; [x: number]: T; } ->foo : (x: T) => T +>foo : typeof foo >b : { [x: string]: Object; [x: number]: T; } var d = r2[1]; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types index f4b3f5960f0..497aa0b443e 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.types @@ -2,7 +2,7 @@ // Type inference infers from indexers in target type, no errors expected function foo(x: T) { ->foo : (x: T) => T +>foo : typeof foo >T : T >x : T >T : T @@ -19,11 +19,11 @@ var a: { [x: number]: Date }; var r = foo(a); >r : { [x: number]: Date; } >foo(a) : { [x: number]: Date; } ->foo : (x: T) => T +>foo : typeof foo >a : { [x: number]: Date; } function other(arg: T) { ->other : (arg: T) => void +>other : typeof other >T : T >arg : T >T : T @@ -36,12 +36,12 @@ function other(arg: T) { var r2 = foo(b); // T >r2 : { [x: number]: T; } >foo(b) : { [x: number]: T; } ->foo : (x: T) => T +>foo : typeof foo >b : { [x: number]: T; } } function other2(arg: T) { ->other2 : (arg: T) => void +>other2 : typeof other2 >T : T >Date : Date >arg : T @@ -55,7 +55,7 @@ function other2(arg: T) { var r2 = foo(b); >r2 : { [x: number]: T; } >foo(b) : { [x: number]: T; } ->foo : (x: T) => T +>foo : typeof foo >b : { [x: number]: T; } var d = r2[1]; @@ -65,7 +65,7 @@ function other2(arg: T) { } function other3(arg: T) { ->other3 : (arg: T) => void +>other3 : typeof other3 >T : T >Date : Date >U : U @@ -81,7 +81,7 @@ function other3(arg: T) { var r2 = foo(b); >r2 : { [x: number]: T; } >foo(b) : { [x: number]: T; } ->foo : (x: T) => T +>foo : typeof foo >b : { [x: number]: T; } var d = r2[1]; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types index e52e6cff113..133a4a6c6a9 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.types @@ -2,7 +2,7 @@ // Type inference infers from indexers in target type, no errors expected function foo(x: T) { ->foo : (x: T) => T +>foo : typeof foo >T : T >x : T >T : T @@ -19,11 +19,11 @@ var a: { [x: string]: Date }; var r = foo(a); >r : { [x: string]: Date; } >foo(a) : { [x: string]: Date; } ->foo : (x: T) => T +>foo : typeof foo >a : { [x: string]: Date; } function other(arg: T) { ->other : (arg: T) => void +>other : typeof other >T : T >arg : T >T : T @@ -36,12 +36,12 @@ function other(arg: T) { var r2 = foo(b); // T >r2 : { [x: string]: T; } >foo(b) : { [x: string]: T; } ->foo : (x: T) => T +>foo : typeof foo >b : { [x: string]: T; } } function other2(arg: T) { ->other2 : (arg: T) => void +>other2 : typeof other2 >T : T >Date : Date >arg : T @@ -55,7 +55,7 @@ function other2(arg: T) { var r2 = foo(b); >r2 : { [x: string]: T; } >foo(b) : { [x: string]: T; } ->foo : (x: T) => T +>foo : typeof foo >b : { [x: string]: T; } var d: Date = r2['hm']; // ok @@ -66,7 +66,7 @@ function other2(arg: T) { } function other3(arg: T) { ->other3 : (arg: T) => void +>other3 : typeof other3 >T : T >Date : Date >U : U @@ -82,7 +82,7 @@ function other3(arg: T) { var r2 = foo(b); >r2 : { [x: string]: T; } >foo(b) : { [x: string]: T; } ->foo : (x: T) => T +>foo : typeof foo >b : { [x: string]: T; } var d: Date = r2['hm']; // ok diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types index 6c16ad0259c..2a9b0c2e861 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.types @@ -16,7 +16,7 @@ module NonGenericParameter { } function foo4(cb: typeof a) { ->foo4 : (cb: { new (x: boolean): boolean; new (x: string): string; }) => boolean +>foo4 : typeof foo4 >cb : { new (x: boolean): boolean; new (x: string): string; } >a : { new (x: boolean): boolean; new (x: string): string; } @@ -28,7 +28,7 @@ module NonGenericParameter { var r = foo4(a); >r : boolean >foo4(a) : boolean ->foo4 : (cb: { new (x: boolean): boolean; new (x: string): string; }) => boolean +>foo4 : typeof foo4 >a : { new (x: boolean): boolean; new (x: string): string; } var b: { new (x: T): T }; @@ -41,7 +41,7 @@ module NonGenericParameter { var r2 = foo4(b); >r2 : boolean >foo4(b) : boolean ->foo4 : (cb: { new (x: boolean): boolean; new (x: string): string; }) => boolean +>foo4 : typeof foo4 >b : new (x: T) => T } @@ -49,7 +49,7 @@ module GenericParameter { >GenericParameter : typeof GenericParameter function foo5(cb: { new(x: T): string; new(x: number): T }) { ->foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } +>foo5 : typeof foo5 >T : T >cb : { new (x: T): string; new (x: number): T; } >x : T @@ -73,7 +73,7 @@ module GenericParameter { var r5 = foo5(a); // new{} => string; new(x:number) => {} >r5 : { new (x: boolean): string; new (x: number): boolean; } >foo5(a) : { new (x: boolean): string; new (x: number): boolean; } ->foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } +>foo5 : typeof foo5 >a : { new (x: boolean): string; new (x: number): boolean; } var b: { new(x: T): string; new(x: number): T; } @@ -88,11 +88,11 @@ module GenericParameter { var r7 = foo5(b); // new any => string; new(x:number) => any >r7 : { new (x: any): string; new (x: number): any; } >foo5(b) : { new (x: any): string; new (x: number): any; } ->foo5 : (cb: { new (x: T): string; new (x: number): T; }) => { new (x: T): string; new (x: number): T; } +>foo5 : typeof foo5 >b : { new (x: T): string; new (x: number): T; } function foo6(cb: { new(x: T): string; new(x: T, y?: T): string }) { ->foo6 : (cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } +>foo6 : typeof foo6 >T : T >cb : { new (x: T): string; new (x: T, y?: T): string; } >x : T @@ -109,17 +109,17 @@ module GenericParameter { var r8 = foo6(a); // new{} => string; new(x:{}, y?:{}) => string >r8 : { new (x: {}): string; new (x: {}, y?: {}): string; } >foo6(a) : { new (x: {}): string; new (x: {}, y?: {}): string; } ->foo6 : (cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } +>foo6 : typeof foo6 >a : { new (x: boolean): string; new (x: number): boolean; } var r9 = foo6(b); // new any => string; new(x:any, y?:any) => string >r9 : { new (x: any): string; new (x: any, y?: any): string; } >foo6(b) : { new (x: any): string; new (x: any, y?: any): string; } ->foo6 : (cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } +>foo6 : typeof foo6 >b : { new (x: T): string; new (x: number): T; } function foo7(x:T, cb: { new(x: T): string; new(x: T, y?: T): string }) { ->foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } +>foo7 : typeof foo7 >T : T >x : T >T : T @@ -138,7 +138,7 @@ module GenericParameter { var r13 = foo7(1, b); // new any => string; new(x:any, y?:any) => string >r13 : { new (x: any): string; new (x: any, y?: any): string; } >foo7(1, b) : { new (x: any): string; new (x: any, y?: any): string; } ->foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } +>foo7 : typeof foo7 >b : { new (x: T): string; new (x: number): T; } var c: { new (x: T): string; (x: number): T; } @@ -162,12 +162,12 @@ module GenericParameter { var r14 = foo7(1, c); // new any => string; new(x:any, y?:any) => string >r14 : { new (x: any): string; new (x: any, y?: any): string; } >foo7(1, c) : { new (x: any): string; new (x: any, y?: any): string; } ->foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } +>foo7 : typeof foo7 >c : { (x: number): T; new (x: T): string; } var r15 = foo7(1, c2); // new any => string; new(x:any, y?:any) => string >r15 : { new (x: any): string; new (x: any, y?: any): string; } >foo7(1, c2) : { new (x: any): string; new (x: any, y?: any): string; } ->foo7 : (x: T, cb: { new (x: T): string; new (x: T, y?: T): string; }) => { new (x: T): string; new (x: T, y?: T): string; } +>foo7 : typeof foo7 >c2 : { new (x: T): string; new (x: number): T; } } diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types index ad491206be6..ecf23d2ead9 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.types @@ -16,7 +16,7 @@ module NonGenericParameter { } function foo4(cb: typeof a) { ->foo4 : (cb: { (x: boolean): boolean; (x: string): string; }) => { (x: boolean): boolean; (x: string): string; } +>foo4 : typeof foo4 >cb : { (x: boolean): boolean; (x: string): string; } >a : { (x: boolean): boolean; (x: string): string; } @@ -27,13 +27,13 @@ module NonGenericParameter { var r = foo4(a); >r : { (x: boolean): boolean; (x: string): string; } >foo4(a) : { (x: boolean): boolean; (x: string): string; } ->foo4 : (cb: { (x: boolean): boolean; (x: string): string; }) => { (x: boolean): boolean; (x: string): string; } +>foo4 : typeof foo4 >a : { (x: boolean): boolean; (x: string): string; } var r2 = foo4((x: T) => x); >r2 : { (x: boolean): boolean; (x: string): string; } >foo4((x: T) => x) : { (x: boolean): boolean; (x: string): string; } ->foo4 : (cb: { (x: boolean): boolean; (x: string): string; }) => { (x: boolean): boolean; (x: string): string; } +>foo4 : typeof foo4 >(x: T) => x : (x: T) => T >T : T >x : T @@ -43,7 +43,7 @@ module NonGenericParameter { var r4 = foo4(x => x); >r4 : { (x: boolean): boolean; (x: string): string; } >foo4(x => x) : { (x: boolean): boolean; (x: string): string; } ->foo4 : (cb: { (x: boolean): boolean; (x: string): string; }) => { (x: boolean): boolean; (x: string): string; } +>foo4 : typeof foo4 >x => x : (x: any) => any >x : any >x : any @@ -53,7 +53,7 @@ module GenericParameter { >GenericParameter : typeof GenericParameter function foo5(cb: { (x: T): string; (x: number): T }) { ->foo5 : (cb: { (x: T): string; (x: number): T; }) => { (x: T): string; (x: number): T; } +>foo5 : typeof foo5 >T : T >cb : { (x: T): string; (x: number): T; } >x : T @@ -68,7 +68,7 @@ module GenericParameter { var r5 = foo5(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any >r5 : { (x: any): string; (x: number): any; } >foo5(x => x) : { (x: any): string; (x: number): any; } ->foo5 : (cb: { (x: T): string; (x: number): T; }) => { (x: T): string; (x: number): T; } +>foo5 : typeof foo5 >x => x : (x: any) => any >x : any >x : any @@ -85,11 +85,11 @@ module GenericParameter { var r7 = foo5(a); // any => string (+1 overload) >r7 : { (x: any): string; (x: number): any; } >foo5(a) : { (x: any): string; (x: number): any; } ->foo5 : (cb: { (x: T): string; (x: number): T; }) => { (x: T): string; (x: number): T; } +>foo5 : typeof foo5 >a : { (x: T): string; (x: number): T; } function foo6(cb: { (x: T): string; (x: T, y?: T): string }) { ->foo6 : (cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>foo6 : typeof foo6 >T : T >cb : { (x: T): string; (x: T, y?: T): string; } >x : T @@ -106,7 +106,7 @@ module GenericParameter { var r8 = foo6(x => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any >r8 : { (x: any): string; (x: any, y?: any): string; } >foo6(x => x) : { (x: any): string; (x: any, y?: any): string; } ->foo6 : (cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>foo6 : typeof foo6 >x => x : (x: any) => any >x : any >x : any @@ -114,7 +114,7 @@ module GenericParameter { var r9 = foo6((x: T) => ''); // any => string (+1 overload) >r9 : { (x: any): string; (x: any, y?: any): string; } >foo6((x: T) => '') : { (x: any): string; (x: any, y?: any): string; } ->foo6 : (cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>foo6 : typeof foo6 >(x: T) => '' : (x: T) => string >T : T >x : T @@ -123,7 +123,7 @@ module GenericParameter { var r11 = foo6((x: T, y?: T) => ''); // any => string (+1 overload) >r11 : { (x: any): string; (x: any, y?: any): string; } >foo6((x: T, y?: T) => '') : { (x: any): string; (x: any, y?: any): string; } ->foo6 : (cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>foo6 : typeof foo6 >(x: T, y?: T) => '' : (x: T, y?: T) => string >T : T >x : T @@ -132,7 +132,7 @@ module GenericParameter { >T : T function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { ->foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>foo7 : typeof foo7 >T : T >x : T >T : T @@ -151,7 +151,7 @@ module GenericParameter { var r12 = foo7(1, (x) => x); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] >r12 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x) => x) : { (x: any): string; (x: any, y?: any): string; } ->foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>foo7 : typeof foo7 >(x) => x : (x: any) => any >x : any >x : any @@ -159,7 +159,7 @@ module GenericParameter { var r13 = foo7(1, (x: T) => ''); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] >r13 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, (x: T) => '') : { (x: any): string; (x: any, y?: any): string; } ->foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>foo7 : typeof foo7 >(x: T) => '' : (x: T) => string >T : T >x : T @@ -177,6 +177,6 @@ module GenericParameter { var r14 = foo7(1, a); // any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] >r14 : { (x: any): string; (x: any, y?: any): string; } >foo7(1, a) : { (x: any): string; (x: any, y?: any): string; } ->foo7 : (x: T, cb: { (x: T): string; (x: T, y?: T): string; }) => { (x: T): string; (x: T, y?: T): string; } +>foo7 : typeof foo7 >a : { (x: T): string; (x: number): T; } } diff --git a/tests/baselines/reference/genericClassStaticMethod.types b/tests/baselines/reference/genericClassStaticMethod.types index 3d4c02317d6..6db91585fcc 100644 --- a/tests/baselines/reference/genericClassStaticMethod.types +++ b/tests/baselines/reference/genericClassStaticMethod.types @@ -4,7 +4,7 @@ class Foo { >T : T static getFoo() { ->getFoo : () => void +>getFoo : typeof getFoo } } @@ -15,7 +15,7 @@ class Bar extends Foo { >T : T static getFoo() { ->getFoo : () => void +>getFoo : typeof getFoo } } diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types index 68b94d81d02..87037736eff 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.types @@ -238,7 +238,7 @@ module WithCandidates { >C3 : C3 function other(t: T, u: U) { ->other : (t: T, u: U) => void +>other : typeof other >T : T >U : U >t : T diff --git a/tests/baselines/reference/genericCloduleInModule.types b/tests/baselines/reference/genericCloduleInModule.types index b4646fde0a7..abc9b400d54 100644 --- a/tests/baselines/reference/genericCloduleInModule.types +++ b/tests/baselines/reference/genericCloduleInModule.types @@ -10,7 +10,7 @@ module A { >foo : () => void static bar() { } ->bar : () => void +>bar : typeof bar } export module B { >B : typeof B diff --git a/tests/baselines/reference/genericConstraintDeclaration.types b/tests/baselines/reference/genericConstraintDeclaration.types index 126da138d4e..336d13c52fe 100644 --- a/tests/baselines/reference/genericConstraintDeclaration.types +++ b/tests/baselines/reference/genericConstraintDeclaration.types @@ -4,7 +4,7 @@ class List{ >T : T static empty(): List{return null;} ->empty : () => List +>empty : typeof empty >T : T >List : List >T : T diff --git a/tests/baselines/reference/genericFunctionHasFreshTypeArgs.types b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.types index 3a3afebb9ac..23965f161a9 100644 --- a/tests/baselines/reference/genericFunctionHasFreshTypeArgs.types +++ b/tests/baselines/reference/genericFunctionHasFreshTypeArgs.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericFunctionHasFreshTypeArgs.ts === function f(p: (x: T) => void) { }; ->f : (p: (x: T) => void) => void +>f : typeof f >p : (x: T) => void >T : T >x : T @@ -8,11 +8,11 @@ function f(p: (x: T) => void) { }; f(x => f(y => x = y)); >f(x => f(y => x = y)) : void ->f : (p: (x: T) => void) => void +>f : typeof f >x => f(y => x = y) : (x: any) => void >x : any >f(y => x = y) : void ->f : (p: (x: T) => void) => void +>f : typeof f >y => x = y : (y: any) => any >y : any >x = y : any diff --git a/tests/baselines/reference/genericFunctionSpecializations1.types b/tests/baselines/reference/genericFunctionSpecializations1.types index 60819c786b8..06e2f009bd0 100644 --- a/tests/baselines/reference/genericFunctionSpecializations1.types +++ b/tests/baselines/reference/genericFunctionSpecializations1.types @@ -1,22 +1,22 @@ === tests/cases/compiler/genericFunctionSpecializations1.ts === function foo3(test: string); // error ->foo3 : (test: string) => any +>foo3 : typeof foo3 >T : T >test : string function foo3(test: T) { } ->foo3 : (test: string) => any +>foo3 : typeof foo3 >T : T >test : T >T : T function foo4(test: string); // valid ->foo4 : (test: string) => any +>foo4 : typeof foo4 >T : T >test : string function foo4(test: T) { } ->foo4 : (test: string) => any +>foo4 : typeof foo4 >T : T >String : String >test : T diff --git a/tests/baselines/reference/genericFunctions0.types b/tests/baselines/reference/genericFunctions0.types index 045224a7aaa..ee435ee0845 100644 --- a/tests/baselines/reference/genericFunctions0.types +++ b/tests/baselines/reference/genericFunctions0.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericFunctions0.ts === function foo (x: T) { return x; } ->foo : (x: T) => T +>foo : typeof foo >T : T >x : T >T : T @@ -9,5 +9,5 @@ function foo (x: T) { return x; } var x = foo(5); // 'x' should be number >x : number >foo(5) : number ->foo : (x: T) => T +>foo : typeof foo diff --git a/tests/baselines/reference/genericFunctions1.types b/tests/baselines/reference/genericFunctions1.types index aed264c78e1..96862e9e0cb 100644 --- a/tests/baselines/reference/genericFunctions1.types +++ b/tests/baselines/reference/genericFunctions1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericFunctions1.ts === function foo (x: T) { return x; } ->foo : (x: T) => T +>foo : typeof foo >T : T >x : T >T : T @@ -9,5 +9,5 @@ function foo (x: T) { return x; } var x = foo(5); // 'x' should be number >x : number >foo(5) : number ->foo : (x: T) => T +>foo : typeof foo diff --git a/tests/baselines/reference/genericFunctions2.types b/tests/baselines/reference/genericFunctions2.types index 96e757d3d9e..2ad353559a5 100644 --- a/tests/baselines/reference/genericFunctions2.types +++ b/tests/baselines/reference/genericFunctions2.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericFunctions2.ts === declare function map (items: T[], f: (x: T) => U): U[]; ->map : (items: T[], f: (x: T) => U) => U[] +>map : typeof map >T : T >U : U >items : T[] @@ -17,7 +17,7 @@ var myItems: string[]; var lengths = map(myItems, x => x.length); >lengths : number[] >map(myItems, x => x.length) : number[] ->map : (items: T[], f: (x: T) => U) => U[] +>map : typeof map >myItems : string[] >x => x.length : (x: string) => number >x : string diff --git a/tests/baselines/reference/genericFunctions3.types b/tests/baselines/reference/genericFunctions3.types index 2215e30adcf..663f6270f2a 100644 --- a/tests/baselines/reference/genericFunctions3.types +++ b/tests/baselines/reference/genericFunctions3.types @@ -11,14 +11,14 @@ interface Query { } function from(arg: boolean): Query; // was Error: Overload signature is not compatible with function definition. ->from : (arg: boolean) => Query +>from : typeof from >T : T >arg : boolean >Query : Query >T : T function from(arg: any): Query { ->from : (arg: boolean) => Query +>from : typeof from >T : T >arg : any >Query : Query diff --git a/tests/baselines/reference/genericInference2.types b/tests/baselines/reference/genericInference2.types index 0bd8c533759..d8e22021906 100644 --- a/tests/baselines/reference/genericInference2.types +++ b/tests/baselines/reference/genericInference2.types @@ -24,7 +24,7 @@ >T : T } export function observable(value: T): Observable; ->observable : (value: T) => Observable +>observable : typeof observable >T : T >value : T >T : T @@ -33,24 +33,21 @@ } var o = { >o : { name: Observable; age: Observable; } ->{ - name: ko.observable("Bob"), - age: ko.observable(37) - } : { name: Observable; age: Observable; } +>{ name: ko.observable("Bob"), age: ko.observable(37) } : { name: Observable; age: Observable; } name: ko.observable("Bob"), >name : Observable >ko.observable("Bob") : Observable ->ko.observable : (value: T) => Observable +>ko.observable : typeof observable >ko : typeof ko ->observable : (value: T) => Observable +>observable : typeof observable age: ko.observable(37) >age : Observable >ko.observable(37) : Observable ->ko.observable : (value: T) => Observable +>ko.observable : typeof observable >ko : typeof ko ->observable : (value: T) => Observable +>observable : typeof observable }; var x_v = o.name().length; // should be 'number' diff --git a/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.types b/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.types index 449c5712c6c..aa67bfdf7bb 100644 --- a/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.types +++ b/tests/baselines/reference/genericInstantiationEquivalentToObjectLiteral.types @@ -28,7 +28,7 @@ y = x; >x : Pair declare function f(x: Pair); ->f : (x: Pair) => any +>f : typeof f >T : T >U : U >x : Pair @@ -37,7 +37,7 @@ declare function f(x: Pair); >U : U declare function f2(x: { first: T; second: U; }); ->f2 : (x: { first: T; second: U; }) => any +>f2 : typeof f2 >T : T >U : U >x : { first: T; second: U; } @@ -48,21 +48,21 @@ declare function f2(x: { first: T; second: U; }); f(x); >f(x) : any ->f : (x: Pair) => any +>f : typeof f >x : Pair f(y); >f(y) : any ->f : (x: Pair) => any +>f : typeof f >y : { first: string; second: number; } f2(x); >f2(x) : any ->f2 : (x: { first: T; second: U; }) => any +>f2 : typeof f2 >x : Pair f2(y); >f2(y) : any ->f2 : (x: { first: T; second: U; }) => any +>f2 : typeof f2 >y : { first: string; second: number; } diff --git a/tests/baselines/reference/genericInterfaceFunctionTypeParameter.types b/tests/baselines/reference/genericInterfaceFunctionTypeParameter.types index f262fda55f6..f8d1ff0341d 100644 --- a/tests/baselines/reference/genericInterfaceFunctionTypeParameter.types +++ b/tests/baselines/reference/genericInterfaceFunctionTypeParameter.types @@ -4,7 +4,7 @@ export interface IFoo { } >A : A export function foo(fn: (ifoo: IFoo) => void) { ->foo : (fn: (ifoo: IFoo) => void) => void +>foo : typeof foo >A : A >fn : (ifoo: IFoo) => void >ifoo : IFoo @@ -13,7 +13,7 @@ export function foo(fn: (ifoo: IFoo) => void) { foo(fn); // Invocation is necessary to repro (!) >foo(fn) : void ->foo : (fn: (ifoo: IFoo) => void) => void +>foo : typeof foo >fn : (ifoo: IFoo) => void } diff --git a/tests/baselines/reference/genericMethodOverspecialization.types b/tests/baselines/reference/genericMethodOverspecialization.types index c3f8a86d7eb..145a7b33381 100644 --- a/tests/baselines/reference/genericMethodOverspecialization.types +++ b/tests/baselines/reference/genericMethodOverspecialization.types @@ -28,15 +28,11 @@ interface Document { var elements = names.map(function (name) { >elements : HTMLElement[] ->names.map(function (name) { - return document.getElementById(name); -}) : HTMLElement[] +>names.map(function (name) { return document.getElementById(name);}) : HTMLElement[] >names.map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] >names : string[] >map : (callbackfn: (value: string, index: number, array: string[]) => U, thisArg?: any) => U[] ->function (name) { - return document.getElementById(name); -} : (name: string) => HTMLElement +>function (name) { return document.getElementById(name);} : (name: string) => HTMLElement >name : string return document.getElementById(name); @@ -51,15 +47,11 @@ var elements = names.map(function (name) { var xxx = elements.filter(function (e) { >xxx : HTMLElement[] ->elements.filter(function (e) { - return !e.isDisabled; -}) : HTMLElement[] +>elements.filter(function (e) { return !e.isDisabled;}) : HTMLElement[] >elements.filter : (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => boolean, thisArg?: any) => HTMLElement[] >elements : HTMLElement[] >filter : (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => boolean, thisArg?: any) => HTMLElement[] ->function (e) { - return !e.isDisabled; -} : (e: HTMLElement) => boolean +>function (e) { return !e.isDisabled;} : (e: HTMLElement) => boolean >e : HTMLElement return !e.isDisabled; @@ -72,15 +64,11 @@ var xxx = elements.filter(function (e) { var widths:number[] = elements.map(function (e) { // should not error >widths : number[] ->elements.map(function (e) { // should not error - return e.clientWidth; -}) : number[] +>elements.map(function (e) { // should not error return e.clientWidth;}) : number[] >elements.map : (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any) => U[] >elements : HTMLElement[] >map : (callbackfn: (value: HTMLElement, index: number, array: HTMLElement[]) => U, thisArg?: any) => U[] ->function (e) { // should not error - return e.clientWidth; -} : (e: HTMLElement) => number +>function (e) { // should not error return e.clientWidth;} : (e: HTMLElement) => number >e : HTMLElement return e.clientWidth; diff --git a/tests/baselines/reference/genericOverloadSignatures.types b/tests/baselines/reference/genericOverloadSignatures.types index e1efe0785ab..1181d61ccb7 100644 --- a/tests/baselines/reference/genericOverloadSignatures.types +++ b/tests/baselines/reference/genericOverloadSignatures.types @@ -14,19 +14,19 @@ interface A { } function f(a: T); ->f : { (a: T): any; (a: T): any; } +>f : typeof f >T : T >a : T >T : T function f(a: T); ->f : { (a: T): any; (a: T): any; } +>f : typeof f >T : T >a : T >T : T function f(a) { } ->f : { (a: T): any; (a: T): any; } +>f : typeof f >a : any interface I2 { diff --git a/tests/baselines/reference/genericParameterAssignability1.types b/tests/baselines/reference/genericParameterAssignability1.types index b7888014dea..ac7f1c97436 100644 --- a/tests/baselines/reference/genericParameterAssignability1.types +++ b/tests/baselines/reference/genericParameterAssignability1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericParameterAssignability1.ts === function f(x: T): T { return null; } ->f : (x: T) => T +>f : typeof f >T : T >x : T >T : T @@ -15,7 +15,7 @@ var r = (x: T) => x; >x : T r = f; // should be allowed ->r = f : (x: T) => T +>r = f : typeof f >r : (x: T) => T ->f : (x: T) => T +>f : typeof f diff --git a/tests/baselines/reference/genericStaticAnyTypeFunction.types b/tests/baselines/reference/genericStaticAnyTypeFunction.types index 9cf511ca0d9..6e5b89a1e93 100644 --- a/tests/baselines/reference/genericStaticAnyTypeFunction.types +++ b/tests/baselines/reference/genericStaticAnyTypeFunction.types @@ -3,7 +3,7 @@ class A { >A : A static one(source: T, value: number): T { ->one : (source: T, value: number) => T +>one : typeof one >T : T >source : T >T : T @@ -15,10 +15,10 @@ class A { } static goo() { return 0; } ->goo : () => number +>goo : typeof goo static two(source: T): T { ->two : (source: T) => T +>two : typeof two >T : T >source : T >T : T @@ -26,9 +26,9 @@ class A { return this.one(source, 42); // should not error >this.one(source, 42) : T ->this.one : (source: T, value: number) => T +>this.one : typeof one >this : typeof A ->one : (source: T, value: number) => T +>one : typeof one >T : T >source : T diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.types b/tests/baselines/reference/genericTypeParameterEquivalence2.types index 9c9c4e071bc..2c7af15b753 100644 --- a/tests/baselines/reference/genericTypeParameterEquivalence2.types +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/genericTypeParameterEquivalence2.ts === // compose :: (b->c) -> (a->b) -> (a->c) function compose(f: (b: B) => C, g: (a:A) => B): (a:A) => C { ->compose : (f: (b: B) => C, g: (a: A) => B) => (a: A) => C +>compose : typeof compose >A : A >B : B >C : C @@ -18,9 +18,7 @@ function compose(f: (b: B) => C, g: (a:A) => B): (a:A) => C { >C : C return function (a:A) : C { ->function (a:A) : C { - return f(g.apply(null, a)); - } : (a: A) => C +>function (a:A) : C { return f(g.apply(null, a)); } : (a: A) => C >a : A >A : A >C : C @@ -39,7 +37,7 @@ function compose(f: (b: B) => C, g: (a:A) => B): (a:A) => C { // forEach :: [a] -> (a -> ()) -> () function forEach(list: A[], f: (a: A, n?: number) => void ): void { ->forEach : (list: A[], f: (a: A, n?: number) => void) => void +>forEach : typeof forEach >A : A >list : A[] >A : A @@ -70,7 +68,7 @@ function forEach(list: A[], f: (a: A, n?: number) => void ): void { // filter :: (a->bool) -> [a] -> [a] function filter(f: (a: A) => boolean, ar: A[]): A[] { ->filter : (f: (a: A) => boolean, ar: A[]) => A[] +>filter : typeof filter >A : A >f : (a: A) => boolean >a : A @@ -84,18 +82,10 @@ function filter(f: (a: A) => boolean, ar: A[]): A[] { >[] : undefined[] forEach(ar, (el) => { ->forEach(ar, (el) => { - if (f(el)) { - ret.push(el); - } - } ) : void ->forEach : (list: A[], f: (a: A, n?: number) => void) => void +>forEach(ar, (el) => { if (f(el)) { ret.push(el); } } ) : void +>forEach : typeof forEach >ar : A[] ->(el) => { - if (f(el)) { - ret.push(el); - } - } : (el: A) => void +>(el) => { if (f(el)) { ret.push(el); } } : (el: A) => void >el : A if (f(el)) { @@ -118,7 +108,7 @@ function filter(f: (a: A) => boolean, ar: A[]): A[] { // length :: [a] -> Num function length2(ar: A[]): number { ->length2 : (ar: A[]) => number +>length2 : typeof length2 >A : A >ar : A[] >A : A @@ -131,7 +121,7 @@ function length2(ar: A[]): number { // curry1 :: ((a,b)->c) -> (a->(b->c)) function curry1(f: (a: A, b: B) => C): (ax: A) => (bx: B) => C { ->curry1 : (f: (a: A, b: B) => C) => (ax: A) => (bx: B) => C +>curry1 : typeof curry1 >A : A >B : B >C : C @@ -148,18 +138,12 @@ function curry1(f: (a: A, b: B) => C): (ax: A) => (bx: B) => C { >C : C return function (ay: A) { ->function (ay: A) { - return function (by: B) { - return f(ay, by); - }; - } : (ay: A) => (by: B) => C +>function (ay: A) { return function (by: B) { return f(ay, by); }; } : (ay: A) => (by: B) => C >ay : A >A : A return function (by: B) { ->function (by: B) { - return f(ay, by); - } : (by: B) => C +>function (by: B) { return f(ay, by); } : (by: B) => C >by : B >B : B @@ -176,8 +160,8 @@ function curry1(f: (a: A, b: B) => C): (ax: A) => (bx: B) => C { var cfilter = curry1(filter); >cfilter : (ax: {}) => (bx: {}) => {}[] >curry1(filter) : (ax: {}) => (bx: {}) => {}[] ->curry1 : (f: (a: A, b: B) => C) => (ax: A) => (bx: B) => C ->filter : (f: (a: A) => boolean, ar: A[]) => A[] +>curry1 : typeof curry1 +>filter : typeof filter // compose :: (b->c) -> (a->b) -> (a->c) // length :: [a] -> Num @@ -188,7 +172,7 @@ var cfilter = curry1(filter); // countWhere :: (a -> Bool) -> [a] -> Num function countWhere_1(pred: (a: A) => boolean): (a: A[]) => number { ->countWhere_1 : (pred: (a: A) => boolean) => (a: A[]) => number +>countWhere_1 : typeof countWhere_1 >A : A >pred : (a: A) => boolean >a : A @@ -198,15 +182,15 @@ function countWhere_1(pred: (a: A) => boolean): (a: A[]) => number { return compose(length2, cfilter(pred)); >compose(length2, cfilter(pred)) : (a: {}) => number ->compose : (f: (b: B) => C, g: (a: A) => B) => (a: A) => C ->length2 : (ar: A[]) => number +>compose : typeof compose +>length2 : typeof length2 >cfilter(pred) : (bx: {}) => {}[] >cfilter : (ax: {}) => (bx: {}) => {}[] >pred : (a: A) => boolean } function countWhere_2(pred: (a: A) => boolean): (a: A[]) => number { ->countWhere_2 : (pred: (a: A) => boolean) => (a: A[]) => number +>countWhere_2 : typeof countWhere_2 >A : A >pred : (a: A) => boolean >a : A @@ -222,7 +206,7 @@ function countWhere_2(pred: (a: A) => boolean): (a: A[]) => number { return compose(length2, where); >compose(length2, where) : (a: {}) => number ->compose : (f: (b: B) => C, g: (a: A) => B) => (a: A) => C ->length2 : (ar: A[]) => number +>compose : typeof compose +>length2 : typeof length2 >where : (bx: {}) => {}[] } diff --git a/tests/baselines/reference/genericTypeWithCallableMembers.js b/tests/baselines/reference/genericTypeWithCallableMembers.js index ebf95b41dcc..c4ebf44c15e 100644 --- a/tests/baselines/reference/genericTypeWithCallableMembers.js +++ b/tests/baselines/reference/genericTypeWithCallableMembers.js @@ -6,7 +6,7 @@ interface Constructable { class C { constructor(public data: T, public data2: Constructable) { } create() { - var x = new this.data(); // no error + var x = new this.data(); // error var x2 = new this.data2(); // was error, shouldn't be } } diff --git a/tests/baselines/reference/genericTypeWithCallableMembers.types b/tests/baselines/reference/genericTypeWithCallableMembers.types index e0068d5ff2b..379e7d2cacb 100644 --- a/tests/baselines/reference/genericTypeWithCallableMembers.types +++ b/tests/baselines/reference/genericTypeWithCallableMembers.types @@ -20,7 +20,7 @@ class C { create() { >create : () => void - var x = new this.data(); // no error + var x = new this.data(); // error >x : Constructable >new this.data() : Constructable >this.data : T diff --git a/tests/baselines/reference/genericTypeWithCallableMembers2.types b/tests/baselines/reference/genericTypeWithCallableMembers2.types index 5c265e30a85..a0b6ec0e8a5 100644 --- a/tests/baselines/reference/genericTypeWithCallableMembers2.types +++ b/tests/baselines/reference/genericTypeWithCallableMembers2.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericTypeWithCallableMembers2.ts === function foo1(f: T) { ->foo1 : string>(f: T) => string +>foo1 : typeof foo1 >T : T >f : T >T : T @@ -11,7 +11,7 @@ function foo1(f: T) { } function foo2(f: T) { ->foo2 : string>(f: T) => string +>foo2 : typeof foo2 >T : T >f : T >T : T diff --git a/tests/baselines/reference/genericsAndHigherOrderFunctions.types b/tests/baselines/reference/genericsAndHigherOrderFunctions.types index 6f9ffe4217e..04209ca99ec 100644 --- a/tests/baselines/reference/genericsAndHigherOrderFunctions.types +++ b/tests/baselines/reference/genericsAndHigherOrderFunctions.types @@ -23,9 +23,7 @@ var combine: (f: (_: T) => S) => >S : S = (f: (_: T) => S) => ->(f: (_: T) => S) => - (g: (_: U) => T) => - (x: U) => f(g(x)) : (f: (_: T) => S) => (g: (_: U) => T) => (x: U) => S +>(f: (_: T) => S) => (g: (_: U) => T) => (x: U) => f(g(x)) : (f: (_: T) => S) => (g: (_: U) => T) => (x: U) => S >T : T >S : S >f : (_: T) => S @@ -34,8 +32,7 @@ var combine: (f: (_: T) => S) => >S : S (g: (_: U) => T) => ->(g: (_: U) => T) => - (x: U) => f(g(x)) : (g: (_: U) => T) => (x: U) => S +>(g: (_: U) => T) => (x: U) => f(g(x)) : (g: (_: U) => T) => (x: U) => S >U : U >g : (_: U) => T >_ : U @@ -87,9 +84,7 @@ var foo: (g: (x: K) => N) => >R : R = (g: (x: K) => N) => ->(g: (x: K) => N) => - (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => - (f: (_: N) => (_: R) => R) => h(combine(f)(g)) : (g: (x: K) => N) => (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => (f: (_: N) => (_: R) => R) => (_: R) => R +>(g: (x: K) => N) => (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => (f: (_: N) => (_: R) => R) => h(combine(f)(g)) : (g: (x: K) => N) => (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => (f: (_: N) => (_: R) => R) => (_: R) => R >K : K >N : N >g : (x: K) => N @@ -98,8 +93,7 @@ var foo: (g: (x: K) => N) => >N : N (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => ->(h: (_: (_: K) => (_: M) => M) => (_: M) => M) => - (f: (_: N) => (_: R) => R) => h(combine(f)(g)) : (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => (f: (_: N) => (_: R) => R) => (_: R) => R +>(h: (_: (_: K) => (_: M) => M) => (_: M) => M) => (f: (_: N) => (_: R) => R) => h(combine(f)(g)) : (h: (_: (_: K) => (_: M) => M) => (_: M) => M) => (f: (_: N) => (_: R) => R) => (_: R) => R >h : (_: (_: K) => (_: M) => M) => (_: M) => M >M : M >_ : (_: K) => (_: M) => M diff --git a/tests/baselines/reference/genericsManyTypeParameters.types b/tests/baselines/reference/genericsManyTypeParameters.types index 0094f320051..21ed88b2013 100644 --- a/tests/baselines/reference/genericsManyTypeParameters.types +++ b/tests/baselines/reference/genericsManyTypeParameters.types @@ -1,6 +1,6 @@ === tests/cases/compiler/genericsManyTypeParameters.ts === function Foo< ->Foo : (x1: a1, y1: a21, z1: a31, a1: a41, b1: a51, c1: a61, x2: a119, y2: a22, z2: a32, a2: a42, b2: a52, c2: a62, x3: a219, y3: a23, z3: a33, a3: a43, b3: a53, c3: a63, x4: a319, y4: a24, z4: a34, a4: a44, b4: a54, c4: a64, x5: a419, y5: a25, z5: a35, a5: a45, b5: a55, c5: a65, x6: a519, y6: a26, z6: a36, a6: a46, b6: a56, c6: a66, x7: a619, y7: a27, z7: a37, a7: a47, b7: a57, c7: a67, x8: a71, y8: a28, z8: a38, a8: a48, b8: a58, c8: a68, x9: a81, y9: a29, z9: a39, a9: a49, b9: a59, c9: a69, x10: a91, y12: a210, z10: a310, a10: a410, b10: a510, c10: a610, x11: a111, y13: a211, z11: a311, a11: a411, b11: a511, c11: a611, x12: a112, y14: a212, z12: a312, a12: a412, b12: a512, c12: a612, x13: a113, y15: a213, z13: a313, a13: a413, b13: a513, c13: a613, x14: a114, y16: a214, z14: a314, a14: a414, b14: a514, c14: a614, x15: a115, y17: a215, z15: a315, a15: a415, b15: a515, c15: a615, x16: a116, y18: a216, z16: a316, a16: a416, b16: a516, c16: a616, x17: a117, y19: a217, z17: a317, a17: a417, b17: a517, c17: a617, x18: a118, y10: a218, z18: a318, a18: a418, b18: a518, c18: a618) => {}[] +>Foo : typeof Foo a1, a21, a31, a41, a51, a61, >a1 : a1 @@ -402,24 +402,7 @@ function Foo< ) { return [x1 , y1 , z1 , a1 , b1 , c1, ->[x1 , y1 , z1 , a1 , b1 , c1, - x2 , y2 , z2 , a2 , b2 , c2, - x3 , y3 , z3 , a3 , b3 , c3, - x4 , y4 , z4 , a4 , b4 , c4, - x5 , y5 , z5 , a5 , b5 , c5, - x6 , y6 , z6 , a6 , b6 , c6, - x7 , y7 , z7 , a7 , b7 , c7, - x8 , y8 , z8 , a8 , b8 , c8, - x9 , y9 , z9 , a9 , b9 , c9, - x10 , y12 , z10 , a10 , b10 , c10, - x11 , y13 , z11 , a11 , b11 , c11, - x12 , y14 , z12 , a12 , b12 , c12, - x13 , y15 , z13 , a13 , b13 , c13, - x14 , y16 , z14 , a14 , b14 , c14, - x15 , y17 , z15 , a15 , b15 , c15, - x16 , y18 , z16 , a16 , b16 , c16, - x17 , y19 , z17 , a17 , b17 , c17, - x18 , y10 , z18 , a18 , b18 , c18] : {}[] +>[x1 , y1 , z1 , a1 , b1 , c1, x2 , y2 , z2 , a2 , b2 , c2, x3 , y3 , z3 , a3 , b3 , c3, x4 , y4 , z4 , a4 , b4 , c4, x5 , y5 , z5 , a5 , b5 , c5, x6 , y6 , z6 , a6 , b6 , c6, x7 , y7 , z7 , a7 , b7 , c7, x8 , y8 , z8 , a8 , b8 , c8, x9 , y9 , z9 , a9 , b9 , c9, x10 , y12 , z10 , a10 , b10 , c10, x11 , y13 , z11 , a11 , b11 , c11, x12 , y14 , z12 , a12 , b12 , c12, x13 , y15 , z13 , a13 , b13 , c13, x14 , y16 , z14 , a14 , b14 , c14, x15 , y17 , z15 , a15 , b15 , c15, x16 , y18 , z16 , a16 , b16 , c16, x17 , y19 , z17 , a17 , b17 , c17, x18 , y10 , z18 , a18 , b18 , c18] : {}[] >x1 : a1 >y1 : a21 >z1 : a31 diff --git a/tests/baselines/reference/getterSetterNonAccessor.types b/tests/baselines/reference/getterSetterNonAccessor.types index 9bbf3298ffe..9ca08d4407e 100644 --- a/tests/baselines/reference/getterSetterNonAccessor.types +++ b/tests/baselines/reference/getterSetterNonAccessor.types @@ -1,44 +1,28 @@ === tests/cases/compiler/getterSetterNonAccessor.ts === function getFunc():any{return 0;} ->getFunc : () => any +>getFunc : typeof getFunc function setFunc(v){} ->setFunc : (v: any) => void +>setFunc : typeof setFunc >v : any Object.defineProperty({}, "0", ({ ->Object.defineProperty({}, "0", ({ - get: getFunc, - set: setFunc, - configurable: true - })) : any +>Object.defineProperty({}, "0", ({ get: getFunc, set: setFunc, configurable: true })) : any >Object.defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >Object : { (): any; (value: any): any; new (value?: any): Object; prototype: Object; getPrototypeOf(o: any): any; getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: any): any; freeze(o: any): any; preventExtensions(o: any): any; isSealed(o: any): boolean; isFrozen(o: any): boolean; isExtensible(o: any): boolean; keys(o: any): string[]; } >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >{} : {} ->({ - get: getFunc, - set: setFunc, - configurable: true - }) : PropertyDescriptor +>({ get: getFunc, set: setFunc, configurable: true }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor ->({ - get: getFunc, - set: setFunc, - configurable: true - }) : { get: () => any; set: (v: any) => void; configurable: boolean; } ->{ - get: getFunc, - set: setFunc, - configurable: true - } : { get: () => any; set: (v: any) => void; configurable: boolean; } +>({ get: getFunc, set: setFunc, configurable: true }) : { get: typeof getFunc; set: typeof setFunc; configurable: boolean; } +>{ get: getFunc, set: setFunc, configurable: true } : { get: typeof getFunc; set: typeof setFunc; configurable: boolean; } get: getFunc, ->get : () => any +>get : typeof getFunc >getFunc : getFunc set: setFunc, ->set : (v: any) => void +>set : typeof setFunc >setFunc : setFunc configurable: true diff --git a/tests/baselines/reference/global.types b/tests/baselines/reference/global.types index 86d5dd3c986..ae041eca65a 100644 --- a/tests/baselines/reference/global.types +++ b/tests/baselines/reference/global.types @@ -3,7 +3,7 @@ module M { >M : typeof M export function f(y:number) { ->f : (y: number) => number +>f : typeof f >y : number return x+y; @@ -18,8 +18,8 @@ var x=10; M.f(3); >M.f(3) : number ->M.f : (y: number) => number +>M.f : typeof f >M : typeof M ->f : (y: number) => number +>f : typeof f diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.types b/tests/baselines/reference/heterogeneousArrayLiterals.types index f81f1b2d249..a6de60ec174 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.types +++ b/tests/baselines/reference/heterogeneousArrayLiterals.types @@ -237,7 +237,7 @@ module WithContextualType { } function foo(t: T, u: U) { ->foo : (t: T, u: U) => void +>foo : typeof foo >T : T >U : U >t : T @@ -286,7 +286,7 @@ function foo(t: T, u: U) { } function foo2(t: T, u: U) { ->foo2 : (t: T, u: U) => void +>foo2 : typeof foo2 >T : T >Base : Base >U : U @@ -361,7 +361,7 @@ function foo2(t: T, u: U) { } function foo3(t: T, u: U) { ->foo3 : (t: T, u: U) => void +>foo3 : typeof foo3 >T : T >Derived : Derived >U : U @@ -436,7 +436,7 @@ function foo3(t: T, u: U) { } function foo4(t: T, u: U) { ->foo4 : (t: T, u: U) => void +>foo4 : typeof foo4 >T : T >Base : Base >U : U diff --git a/tests/baselines/reference/icomparable.types b/tests/baselines/reference/icomparable.types index 2766743f41f..5281ff73e3c 100644 --- a/tests/baselines/reference/icomparable.types +++ b/tests/baselines/reference/icomparable.types @@ -10,7 +10,7 @@ } declare function sort>(items: U[]): U[]; ->sort : >(items: U[]) => U[] +>sort : typeof sort >U : U >IComparable : IComparable >items : U[] @@ -29,6 +29,6 @@ var x = sort(sc); >x : StringComparable[] >sort(sc) : StringComparable[] ->sort : >(items: U[]) => U[] +>sort : typeof sort >sc : StringComparable[] diff --git a/tests/baselines/reference/idInProp.types b/tests/baselines/reference/idInProp.types index f300be6ebf2..8227b6fe2c4 100644 --- a/tests/baselines/reference/idInProp.types +++ b/tests/baselines/reference/idInProp.types @@ -1,6 +1,6 @@ === tests/cases/compiler/idInProp.ts === function f() { ->f : () => void +>f : typeof f var t: { (f: any) : any; }; >t : (f: any) => any diff --git a/tests/baselines/reference/ifDoWhileStatements.types b/tests/baselines/reference/ifDoWhileStatements.types index 46663086532..b488b6c6fc0 100644 --- a/tests/baselines/reference/ifDoWhileStatements.types +++ b/tests/baselines/reference/ifDoWhileStatements.types @@ -46,11 +46,11 @@ class D{ } function F(x: string): number { return 42; } ->F : (x: string) => number +>F : typeof F >x : string function F2(x: number): boolean { return x < 42; } ->F2 : (x: number) => boolean +>F2 : typeof F2 >x : number >x < 42 : boolean >x : number @@ -66,7 +66,7 @@ module M { } export function F2(x: number): string { return x.toString(); } ->F2 : (x: number) => string +>F2 : typeof F2 >x : number >x.toString() : string >x.toString : (radix?: number) => string @@ -85,7 +85,7 @@ module N { } export function F2(x: number): string { return x.toString(); } ->F2 : (x: number) => string +>F2 : typeof F2 >x : number >x.toString() : string >x.toString : (radix?: number) => string @@ -124,13 +124,8 @@ while ('') { } do { }while('') if (/[a-z]/) { } ->/[a-z]/ : RegExp - while (/[a-z]/) { } ->/[a-z]/ : RegExp - do { }while(/[a-z]/) ->/[a-z]/ : RegExp if ([]) { } >[] : undefined[] @@ -286,7 +281,6 @@ do { }while(f) var g = /[a-z]/ >g : RegExp ->/[a-z]/ : RegExp if (g) { } >g : RegExp @@ -352,30 +346,30 @@ do { }while(k) >k : { x: number; y: string; } function fn(x?: string): I { return null; } ->fn : (x?: string) => I +>fn : typeof fn >x : string >I : I if (fn()) { } >fn() : I ->fn : (x?: string) => I +>fn : typeof fn while (fn()) { } >fn() : I ->fn : (x?: string) => I +>fn : typeof fn do { }while(fn()) >fn() : I ->fn : (x?: string) => I +>fn : typeof fn if (fn) { } ->fn : (x?: string) => I +>fn : typeof fn while (fn) { } ->fn : (x?: string) => I +>fn : typeof fn do { }while(fn) ->fn : (x?: string) => I +>fn : typeof fn diff --git a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt index 209749db465..34edae873cf 100644 --- a/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/compiler/implementGenericWithMismatchedTypes.ts (2 errors) ==== +==== tests/cases/compiler/implementGenericWithMismatchedTypes.ts (3 errors) ==== // no errors because in the derived types the best common type for T's value is Object // and that matches the original signature for assignability since we treat its T's as Object @@ -24,9 +24,12 @@ ~~ !!! Class 'C2' incorrectly implements interface 'IFoo2': !!! Types of property 'foo' are incompatible: -!!! Type '(x: Tstring) => number' is not assignable to type '(x: T) => T': -!!! Type 'number' is not assignable to type 'T'. - foo(x: Tstring): number { +!!! Type '(x: string) => number' is not assignable to type '(x: T) => T': +!!! Types of parameters 'x' and 'x' are incompatible: +!!! Type 'string' is not assignable to type 'T'. + foo(x: string): number { + ~~~~~~ +!!! Type parameter name cannot be 'string' return null; } } \ No newline at end of file diff --git a/tests/baselines/reference/implementGenericWithMismatchedTypes.js b/tests/baselines/reference/implementGenericWithMismatchedTypes.js index a030ebc3c1d..5317666d912 100644 --- a/tests/baselines/reference/implementGenericWithMismatchedTypes.js +++ b/tests/baselines/reference/implementGenericWithMismatchedTypes.js @@ -15,7 +15,7 @@ interface IFoo2 { foo(x: T): T; } class C2 implements IFoo2 { // error - foo(x: Tstring): number { + foo(x: string): number { return null; } } diff --git a/tests/baselines/reference/implicitAnyAnyReturningFunction.types b/tests/baselines/reference/implicitAnyAnyReturningFunction.types index 1f0b81c724f..e084498ccec 100644 --- a/tests/baselines/reference/implicitAnyAnyReturningFunction.types +++ b/tests/baselines/reference/implicitAnyAnyReturningFunction.types @@ -1,13 +1,13 @@ === tests/cases/compiler/implicitAnyAnyReturningFunction.ts === function A() { ->A : () => any +>A : typeof A return ""; >"" : any } function B() { ->B : () => any +>B : typeof B var someLocal: any = {}; >someLocal : any diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.types b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.types index 9fd971ab862..9c5264bb029 100644 --- a/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.types +++ b/tests/baselines/reference/implicitAnyDeclareFunctionWithoutFormalType2.types @@ -1,7 +1,7 @@ === tests/cases/compiler/implicitAnyDeclareFunctionWithoutFormalType2.ts === // generates function fn1(): number; function fn1() { ->fn1 : () => number +>fn1 : typeof fn1 var x: number; >x : number @@ -11,7 +11,7 @@ function fn1() { } // generates function fn2(): any; function fn2(): any { ->fn2 : () => any +>fn2 : typeof fn2 var x: any; >x : any @@ -21,7 +21,7 @@ function fn2(): any { } // generates function fn3(); function fn3() { ->fn3 : () => any +>fn3 : typeof fn3 var x: any; >x : any diff --git a/tests/baselines/reference/implicitAnyGenerics.types b/tests/baselines/reference/implicitAnyGenerics.types index 91a231e3f12..b3744097d33 100644 --- a/tests/baselines/reference/implicitAnyGenerics.types +++ b/tests/baselines/reference/implicitAnyGenerics.types @@ -67,17 +67,17 @@ var d5: D = new D(null); >D : typeof D function foo(): T { return null; }; ->foo : () => T +>foo : typeof foo >T : T >T : T foo() >foo() : {} ->foo : () => T +>foo : typeof foo foo(); >foo() : any ->foo : () => T +>foo : typeof foo diff --git a/tests/baselines/reference/importDecl.errors.txt b/tests/baselines/reference/importDecl.errors.txt new file mode 100644 index 00000000000..2a43a4362c5 --- /dev/null +++ b/tests/baselines/reference/importDecl.errors.txt @@ -0,0 +1,83 @@ +==== tests/cases/compiler/importDecl_1.ts (1 errors) ==== + /// + /// + /// + /// + /// + import m4 = require("importDecl_require"); // Emit used + export var x4 = m4.x; + export var d4 = m4.d; + export var f4 = m4.foo(); + + export module m1 { + export var x2 = m4.x; + export var d2 = m4.d; + export var f2 = m4.foo(); + + var x3 = m4.x; + var d3 = m4.d; + var f3 = m4.foo(); + } + + //Emit global only usage + import glo_m4 = require("importDecl_require1"); + export var useGlo_m4_x4 = glo_m4.x; + ~ +!!! Property 'x' does not exist on type 'typeof "tests/cases/compiler/importDecl_require1"'. + export var useGlo_m4_d4 = glo_m4.d; + export var useGlo_m4_f4 = glo_m4.foo(); + + //Emit even when used just in function type + import fncOnly_m4 = require("importDecl_require2"); + export var useFncOnly_m4_f4 = fncOnly_m4.foo(); + + // only used privately no need to emit + import private_m4 = require("importDecl_require3"); + export module usePrivate_m4_m1 { + var x3 = private_m4.x; + var d3 = private_m4.d; + var f3 = private_m4.foo(); + } + + // Do not emit unused import + import m5 = require("importDecl_require4"); + export var d = m5.foo2(); + + // Do not emit multiple used import statements + import multiImport_m4 = require("importDecl_require"); // Emit used + export var useMultiImport_m4_x4 = multiImport_m4.x; + export var useMultiImport_m4_d4 = multiImport_m4.d; + export var useMultiImport_m4_f4 = multiImport_m4.foo(); + +==== tests/cases/compiler/importDecl_require.ts (0 errors) ==== + export class d { + foo: string; + } + export var x: d; + export function foo(): d { return null; } + +==== tests/cases/compiler/importDecl_require1.ts (0 errors) ==== + export class d { + bar: string; + } + var x: d; + export function foo(): d { return null; } + +==== tests/cases/compiler/importDecl_require2.ts (0 errors) ==== + export class d { + baz: string; + } + export var x: d; + export function foo(): d { return null; } + +==== tests/cases/compiler/importDecl_require3.ts (0 errors) ==== + export class d { + bing: string; + } + export var x: d; + export function foo(): d { return null; } + +==== tests/cases/compiler/importDecl_require4.ts (0 errors) ==== + import m4 = require("importDecl_require"); + export function foo2(): m4.d { return null; } + \ No newline at end of file diff --git a/tests/baselines/reference/importDecl.js b/tests/baselines/reference/importDecl.js index e37d46919e9..76312b2b32a 100644 --- a/tests/baselines/reference/importDecl.js +++ b/tests/baselines/reference/importDecl.js @@ -55,6 +55,7 @@ export module m1 { //Emit global only usage import glo_m4 = require("importDecl_require1"); +export var useGlo_m4_x4 = glo_m4.x; export var useGlo_m4_d4 = glo_m4.d; export var useGlo_m4_f4 = glo_m4.foo(); @@ -155,6 +156,7 @@ exports.f4 = m4.foo(); var m1 = exports.m1; //Emit global only usage var glo_m4 = require("importDecl_require1"); +exports.useGlo_m4_x4 = glo_m4.x; exports.useGlo_m4_d4 = glo_m4.d; exports.useGlo_m4_f4 = glo_m4.foo(); //Emit even when used just in function type @@ -176,57 +178,3 @@ var multiImport_m4 = require("importDecl_require"); // Emit used exports.useMultiImport_m4_x4 = multiImport_m4.x; exports.useMultiImport_m4_d4 = multiImport_m4.d; exports.useMultiImport_m4_f4 = multiImport_m4.foo(); - - -//// [importDecl_require.d.ts] -export declare class d { - foo: string; -} -export declare var x: d; -export declare function foo(): d; -//// [importDecl_require1.d.ts] -export declare class d { - bar: string; -} -export declare function foo(): d; -//// [importDecl_require2.d.ts] -export declare class d { - baz: string; -} -export declare var x: d; -export declare function foo(): d; -//// [importDecl_require3.d.ts] -export declare class d { - bing: string; -} -export declare var x: d; -export declare function foo(): d; -//// [importDecl_require4.d.ts] -import m4 = require("importDecl_require"); -export declare function foo2(): m4.d; -//// [importDecl_1.d.ts] -/// -/// -/// -/// -/// -import m4 = require("importDecl_require"); -export declare var x4: m4.d; -export declare var d4: typeof m4.d; -export declare var f4: m4.d; -export declare module m1 { - var x2: m4.d; - var d2: typeof m4.d; - var f2: m4.d; -} -import glo_m4 = require("importDecl_require1"); -export declare var useGlo_m4_d4: typeof glo_m4.d; -export declare var useGlo_m4_f4: glo_m4.d; -import fncOnly_m4 = require("importDecl_require2"); -export declare var useFncOnly_m4_f4: fncOnly_m4.d; -export declare module usePrivate_m4_m1 { -} -export declare var d: m4.d; -export declare var useMultiImport_m4_x4: m4.d; -export declare var useMultiImport_m4_d4: typeof m4.d; -export declare var useMultiImport_m4_f4: m4.d; diff --git a/tests/baselines/reference/importDecl.types b/tests/baselines/reference/importDecl.types deleted file mode 100644 index e6725e87768..00000000000 --- a/tests/baselines/reference/importDecl.types +++ /dev/null @@ -1,228 +0,0 @@ -=== tests/cases/compiler/importDecl_1.ts === -/// -/// -/// -/// -/// -import m4 = require("importDecl_require"); // Emit used ->m4 : typeof "tests/cases/compiler/importDecl_require" - -export var x4 = m4.x; ->x4 : d ->m4.x : d ->m4 : typeof "tests/cases/compiler/importDecl_require" ->x : d - -export var d4 = m4.d; ->d4 : typeof d ->m4.d : typeof d ->m4 : typeof "tests/cases/compiler/importDecl_require" ->d : typeof d - -export var f4 = m4.foo(); ->f4 : d ->m4.foo() : d ->m4.foo : () => d ->m4 : typeof "tests/cases/compiler/importDecl_require" ->foo : () => d - -export module m1 { ->m1 : typeof m1 - - export var x2 = m4.x; ->x2 : d ->m4.x : d ->m4 : typeof "tests/cases/compiler/importDecl_require" ->x : d - - export var d2 = m4.d; ->d2 : typeof d ->m4.d : typeof d ->m4 : typeof "tests/cases/compiler/importDecl_require" ->d : typeof d - - export var f2 = m4.foo(); ->f2 : d ->m4.foo() : d ->m4.foo : () => d ->m4 : typeof "tests/cases/compiler/importDecl_require" ->foo : () => d - - var x3 = m4.x; ->x3 : d ->m4.x : d ->m4 : typeof "tests/cases/compiler/importDecl_require" ->x : d - - var d3 = m4.d; ->d3 : typeof d ->m4.d : typeof d ->m4 : typeof "tests/cases/compiler/importDecl_require" ->d : typeof d - - var f3 = m4.foo(); ->f3 : d ->m4.foo() : d ->m4.foo : () => d ->m4 : typeof "tests/cases/compiler/importDecl_require" ->foo : () => d -} - -//Emit global only usage -import glo_m4 = require("importDecl_require1"); ->glo_m4 : typeof "tests/cases/compiler/importDecl_require1" - -export var useGlo_m4_d4 = glo_m4.d; ->useGlo_m4_d4 : typeof d ->glo_m4.d : typeof d ->glo_m4 : typeof "tests/cases/compiler/importDecl_require1" ->d : typeof d - -export var useGlo_m4_f4 = glo_m4.foo(); ->useGlo_m4_f4 : d ->glo_m4.foo() : d ->glo_m4.foo : () => d ->glo_m4 : typeof "tests/cases/compiler/importDecl_require1" ->foo : () => d - -//Emit even when used just in function type -import fncOnly_m4 = require("importDecl_require2"); ->fncOnly_m4 : typeof "tests/cases/compiler/importDecl_require2" - -export var useFncOnly_m4_f4 = fncOnly_m4.foo(); ->useFncOnly_m4_f4 : d ->fncOnly_m4.foo() : d ->fncOnly_m4.foo : () => d ->fncOnly_m4 : typeof "tests/cases/compiler/importDecl_require2" ->foo : () => d - -// only used privately no need to emit -import private_m4 = require("importDecl_require3"); ->private_m4 : typeof "tests/cases/compiler/importDecl_require3" - -export module usePrivate_m4_m1 { ->usePrivate_m4_m1 : typeof usePrivate_m4_m1 - - var x3 = private_m4.x; ->x3 : d ->private_m4.x : d ->private_m4 : typeof "tests/cases/compiler/importDecl_require3" ->x : d - - var d3 = private_m4.d; ->d3 : typeof d ->private_m4.d : typeof d ->private_m4 : typeof "tests/cases/compiler/importDecl_require3" ->d : typeof d - - var f3 = private_m4.foo(); ->f3 : d ->private_m4.foo() : d ->private_m4.foo : () => d ->private_m4 : typeof "tests/cases/compiler/importDecl_require3" ->foo : () => d -} - -// Do not emit unused import -import m5 = require("importDecl_require4"); ->m5 : typeof "tests/cases/compiler/importDecl_require4" - -export var d = m5.foo2(); ->d : d ->m5.foo2() : d ->m5.foo2 : () => d ->m5 : typeof "tests/cases/compiler/importDecl_require4" ->foo2 : () => d - -// Do not emit multiple used import statements -import multiImport_m4 = require("importDecl_require"); // Emit used ->multiImport_m4 : typeof "tests/cases/compiler/importDecl_require" - -export var useMultiImport_m4_x4 = multiImport_m4.x; ->useMultiImport_m4_x4 : d ->multiImport_m4.x : d ->multiImport_m4 : typeof "tests/cases/compiler/importDecl_require" ->x : d - -export var useMultiImport_m4_d4 = multiImport_m4.d; ->useMultiImport_m4_d4 : typeof d ->multiImport_m4.d : typeof d ->multiImport_m4 : typeof "tests/cases/compiler/importDecl_require" ->d : typeof d - -export var useMultiImport_m4_f4 = multiImport_m4.foo(); ->useMultiImport_m4_f4 : d ->multiImport_m4.foo() : d ->multiImport_m4.foo : () => d ->multiImport_m4 : typeof "tests/cases/compiler/importDecl_require" ->foo : () => d - -=== tests/cases/compiler/importDecl_require.ts === -export class d { ->d : d - - foo: string; ->foo : string -} -export var x: d; ->x : d ->d : d - -export function foo(): d { return null; } ->foo : () => d ->d : d - -=== tests/cases/compiler/importDecl_require1.ts === -export class d { ->d : d - - bar: string; ->bar : string -} -var x: d; ->x : d ->d : d - -export function foo(): d { return null; } ->foo : () => d ->d : d - -=== tests/cases/compiler/importDecl_require2.ts === -export class d { ->d : d - - baz: string; ->baz : string -} -export var x: d; ->x : d ->d : d - -export function foo(): d { return null; } ->foo : () => d ->d : d - -=== tests/cases/compiler/importDecl_require3.ts === -export class d { ->d : d - - bing: string; ->bing : string -} -export var x: d; ->x : d ->d : d - -export function foo(): d { return null; } ->foo : () => d ->d : d - -=== tests/cases/compiler/importDecl_require4.ts === -import m4 = require("importDecl_require"); ->m4 : typeof "tests/cases/compiler/importDecl_require" - -export function foo2(): m4.d { return null; } ->foo2 : () => d ->m4 : m4 ->d : d - diff --git a/tests/baselines/reference/importStatements.types b/tests/baselines/reference/importStatements.types index c7fe4382d30..6b08757d261 100644 --- a/tests/baselines/reference/importStatements.types +++ b/tests/baselines/reference/importStatements.types @@ -73,7 +73,7 @@ module E { >A : typeof A export function xDist(x: a.Point) { ->xDist : (x: Point) => number +>xDist : typeof xDist >x : Point >a : a >Point : Point diff --git a/tests/baselines/reference/inOperatorWithValidOperands.types b/tests/baselines/reference/inOperatorWithValidOperands.types index f621c3bf55d..f2c4d903d1d 100644 --- a/tests/baselines/reference/inOperatorWithValidOperands.types +++ b/tests/baselines/reference/inOperatorWithValidOperands.types @@ -56,7 +56,7 @@ var rb2 = x in {}; >{} : {} function foo(t: T) { ->foo : (t: T) => void +>foo : typeof foo >T : T >t : T >T : T diff --git a/tests/baselines/reference/indexSignatureTypeInference.errors.txt b/tests/baselines/reference/indexSignatureTypeInference.errors.txt deleted file mode 100644 index a37e4458543..00000000000 --- a/tests/baselines/reference/indexSignatureTypeInference.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -==== tests/cases/compiler/indexSignatureTypeInference.ts (1 errors) ==== - interface NumberMap { - [index: number]: T; - } - - interface StringMap { - [index: string]: T; - } - - declare function numberMapToArray(object: NumberMap): T[]; - declare function stringMapToArray(object: StringMap): T[]; - - var numberMap: NumberMap; - var stringMap: StringMap; - - var v1: Function[]; - var v1 = numberMapToArray(numberMap); // Ok - var v1 = numberMapToArray(stringMap); // Ok - var v1 = stringMapToArray(numberMap); // Error expected here - ~~~~~~~~~ -!!! Argument of type 'NumberMap' is not assignable to parameter of type 'StringMap<{}>'. - var v1 = stringMapToArray(stringMap); // Ok - \ No newline at end of file diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.types b/tests/baselines/reference/indexSignaturesInferentialTyping.types index 3c16db3a2bf..a59c8e930ea 100644 --- a/tests/baselines/reference/indexSignaturesInferentialTyping.types +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.types @@ -1,6 +1,6 @@ === tests/cases/compiler/indexSignaturesInferentialTyping.ts === function foo(items: { [index: number]: T }): T { return undefined; } ->foo : (items: { [x: number]: T; }) => T +>foo : typeof foo >T : T >items : { [x: number]: T; } >index : number @@ -9,7 +9,7 @@ function foo(items: { [index: number]: T }): T { return undefined; } >undefined : undefined function bar(items: { [index: string]: T }): T { return undefined; } ->bar : (items: { [x: string]: T; }) => T +>bar : typeof bar >T : T >items : { [x: string]: T; } >index : string @@ -20,13 +20,13 @@ function bar(items: { [index: string]: T }): T { return undefined; } var x1 = foo({ 0: 0, 1: 1 }); // type should be number >x1 : number >foo({ 0: 0, 1: 1 }) : number ->foo : (items: { [x: number]: T; }) => T +>foo : typeof foo >{ 0: 0, 1: 1 } : { [x: number]: number; 0: number; 1: number; } var x2 = foo({ zero: 0, one: 1 }); >x2 : {} >foo({ zero: 0, one: 1 }) : {} ->foo : (items: { [x: number]: T; }) => T +>foo : typeof foo >{ zero: 0, one: 1 } : { [x: number]: {}; zero: number; one: number; } >zero : number >one : number @@ -34,13 +34,13 @@ var x2 = foo({ zero: 0, one: 1 }); var x3 = bar({ 0: 0, 1: 1 }); >x3 : number >bar({ 0: 0, 1: 1 }) : number ->bar : (items: { [x: string]: T; }) => T +>bar : typeof bar >{ 0: 0, 1: 1 } : { [x: string]: number; 0: number; 1: number; } var x4 = bar({ zero: 0, one: 1 }); // type should be number >x4 : number >bar({ zero: 0, one: 1 }) : number ->bar : (items: { [x: string]: T; }) => T +>bar : typeof bar >{ zero: 0, one: 1 } : { [x: string]: number; zero: number; one: number; } >zero : number >one : number diff --git a/tests/baselines/reference/inferSecondaryParameter.types b/tests/baselines/reference/inferSecondaryParameter.types index 9831fe89e5b..e416cface90 100644 --- a/tests/baselines/reference/inferSecondaryParameter.types +++ b/tests/baselines/reference/inferSecondaryParameter.types @@ -19,15 +19,11 @@ var b: Ib = { m: function (test: string, fn: Function) { } }; >Function : Function b.m("test", function (bug) { ->b.m("test", function (bug) { - var a: number = bug; -}) : any +>b.m("test", function (bug) { var a: number = bug;}) : any >b.m : (test: string, fn: Function) => any >b : Ib >m : (test: string, fn: Function) => any ->function (bug) { - var a: number = bug; -} : (bug: any) => void +>function (bug) { var a: number = bug;} : (bug: any) => void >bug : any var a: number = bug; diff --git a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types index 5bf41c64b24..3f985ac3413 100644 --- a/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types +++ b/tests/baselines/reference/inferTypeArgumentsInSignatureWithRestParameters.types @@ -1,25 +1,25 @@ === tests/cases/compiler/inferTypeArgumentsInSignatureWithRestParameters.ts === function f(array: T[], ...args) { } ->f : (array: T[], ...args: any[]) => void +>f : typeof f >T : T >array : T[] >T : T >args : any[] function g(array: number[], ...args) { } ->g : (array: number[], ...args: any[]) => void +>g : typeof g >array : number[] >args : any[] function h(nonarray: T, ...args) { } ->h : (nonarray: T, ...args: any[]) => void +>h : typeof h >T : T >nonarray : T >T : T >args : any[] function i(array: T[], opt?: any[]) { } ->i : (array: T[], opt?: any[]) => void +>i : typeof i >T : T >array : T[] >T : T @@ -31,21 +31,21 @@ var a = [1, 2, 3, 4, 5]; f(a); // OK >f(a) : void ->f : (array: T[], ...args: any[]) => void +>f : typeof f >a : number[] g(a); // OK >g(a) : void ->g : (array: number[], ...args: any[]) => void +>g : typeof g >a : number[] h(a); // OK >h(a) : void ->h : (nonarray: T, ...args: any[]) => void +>h : typeof h >a : number[] i(a); // OK >i(a) : void ->i : (array: T[], opt?: any[]) => void +>i : typeof i >a : number[] diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType.types b/tests/baselines/reference/inferentialTypingWithFunctionType.types index 9f1986c49ea..44312c331f7 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType.types @@ -1,6 +1,6 @@ === tests/cases/compiler/inferentialTypingWithFunctionType.ts === declare function map(x: T, f: (s: T) => U): U; ->map : (x: T, f: (s: T) => U) => U +>map : typeof map >T : T >U : U >x : T @@ -12,7 +12,7 @@ declare function map(x: T, f: (s: T) => U): U; >U : U declare function identity(y: V): V; ->identity : (y: V) => V +>identity : typeof identity >V : V >y : V >V : V @@ -21,6 +21,6 @@ declare function identity(y: V): V; var s = map("", identity); >s : string >map("", identity) : string ->map : (x: T, f: (s: T) => U) => U ->identity : (y: V) => V +>map : typeof map +>identity : typeof identity diff --git a/tests/baselines/reference/inferentialTypingWithFunctionType2.types b/tests/baselines/reference/inferentialTypingWithFunctionType2.types index a97bf2ab36c..81b74406ae2 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionType2.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionType2.types @@ -1,6 +1,6 @@ === tests/cases/compiler/inferentialTypingWithFunctionType2.ts === function identity(a: A): A { ->identity : (a: A) => A +>identity : typeof identity >A : A >a : A >A : A @@ -16,5 +16,5 @@ var x = [1, 2, 3].map(identity)[0]; >[1, 2, 3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] >[1, 2, 3] : number[] >map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] ->identity : (a: A) => A +>identity : typeof identity diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types index 7628e9c4a9d..8afebb11aaf 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeNested.types @@ -1,6 +1,6 @@ === tests/cases/compiler/inferentialTypingWithFunctionTypeNested.ts === declare function map(x: T, f: () => { x: (s: T) => U }): U; ->map : (x: T, f: () => { x: (s: T) => U; }) => U +>map : typeof map >T : T >U : U >x : T @@ -13,7 +13,7 @@ declare function map(x: T, f: () => { x: (s: T) => U }): U; >U : U declare function identity(y: V): V; ->identity : (y: V) => V +>identity : typeof identity >V : V >y : V >V : V @@ -22,9 +22,9 @@ declare function identity(y: V): V; var s = map("", () => { return { x: identity }; }); >s : any >map("", () => { return { x: identity }; }) : any ->map : (x: T, f: () => { x: (s: T) => U; }) => U ->() => { return { x: identity }; } : () => { x: (y: V) => V; } ->{ x: identity } : { x: (y: V) => V; } ->x : (y: V) => V +>map : typeof map +>() => { return { x: identity }; } : () => { x: typeof identity; } +>{ x: identity } : { x: typeof identity; } +>x : typeof identity >identity : identity diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types index ac3d69b9b7d..347036b6981 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types @@ -1,6 +1,6 @@ === tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts === declare function map(array: T, func: (x: T) => U): U; ->map : (array: T, func: (x: T) => U) => U +>map : typeof map >T : T >U : U >array : T @@ -12,7 +12,7 @@ declare function map(array: T, func: (x: T) => U): U; >U : U declare function identity(y: V): V; ->identity : (y: V) => V +>identity : typeof identity >V : V >y : V >V : V @@ -23,46 +23,46 @@ var s: string; // dotted name var dottedIdentity = { x: identity }; ->dottedIdentity : { x: (y: V) => V; } ->{ x: identity } : { x: (y: V) => V; } ->x : (y: V) => V +>dottedIdentity : { x: typeof identity; } +>{ x: identity } : { x: typeof identity; } +>x : typeof identity >identity : identity s = map("", dottedIdentity.x); >s = map("", dottedIdentity.x) : string >s : string >map("", dottedIdentity.x) : string ->map : (array: T, func: (x: T) => U) => U ->dottedIdentity.x : (y: V) => V ->dottedIdentity : { x: (y: V) => V; } ->x : (y: V) => V +>map : typeof map +>dottedIdentity.x : typeof identity +>dottedIdentity : { x: typeof identity; } +>x : typeof identity // index expression s = map("", dottedIdentity['x']); >s = map("", dottedIdentity['x']) : string >s : string >map("", dottedIdentity['x']) : string ->map : (array: T, func: (x: T) => U) => U ->dottedIdentity['x'] : (y: V) => V ->dottedIdentity : { x: (y: V) => V; } +>map : typeof map +>dottedIdentity['x'] : typeof identity +>dottedIdentity : { x: typeof identity; } // function call s = map("", (() => identity)()); >s = map("", (() => identity)()) : string >s : string >map("", (() => identity)()) : string ->map : (array: T, func: (x: T) => U) => U ->(() => identity)() : (y: V) => V ->(() => identity) : () => (y: V) => V ->() => identity : () => (y: V) => V ->identity : (y: V) => V +>map : typeof map +>(() => identity)() : typeof identity +>(() => identity) : () => typeof identity +>() => identity : () => typeof identity +>identity : typeof identity // construct interface IdentityConstructor { >IdentityConstructor : IdentityConstructor new (): typeof identity; ->identity : (y: V) => V +>identity : typeof identity } var ic: IdentityConstructor; >ic : IdentityConstructor @@ -72,8 +72,8 @@ s = map("", new ic()); >s = map("", new ic()) : string >s : string >map("", new ic()) : string ->map : (array: T, func: (x: T) => U) => U ->new ic() : (y: V) => V +>map : typeof map +>new ic() : typeof identity >ic : IdentityConstructor // assignment @@ -84,37 +84,37 @@ s = map("", t = identity); >s = map("", t = identity) : string >s : string >map("", t = identity) : string ->map : (array: T, func: (x: T) => U) => U ->t = identity : (y: V) => V +>map : typeof map +>t = identity : typeof identity >t : any ->identity : (y: V) => V +>identity : typeof identity // type assertion s = map("", identity); >s = map("", identity) : string >s : string >map("", identity) : string ->map : (array: T, func: (x: T) => U) => U ->identity : (y: V) => V ->identity : (y: V) => V ->identity : (y: V) => V +>map : typeof map +>identity : typeof identity +>identity : typeof identity +>identity : typeof identity // parenthesized expression s = map("", (identity)); >s = map("", (identity)) : string >s : string >map("", (identity)) : string ->map : (array: T, func: (x: T) => U) => U ->(identity) : (y: V) => V ->identity : (y: V) => V +>map : typeof map +>(identity) : typeof identity +>identity : typeof identity // comma s = map("", ("", identity)); >s = map("", ("", identity)) : string >s : string >map("", ("", identity)) : string ->map : (array: T, func: (x: T) => U) => U ->("", identity) : (y: V) => V ->"", identity : (y: V) => V ->identity : (y: V) => V +>map : typeof map +>("", identity) : typeof identity +>"", identity : typeof identity +>identity : typeof identity diff --git a/tests/baselines/reference/inferentiallyTypingAnEmptyArray.types b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.types index c8f51c985e6..bd35eaac96e 100644 --- a/tests/baselines/reference/inferentiallyTypingAnEmptyArray.types +++ b/tests/baselines/reference/inferentiallyTypingAnEmptyArray.types @@ -15,7 +15,7 @@ // Therefore, the following access to bar should not cause an error because we infer // the undefined[] type. declare function foo(arr: T[]): T; ->foo : (arr: T[]) => T +>foo : typeof foo >T : T >arr : T[] >T : T @@ -24,7 +24,7 @@ declare function foo(arr: T[]): T; foo([]).bar; >foo([]).bar : any >foo([]) : any ->foo : (arr: T[]) => T +>foo : typeof foo >[] : any[] >bar : any diff --git a/tests/baselines/reference/infiniteExpansionThroughTypeInference.types b/tests/baselines/reference/infiniteExpansionThroughTypeInference.types index df818833aa0..69c705ca5b0 100644 --- a/tests/baselines/reference/infiniteExpansionThroughTypeInference.types +++ b/tests/baselines/reference/infiniteExpansionThroughTypeInference.types @@ -15,7 +15,7 @@ interface G { } function ff(g: G): void { ->ff : (g: G) => void +>ff : typeof ff >T : T >g : G >G : G @@ -23,7 +23,7 @@ function ff(g: G): void { ff(g) // when infering T here we need to make sure to not descend into the structure of G infinitely >ff(g) : void ->ff : (g: G) => void +>ff : typeof ff >g : G } diff --git a/tests/baselines/reference/infinitelyExpandingTypes5.types b/tests/baselines/reference/infinitelyExpandingTypes5.types index f145ff9539f..7c1ba26a7cf 100644 --- a/tests/baselines/reference/infinitelyExpandingTypes5.types +++ b/tests/baselines/reference/infinitelyExpandingTypes5.types @@ -23,7 +23,7 @@ interface Enumerator { } function from(array: T[]): Query; ->from : { (array: T[]): Query; (enumerator: Enumerator): Query; } +>from : typeof from >T : T >array : T[] >T : T @@ -31,7 +31,7 @@ function from(array: T[]): Query; >T : T function from(enumerator: Enumerator): Query; ->from : { (array: T[]): Query; (enumerator: Enumerator): Query; } +>from : typeof from >T : T >enumerator : Enumerator >Enumerator : Enumerator @@ -40,7 +40,7 @@ function from(enumerator: Enumerator): Query; >T : T function from(arg: any): any { ->from : { (array: T[]): Query; (enumerator: Enumerator): Query; } +>from : typeof from >arg : any return undefined; diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.types b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.types index 9190ef15779..9a86ce3e8cd 100644 --- a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.types +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.types @@ -44,13 +44,13 @@ interface Options extends OptionsBase { function o(type: new () => Base) { ->o : (type: new () => Base) => void +>o : typeof o >type : new () => Base >Base : Base } o(A); >o(A) : void ->o : (type: new () => Base) => void +>o : typeof o >A : typeof A diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types index ec7b3f5bbf9..60b851e10d1 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.types @@ -3,7 +3,7 @@ class a { >a : a static x() { ->x : () => string +>x : typeof x return "10"; } @@ -14,7 +14,7 @@ class b extends a { >a : a static x() { ->x : () => string +>x : typeof x return "20"; } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types index 842f9ffddf9..bcecfd22605 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.types @@ -11,7 +11,7 @@ class b extends a { >a : a static x() { ->x : () => string +>x : typeof x return "20"; } diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.types b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.types index 4742dde63f6..0f503f5c975 100644 --- a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.types +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.types @@ -11,7 +11,7 @@ class b extends a { >a : a static x() { ->x : () => string +>x : typeof x return new b().x; >new b().x : string diff --git a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types index c24c0545c3e..2dc52065feb 100644 --- a/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types +++ b/tests/baselines/reference/inheritedFunctionAssignmentCompatibility.types @@ -4,20 +4,20 @@ interface IResultCallback extends Function { } >Function : Function function fn(cb: IResultCallback) { } ->fn : (cb: IResultCallback) => void +>fn : typeof fn >cb : IResultCallback >IResultCallback : IResultCallback fn((a, b) => true); >fn((a, b) => true) : void ->fn : (cb: IResultCallback) => void +>fn : typeof fn >(a, b) => true : (a: any, b: any) => boolean >a : any >b : any fn(function (a, b) { return true; }) >fn(function (a, b) { return true; }) : void ->fn : (cb: IResultCallback) => void +>fn : typeof fn >function (a, b) { return true; } : (a: any, b: any) => boolean >a : any >b : any diff --git a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types b/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types deleted file mode 100644 index 0284fa4bc43..00000000000 --- a/tests/baselines/reference/inheritedOverloadedSpecializedSignatures.types +++ /dev/null @@ -1,90 +0,0 @@ -=== tests/cases/compiler/inheritedOverloadedSpecializedSignatures.ts === -interface A { ->A : A - - (key:string):void; ->key : string -} - -interface B extends A { ->B : B ->A : A - - (key:'foo'):string; ->key : 'foo' -} - -var b:B; ->b : B ->B : B - -// Should not error -b('foo').charAt(0); ->b('foo').charAt(0) : string ->b('foo').charAt : (pos: number) => string ->b('foo') : string ->b : B ->charAt : (pos: number) => string - -interface A { ->A : A - - (x: 'A1'): string; ->x : 'A1' - - (x: string): void; ->x : string -} - -interface B extends A { ->B : B ->A : A - - (x: 'B1'): number; ->x : 'B1' -} - -interface A { ->A : A - - (x: 'A2'): boolean; ->x : 'A2' -} - -interface B { ->B : B - - (x: 'B2'): string[]; ->x : 'B2' -} - -var b: B; ->b : B ->B : B - -// non of these lines should error -var x1: string[] = b('B2'); ->x1 : string[] ->b('B2') : string[] ->b : B - -var x2: number = b('B1'); ->x2 : number ->b('B1') : number ->b : B - -var x3: boolean = b('A2'); ->x3 : boolean ->b('A2') : boolean ->b : B - -var x4: string = b('A1'); ->x4 : string ->b('A1') : string ->b : B - -var x5: void = b('A0'); ->x5 : void ->b('A0') : void ->b : B - diff --git a/tests/baselines/reference/innerAliases2.types b/tests/baselines/reference/innerAliases2.types index 458f0019831..ef599d0d3f6 100644 --- a/tests/baselines/reference/innerAliases2.types +++ b/tests/baselines/reference/innerAliases2.types @@ -24,7 +24,7 @@ module consumer { >UsefulClass : UsefulClass function use():provider.UsefulClass { ->use : () => UsefulClass +>use : typeof use >provider : provider >UsefulClass : UsefulClass diff --git a/tests/baselines/reference/innerFunc.types b/tests/baselines/reference/innerFunc.types index 8ca9e9d0a0b..7725f0c2928 100644 --- a/tests/baselines/reference/innerFunc.types +++ b/tests/baselines/reference/innerFunc.types @@ -1,6 +1,6 @@ === tests/cases/compiler/innerFunc.ts === function salt() { ->salt : () => number +>salt : typeof salt function pepper() { return 5;} >pepper : () => number @@ -14,7 +14,7 @@ module M { >M : typeof M export function tungsten() { ->tungsten : () => number +>tungsten : typeof tungsten function oxygen() { return 6; }; >oxygen : () => number diff --git a/tests/baselines/reference/innerOverloads.types b/tests/baselines/reference/innerOverloads.types index 7168f6161f3..5c5194e7de1 100644 --- a/tests/baselines/reference/innerOverloads.types +++ b/tests/baselines/reference/innerOverloads.types @@ -1,7 +1,7 @@ === tests/cases/compiler/innerOverloads.ts === function outer() { ->outer : () => any +>outer : typeof outer function inner(x:number); // should work >inner : { (x: number): any; (x: string): any; } @@ -24,6 +24,6 @@ function outer() { var x = outer(); // should work >x : any >outer() : any ->outer : () => any +>outer : typeof outer diff --git a/tests/baselines/reference/innerTypeArgumentInference.types b/tests/baselines/reference/innerTypeArgumentInference.types index 759b78aa75f..d9f9c2c5dd8 100644 --- a/tests/baselines/reference/innerTypeArgumentInference.types +++ b/tests/baselines/reference/innerTypeArgumentInference.types @@ -5,7 +5,7 @@ interface Generator { (): T; } >T : T function Generate(func: Generator): U { ->Generate : (func: Generator) => U +>Generate : typeof Generate >U : U >func : Generator >Generator : Generator @@ -14,6 +14,6 @@ function Generate(func: Generator): U { return Generate(func); >Generate(func) : U ->Generate : (func: Generator) => U +>Generate : typeof Generate >func : Generator } diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne.types b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.types index eb1ffb17217..bdd687e727b 100644 --- a/tests/baselines/reference/innerTypeParameterShadowingOuterOne.types +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.types @@ -3,7 +3,7 @@ // no errors expected function f() { ->f : () => void +>f : typeof f >T : T >Date : Date @@ -34,7 +34,7 @@ function f() { } function f2() { ->f2 : () => void +>f2 : typeof f2 >T : T >Date : Date >U : U diff --git a/tests/baselines/reference/instanceAndStaticDeclarations1.types b/tests/baselines/reference/instanceAndStaticDeclarations1.types index c80cf78e37a..6d081b0e62d 100644 --- a/tests/baselines/reference/instanceAndStaticDeclarations1.types +++ b/tests/baselines/reference/instanceAndStaticDeclarations1.types @@ -52,7 +52,7 @@ class Point { >Point : typeof Point static distance(p1: Point, p2: Point) { return p1.distance(p2); } ->distance : (p1: Point, p2: Point) => number +>distance : typeof distance >p1 : Point >Point : Point >p2 : Point diff --git a/tests/baselines/reference/instanceOfInExternalModules.types b/tests/baselines/reference/instanceOfInExternalModules.types index 35594ac2d7b..d5785247464 100644 --- a/tests/baselines/reference/instanceOfInExternalModules.types +++ b/tests/baselines/reference/instanceOfInExternalModules.types @@ -4,7 +4,7 @@ import Bar = require("instanceOfInExternalModules_require"); >Bar : typeof "tests/cases/compiler/instanceOfInExternalModules_require" function IsFoo(value: any): boolean { ->IsFoo : (value: any) => boolean +>IsFoo : typeof IsFoo >value : any return value instanceof Bar.Foo; diff --git a/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.types b/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.types index d10c6c5cafa..ec6c9e3963f 100644 --- a/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.types +++ b/tests/baselines/reference/instanceofOperatorWithLHSIsTypeParameter.types @@ -1,6 +1,6 @@ === tests/cases/conformance/expressions/binaryOperators/instanceofOperator/instanceofOperatorWithLHSIsTypeParameter.ts === function foo(t: T) { ->foo : (t: T) => void +>foo : typeof foo >T : T >t : T >T : T diff --git a/tests/baselines/reference/instantiatedModule.types b/tests/baselines/reference/instantiatedModule.types index 5021cce8afb..d21f030d4bb 100644 --- a/tests/baselines/reference/instantiatedModule.types +++ b/tests/baselines/reference/instantiatedModule.types @@ -62,7 +62,7 @@ module M2 { >y : number static Origin(): Point { ->Origin : () => Point +>Origin : typeof Origin >Point : Point return { x: 0, y: 0 }; @@ -104,9 +104,9 @@ var o: M2.Point = a2.Origin(); >M2 : M2 >Point : Point >a2.Origin() : Point ->a2.Origin : () => Point +>a2.Origin : typeof Origin >a2 : typeof Point ->Origin : () => Point +>Origin : typeof Origin var p2: { x: number; y: number } >p2 : { x: number; y: number; } diff --git a/tests/baselines/reference/interMixingModulesInterfaces0.types b/tests/baselines/reference/interMixingModulesInterfaces0.types index a6f132970cd..a6f246fc8d4 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces0.types +++ b/tests/baselines/reference/interMixingModulesInterfaces0.types @@ -6,7 +6,7 @@ module A { >B : typeof B export function createB(): B { ->createB : () => B +>createB : typeof createB >B : B return null; @@ -29,9 +29,9 @@ var x: A.B = A.B.createB(); >A : A >B : B >A.B.createB() : B ->A.B.createB : () => B +>A.B.createB : typeof createB >A.B : typeof B >A : typeof A >B : typeof B ->createB : () => B +>createB : typeof createB diff --git a/tests/baselines/reference/interMixingModulesInterfaces1.types b/tests/baselines/reference/interMixingModulesInterfaces1.types index df54cefd96f..14e746e6669 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces1.types +++ b/tests/baselines/reference/interMixingModulesInterfaces1.types @@ -16,7 +16,7 @@ module A { >B : typeof B export function createB(): B { ->createB : () => B +>createB : typeof createB >B : B return null; @@ -29,9 +29,9 @@ var x: A.B = A.B.createB(); >A : A >B : B >A.B.createB() : B ->A.B.createB : () => B +>A.B.createB : typeof createB >A.B : typeof B >A : typeof A >B : typeof B ->createB : () => B +>createB : typeof createB diff --git a/tests/baselines/reference/interMixingModulesInterfaces2.types b/tests/baselines/reference/interMixingModulesInterfaces2.types index 67d8e04c571..d5978a475f7 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces2.types +++ b/tests/baselines/reference/interMixingModulesInterfaces2.types @@ -16,7 +16,7 @@ module A { >B : typeof B export function createB(): B { ->createB : () => B +>createB : typeof createB >B : B return null; diff --git a/tests/baselines/reference/interMixingModulesInterfaces3.types b/tests/baselines/reference/interMixingModulesInterfaces3.types index 9ffb4149b48..967f6c4e8d7 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces3.types +++ b/tests/baselines/reference/interMixingModulesInterfaces3.types @@ -6,7 +6,7 @@ module A { >B : typeof B export function createB(): B { ->createB : () => B +>createB : typeof createB >B : B return null; diff --git a/tests/baselines/reference/interMixingModulesInterfaces4.types b/tests/baselines/reference/interMixingModulesInterfaces4.types index 9df3388a09a..eb117ea0029 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces4.types +++ b/tests/baselines/reference/interMixingModulesInterfaces4.types @@ -6,7 +6,7 @@ module A { >B : typeof B export function createB(): number { ->createB : () => number +>createB : typeof createB return null; } @@ -26,9 +26,9 @@ module A { var x : number = A.B.createB(); >x : number >A.B.createB() : number ->A.B.createB : () => number +>A.B.createB : typeof createB >A.B : typeof B >A : typeof A >B : typeof B ->createB : () => number +>createB : typeof createB diff --git a/tests/baselines/reference/interMixingModulesInterfaces5.types b/tests/baselines/reference/interMixingModulesInterfaces5.types index de08a7be442..91dd6c2168c 100644 --- a/tests/baselines/reference/interMixingModulesInterfaces5.types +++ b/tests/baselines/reference/interMixingModulesInterfaces5.types @@ -16,7 +16,7 @@ module A { >B : typeof B export function createB(): number { ->createB : () => number +>createB : typeof createB return null; } @@ -26,9 +26,9 @@ module A { var x: number = A.B.createB(); >x : number >A.B.createB() : number ->A.B.createB : () => number +>A.B.createB : typeof createB >A.B : typeof B >A : typeof A >B : typeof B ->createB : () => number +>createB : typeof createB diff --git a/tests/baselines/reference/interfaceContextualType.types b/tests/baselines/reference/interfaceContextualType.types index 65bd6b7ae34..88ba9dcbc24 100644 --- a/tests/baselines/reference/interfaceContextualType.types +++ b/tests/baselines/reference/interfaceContextualType.types @@ -46,15 +46,11 @@ class Bug { >shouldBeOK : () => void this.values = { ->this.values = { - comments: { italic: true } - } : { [x: string]: IOptions; comments: { italic: boolean; }; } +>this.values = { comments: { italic: true } } : { [x: string]: IOptions; comments: { italic: boolean; }; } >this.values : IMap >this : Bug >values : IMap ->{ - comments: { italic: true } - } : { [x: string]: IOptions; comments: { italic: boolean; }; } +>{ comments: { italic: true } } : { [x: string]: IOptions; comments: { italic: boolean; }; } comments: { italic: true } >comments : { italic: boolean; } diff --git a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types index be340c70143..08c59a3d82d 100644 --- a/tests/baselines/reference/interfaceWithPropertyOfEveryType.types +++ b/tests/baselines/reference/interfaceWithPropertyOfEveryType.types @@ -4,7 +4,7 @@ class C { foo: string; } >foo : string function f1() { } ->f1 : () => void +>f1 : typeof f1 module M { >M : typeof M @@ -61,8 +61,8 @@ interface Foo { >C : C l: typeof f1; ->l : () => void ->f1 : () => void +>l : typeof f1 +>f1 : typeof f1 m: typeof M; >m : typeof M @@ -79,23 +79,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: boolean; 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: number; b: string; c: boolean; d: {}; e: null; f: number[]; g: {}; h: (x: number) => number; i: (x: T) => T; j: Foo; k: C; l: typeof f1; m: typeof M; n: {}; o: E; } a: 1, >a : number @@ -145,7 +129,7 @@ var a: Foo = { >C : typeof C l: f1, ->l : () => void +>l : typeof f1 >f1 : f1 m: M, diff --git a/tests/baselines/reference/internalAliasFunction.types b/tests/baselines/reference/internalAliasFunction.types index ed297ce1b4e..b1723a38e75 100644 --- a/tests/baselines/reference/internalAliasFunction.types +++ b/tests/baselines/reference/internalAliasFunction.types @@ -3,7 +3,7 @@ module a { >a : typeof a export function foo(x: number) { ->foo : (x: number) => number +>foo : typeof foo >x : number return x; @@ -15,17 +15,17 @@ module c { >c : typeof c import b = a.foo; ->b : (x: number) => number +>b : typeof foo >a : typeof a ->foo : (x: number) => number +>foo : typeof foo export var bVal = b(10); >bVal : number >b(10) : number ->b : (x: number) => number +>b : typeof foo export var bVal2 = b; ->bVal2 : (x: number) => number ->b : (x: number) => number +>bVal2 : typeof foo +>b : typeof foo } diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types index b3140e7b09a..260a57834a2 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithExport.types @@ -3,7 +3,7 @@ export module a { >a : typeof a export function foo(x: number) { ->foo : (x: number) => number +>foo : typeof foo >x : number return x; @@ -15,17 +15,17 @@ export module c { >c : typeof c export import b = a.foo; ->b : (x: number) => number +>b : typeof foo >a : typeof a ->foo : (x: number) => number +>foo : typeof foo export var bVal = b(10); >bVal : number >b(10) : number ->b : (x: number) => number +>b : typeof foo export var bVal2 = b; ->bVal2 : (x: number) => number ->b : (x: number) => number +>bVal2 : typeof foo +>b : typeof foo } diff --git a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types index c78b5040495..df75263fca9 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideLocalModuleWithoutExport.types @@ -3,7 +3,7 @@ export module a { >a : typeof a export function foo(x: number) { ->foo : (x: number) => number +>foo : typeof foo >x : number return x; @@ -15,17 +15,17 @@ export module c { >c : typeof c import b = a.foo; ->b : (x: number) => number +>b : typeof foo >a : typeof a ->foo : (x: number) => number +>foo : typeof foo var bVal = b(10); >bVal : number >b(10) : number ->b : (x: number) => number +>b : typeof foo export var bVal2 = b; ->bVal2 : (x: number) => number ->b : (x: number) => number +>bVal2 : typeof foo +>b : typeof foo } diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types index 365f0edeb27..835d07910b8 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithExport.types @@ -3,7 +3,7 @@ export module a { >a : typeof a export function foo(x: number) { ->foo : (x: number) => number +>foo : typeof foo >x : number return x; @@ -12,16 +12,16 @@ export module a { } export import b = a.foo; ->b : (x: number) => number +>b : typeof foo >a : typeof a ->foo : (x: number) => number +>foo : typeof foo export var bVal = b(10); >bVal : number >b(10) : number ->b : (x: number) => number +>b : typeof foo export var bVal2 = b; ->bVal2 : (x: number) => number ->b : (x: number) => number +>bVal2 : typeof foo +>b : typeof foo diff --git a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types index c2f06c66f76..da517b03a36 100644 --- a/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types +++ b/tests/baselines/reference/internalAliasFunctionInsideTopLevelModuleWithoutExport.types @@ -3,7 +3,7 @@ export module a { >a : typeof a export function foo(x: number) { ->foo : (x: number) => number +>foo : typeof foo >x : number return x; @@ -12,16 +12,16 @@ export module a { } import b = a.foo; ->b : (x: number) => number +>b : typeof foo >a : typeof a ->foo : (x: number) => number +>foo : typeof foo export var bVal = b(10); >bVal : number >b(10) : number ->b : (x: number) => number +>b : typeof foo export var bVal2 = b; ->bVal2 : (x: number) => number ->b : (x: number) => number +>bVal2 : typeof foo +>b : typeof foo diff --git a/tests/baselines/reference/internalAliasWithDottedNameEmit.js b/tests/baselines/reference/internalAliasWithDottedNameEmit.js index d6a4cfcfff7..d70da1ba16c 100644 --- a/tests/baselines/reference/internalAliasWithDottedNameEmit.js +++ b/tests/baselines/reference/internalAliasWithDottedNameEmit.js @@ -18,11 +18,3 @@ var a; })(a.b || (a.b = {})); var b = a.b; })(a || (a = {})); - - -//// [internalAliasWithDottedNameEmit.d.ts] -declare module a.b.c { - var d: any; -} -declare module a.e.f { -} diff --git a/tests/baselines/reference/invalidTryStatements2.errors.txt b/tests/baselines/reference/invalidTryStatements2.errors.txt index a600210a605..8481e437b89 100644 --- a/tests/baselines/reference/invalidTryStatements2.errors.txt +++ b/tests/baselines/reference/invalidTryStatements2.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (6 errors) ==== +==== tests/cases/conformance/statements/tryStatements/invalidTryStatements2.ts (2 errors) ==== function fn() { try { } catch { // syntax error, missing '(x)' @@ -10,32 +10,5 @@ ~~~~~ !!! 'try' expected. - finally{ } // potential error; can be absorbed by the 'catch' - } - - function fn2() { - finally { } // error missing try - ~~~~~~~ -!!! 'try' expected. - catch (x) { } // error missing try - ~~~~~ -!!! 'try' expected. - - // no error - try { - } - finally { - } - - // error missing try - finally { - ~~~~~~~ -!!! 'try' expected. - } - - // error missing try - catch (x) { - ~~~~~ -!!! 'try' expected. - } + finally{ } // error missing try } \ No newline at end of file diff --git a/tests/baselines/reference/invalidUndefinedValues.types b/tests/baselines/reference/invalidUndefinedValues.types index 9cc71b87c82..3824498d216 100644 --- a/tests/baselines/reference/invalidUndefinedValues.types +++ b/tests/baselines/reference/invalidUndefinedValues.types @@ -75,7 +75,7 @@ x = { f() { } } >f() { } : () => void function f(a: T) { ->f : (a: T) => void +>f : typeof f >T : T >a : T >T : T @@ -86,9 +86,9 @@ function f(a: T) { >a : T } x = f; ->x = f : (a: T) => void +>x = f : typeof f >x : any ->f : (a: T) => void +>f : typeof f enum E { A } >E : E diff --git a/tests/baselines/reference/ipromise2.types b/tests/baselines/reference/ipromise2.types index 1cb5bcecc34..c611b081ed2 100644 --- a/tests/baselines/reference/ipromise2.types +++ b/tests/baselines/reference/ipromise2.types @@ -104,15 +104,11 @@ var p: Windows.Foundation.IPromise; var p2 = p.then(function (s) { >p2 : IPromise ->p.then(function (s) { - return 34; -} ) : IPromise +>p.then(function (s) { return 34;} ) : IPromise >p.then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } >p : IPromise >then : { (success?: (value: string) => IPromise, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => IPromise, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => IPromise, progress?: (progress: any) => void): IPromise; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise; } ->function (s) { - return 34; -} : (s: string) => number +>function (s) { return 34;} : (s: string) => number >s : string return 34; diff --git a/tests/baselines/reference/ipromise3.types b/tests/baselines/reference/ipromise3.types index 4750dd4b6ce..7f11624db09 100644 --- a/tests/baselines/reference/ipromise3.types +++ b/tests/baselines/reference/ipromise3.types @@ -85,15 +85,11 @@ var p1: IPromise3; var p2: IPromise3 = p1.then(function (x) { >p2 : IPromise3 >IPromise3 : IPromise3 ->p1.then(function (x) { - return x; -}) : IPromise3 +>p1.then(function (x) { return x;}) : IPromise3 >p1.then : { (success?: (value: string) => IPromise3, error?: (error: any) => IPromise3, progress?: (progress: any) => void): IPromise3; (success?: (value: string) => IPromise3, error?: (error: any) => U, progress?: (progress: any) => void): IPromise3; (success?: (value: string) => U, error?: (error: any) => IPromise3, progress?: (progress: any) => void): IPromise3; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise3; } >p1 : IPromise3 >then : { (success?: (value: string) => IPromise3, error?: (error: any) => IPromise3, progress?: (progress: any) => void): IPromise3; (success?: (value: string) => IPromise3, error?: (error: any) => U, progress?: (progress: any) => void): IPromise3; (success?: (value: string) => U, error?: (error: any) => IPromise3, progress?: (progress: any) => void): IPromise3; (success?: (value: string) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise3; } ->function (x) { - return x; -} : (x: string) => string +>function (x) { return x;} : (x: string) => string >x : string return x; diff --git a/tests/baselines/reference/lambdaASIEmit.types b/tests/baselines/reference/lambdaASIEmit.types index acdbd777f23..07b4431e519 100644 --- a/tests/baselines/reference/lambdaASIEmit.types +++ b/tests/baselines/reference/lambdaASIEmit.types @@ -1,19 +1,15 @@ === tests/cases/compiler/lambdaASIEmit.ts === function Foo(x: any) ->Foo : (x: any) => void +>Foo : typeof Foo >x : any { } Foo(() => ->Foo(() => - // do something - 127) : void ->Foo : (x: any) => void ->() => - // do something - 127 : () => number +>Foo(() => // do something 127) : void +>Foo : typeof Foo +>() => // do something 127 : () => number // do something 127); diff --git a/tests/baselines/reference/listFailure.types b/tests/baselines/reference/listFailure.types index de3c33bbfad..cd235e53986 100644 --- a/tests/baselines/reference/listFailure.types +++ b/tests/baselines/reference/listFailure.types @@ -10,7 +10,7 @@ module Editor { >List : List >Line : Line >ListMakeHead() : List ->ListMakeHead : () => List +>ListMakeHead : typeof ListMakeHead >Line : Line addLine(lineText: string): List { @@ -41,7 +41,7 @@ module Editor { } export function ListRemoveEntry(entry: List): List { ->ListRemoveEntry : (entry: List) => List +>ListRemoveEntry : typeof ListRemoveEntry >U : U >entry : List >List : List @@ -54,7 +54,7 @@ module Editor { } export function ListMakeHead(): List { ->ListMakeHead : () => List +>ListMakeHead : typeof ListMakeHead >U : U >List : List >U : U @@ -63,7 +63,7 @@ module Editor { } export function ListMakeEntry(data: U): List { ->ListMakeEntry : (data: U) => List +>ListMakeEntry : typeof ListMakeEntry >U : U >data : U >U : U @@ -95,7 +95,7 @@ module Editor { >this : List >next : List >ListMakeEntry(data) : List ->ListMakeEntry : (data: U) => List +>ListMakeEntry : typeof ListMakeEntry >data : T return this.next; @@ -115,7 +115,7 @@ module Editor { return (ListRemoveEntry(this.next)); >(ListRemoveEntry(this.next)) : List >ListRemoveEntry(this.next) : List ->ListRemoveEntry : (entry: List) => List +>ListRemoveEntry : typeof ListRemoveEntry >this.next : List >this : List >next : List diff --git a/tests/baselines/reference/literals1.types b/tests/baselines/reference/literals1.types index b7c5d672eea..f1d6736fdca 100644 --- a/tests/baselines/reference/literals1.types +++ b/tests/baselines/reference/literals1.types @@ -34,13 +34,10 @@ var k = 'q\tq'; var m = /q/; >m : RegExp ->/q/ : RegExp var n = /\d+/g; >n : RegExp ->/\d+/g : RegExp var o = /[3-5]+/i; >o : RegExp ->/[3-5]+/i : RegExp diff --git a/tests/baselines/reference/localImportNameVsGlobalName.types b/tests/baselines/reference/localImportNameVsGlobalName.types index 7cb45208e81..6b920a25fe7 100644 --- a/tests/baselines/reference/localImportNameVsGlobalName.types +++ b/tests/baselines/reference/localImportNameVsGlobalName.types @@ -19,27 +19,27 @@ module App { >Key : Key export function foo(key: Key): void {} ->foo : (key: Key) => void +>foo : typeof foo >key : Key >Key : Key foo(Key.UP); >foo(Key.UP) : void ->foo : (key: Key) => void +>foo : typeof foo >Key.UP : Key >Key : typeof Key >UP : Key foo(Key.DOWN); >foo(Key.DOWN) : void ->foo : (key: Key) => void +>foo : typeof foo >Key.DOWN : Key >Key : typeof Key >DOWN : Key foo(Key.LEFT); >foo(Key.LEFT) : void ->foo : (key: Key) => void +>foo : typeof foo >Key.LEFT : Key >Key : typeof Key >LEFT : Key diff --git a/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.types b/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.types index 81ee0ddc74a..b18925989c4 100644 --- a/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.types +++ b/tests/baselines/reference/localVariablesReturnedFromCatchBlocks.types @@ -1,6 +1,6 @@ === tests/cases/compiler/localVariablesReturnedFromCatchBlocks.ts === function f() { ->f : () => any +>f : typeof f try { } catch (e) { diff --git a/tests/baselines/reference/logicalAndOperatorWithTypeParameters.types b/tests/baselines/reference/logicalAndOperatorWithTypeParameters.types index f77b231c6bc..711fca6c1e1 100644 --- a/tests/baselines/reference/logicalAndOperatorWithTypeParameters.types +++ b/tests/baselines/reference/logicalAndOperatorWithTypeParameters.types @@ -3,7 +3,7 @@ // type as the second operand. function foo(t: T, u: U, v: V) { ->foo : (t: T, u: U, v: V) => void +>foo : typeof foo >T : T >U : U >V : V diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types index e232ae2af80..d3c65cf8347 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.types @@ -4,7 +4,7 @@ var BOOLEAN: boolean; >BOOLEAN : boolean function foo(): boolean { return true; } ->foo : () => boolean +>foo : typeof foo class A { >A : A @@ -13,7 +13,7 @@ class A { >a : boolean static foo() { return false; } ->foo : () => boolean +>foo : typeof foo } module M { >M : typeof M @@ -64,15 +64,15 @@ var ResultIsBoolean6 = !foo(); >ResultIsBoolean6 : boolean >!foo() : boolean >foo() : boolean ->foo : () => boolean +>foo : typeof foo var ResultIsBoolean7 = !A.foo(); >ResultIsBoolean7 : boolean >!A.foo() : boolean >A.foo() : boolean ->A.foo : () => boolean +>A.foo : typeof foo >A : typeof A ->foo : () => boolean +>foo : typeof foo // multiple ! operators var ResultIsBoolean = !!BOOLEAN; @@ -92,7 +92,7 @@ var ResultIsBoolean = !!BOOLEAN; !foo(); >!foo() : boolean >foo() : boolean ->foo : () => boolean +>foo : typeof foo !true, false; >!true, false : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.types b/tests/baselines/reference/logicalNotOperatorWithNumberType.types index 4bcc8a14041..0e05d03eea7 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.types +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.types @@ -8,7 +8,7 @@ var NUMBER1: number[] = [1, 2]; >[1, 2] : number[] function foo(): number { return 1; } ->foo : () => number +>foo : typeof foo class A { >A : A @@ -17,7 +17,7 @@ class A { >a : number static foo() { return 1; } ->foo : () => number +>foo : typeof foo } module M { >M : typeof M @@ -89,15 +89,15 @@ var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean >!foo() : boolean >foo() : number ->foo : () => number +>foo : typeof foo var ResultIsBoolean10 = !A.foo(); >ResultIsBoolean10 : boolean >!A.foo() : boolean >A.foo() : number ->A.foo : () => number +>A.foo : typeof foo >A : typeof A ->foo : () => number +>foo : typeof foo var ResultIsBoolean11 = !(NUMBER + NUMBER); >ResultIsBoolean11 : boolean @@ -139,7 +139,7 @@ var ResultIsBoolean13 = !!!(NUMBER + NUMBER); !foo(); >!foo() : boolean >foo() : number ->foo : () => number +>foo : typeof foo !objA.a; >!objA.a : boolean diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.types b/tests/baselines/reference/logicalNotOperatorWithStringType.types index 2decb1ade18..136d6628ddb 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.types +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.types @@ -8,7 +8,7 @@ var STRING1: string[] = ["", "abc"]; >["", "abc"] : string[] function foo(): string { return "abc"; } ->foo : () => string +>foo : typeof foo class A { >A : A @@ -17,7 +17,7 @@ class A { >a : string static foo() { return ""; } ->foo : () => string +>foo : typeof foo } module M { >M : typeof M @@ -89,15 +89,15 @@ var ResultIsBoolean9 = !foo(); >ResultIsBoolean9 : boolean >!foo() : boolean >foo() : string ->foo : () => string +>foo : typeof foo var ResultIsBoolean10 = !A.foo(); >ResultIsBoolean10 : boolean >!A.foo() : boolean >A.foo() : string ->A.foo : () => string +>A.foo : typeof foo >A : typeof A ->foo : () => string +>foo : typeof foo var ResultIsBoolean11 = !(STRING + STRING); >ResultIsBoolean11 : boolean @@ -147,7 +147,7 @@ var ResultIsBoolean14 = !!!(STRING + STRING); !foo(); >!foo() : boolean >foo() : string ->foo : () => string +>foo : typeof foo !objA.a,M.n; >!objA.a,M.n : string diff --git a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types index ff0e0ce568a..374a7cdd5e9 100644 --- a/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types +++ b/tests/baselines/reference/logicalOrOperatorWithTypeParameters.types @@ -1,6 +1,6 @@ === tests/cases/conformance/expressions/binaryOperators/logicalOrOperator/logicalOrOperatorWithTypeParameters.ts === function fn1(t: T, u: U) { ->fn1 : (t: T, u: U) => void +>fn1 : typeof fn1 >T : T >U : U >t : T @@ -35,7 +35,7 @@ function fn1(t: T, u: U) { } function fn2(t: T, u: U, v: V) { ->fn2 : (t: T, u: U, v: V) => void +>fn2 : typeof fn2 >T : T >U : U >V : V @@ -82,7 +82,7 @@ function fn2(t: T, u: U, v: V) { } function fn3(t: T, u: U) { ->fn3 : (t: T, u: U) => void +>fn3 : typeof fn3 >T : T >a : string >b : string diff --git a/tests/baselines/reference/memberAccessMustUseModuleInstances.types b/tests/baselines/reference/memberAccessMustUseModuleInstances.types index f549b4078f9..c1a7cc9d3f1 100644 --- a/tests/baselines/reference/memberAccessMustUseModuleInstances.types +++ b/tests/baselines/reference/memberAccessMustUseModuleInstances.types @@ -5,18 +5,18 @@ import WinJS = require('memberAccessMustUseModuleInstances_0'); WinJS.Promise.timeout(10); >WinJS.Promise.timeout(10) : Promise ->WinJS.Promise.timeout : (delay: number) => Promise +>WinJS.Promise.timeout : typeof timeout >WinJS.Promise : typeof Promise >WinJS : typeof "tests/cases/compiler/memberAccessMustUseModuleInstances_0" >Promise : typeof Promise ->timeout : (delay: number) => Promise +>timeout : typeof timeout === tests/cases/compiler/memberAccessMustUseModuleInstances_0.ts === export class Promise { >Promise : Promise static timeout(delay: number): Promise { ->timeout : (delay: number) => Promise +>timeout : typeof timeout >delay : number >Promise : Promise diff --git a/tests/baselines/reference/memberFunctionsWithPublicOverloads.types b/tests/baselines/reference/memberFunctionsWithPublicOverloads.types index 7cbc2aca1ff..7dfd96d502e 100644 --- a/tests/baselines/reference/memberFunctionsWithPublicOverloads.types +++ b/tests/baselines/reference/memberFunctionsWithPublicOverloads.types @@ -35,34 +35,34 @@ class C { >y : any public static foo(x: number); ->foo : { (x: number): any; (x: number, y: string): any; } +>foo : typeof foo >x : number public static foo(x: number, y: string); ->foo : { (x: number): any; (x: number, y: string): any; } +>foo : typeof foo >x : number >y : string public static foo(x: any, y?: any) { } ->foo : { (x: number): any; (x: number, y: string): any; } +>foo : typeof foo >x : any >y : any public static bar(x: 'hi'); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : typeof bar >x : 'hi' public static bar(x: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : typeof bar >x : string public static bar(x: number, y: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : typeof bar >x : number >y : string public static bar(x: any, y?: any) { } ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : typeof bar >x : any >y : any } @@ -108,34 +108,34 @@ class D { >y : any public static foo(x: number); ->foo : { (x: number): any; (x: number, y: string): any; } +>foo : typeof foo >x : number public static foo(x: number, y: string); ->foo : { (x: number): any; (x: number, y: string): any; } +>foo : typeof foo >x : number >y : string public static foo(x: any, y?: any) { } ->foo : { (x: number): any; (x: number, y: string): any; } +>foo : typeof foo >x : any >y : any public static bar(x: 'hi'); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : typeof bar >x : 'hi' public static bar(x: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : typeof bar >x : string public static bar(x: number, y: string); ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : typeof bar >x : number >y : string public static bar(x: any, y?: any) { } ->bar : { (x: 'hi'): any; (x: string): any; (x: number, y: string): any; } +>bar : typeof bar >x : any >y : any diff --git a/tests/baselines/reference/mergedDeclarations1.types b/tests/baselines/reference/mergedDeclarations1.types index d2b5cca6426..f4b6cfc6e4b 100644 --- a/tests/baselines/reference/mergedDeclarations1.types +++ b/tests/baselines/reference/mergedDeclarations1.types @@ -30,7 +30,7 @@ module point { >point : typeof point export function equals(p1: Point, p2: Point) { ->equals : (p1: Point, p2: Point) => boolean +>equals : typeof equals >p1 : Point >Point : Point >p2 : Point @@ -68,9 +68,9 @@ var p2 = point.origin; var b = point.equals(p1, p2); >b : boolean >point.equals(p1, p2) : boolean ->point.equals : (p1: Point, p2: Point) => boolean +>point.equals : typeof equals >point : typeof point ->equals : (p1: Point, p2: Point) => boolean +>equals : typeof equals >p1 : Point >p2 : Point diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.types b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.types index d27056b3bdd..7eb7b8f2ae4 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen2.types +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen2.types @@ -5,20 +5,20 @@ module my.data.foo { >foo : typeof foo export function buz() { } ->buz : () => void +>buz : typeof buz } module my.data { >my : typeof my >data : typeof data function data(my) { ->data : (my: any) => void +>data : typeof data >my : any foo.buz(); >foo.buz() : void ->foo.buz : () => void +>foo.buz : typeof buz >foo : typeof foo ->buz : () => void +>buz : typeof buz } } diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.types b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.types index 45f652fe3c0..2013d068571 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen3.types +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen3.types @@ -4,7 +4,7 @@ module my.data { >data : typeof data export function buz() { } ->buz : () => void +>buz : typeof buz } module my.data.foo { >my : typeof my @@ -12,12 +12,12 @@ module my.data.foo { >foo : typeof foo function data(my, foo) { ->data : (my: any, foo: any) => void +>data : typeof data >my : any >foo : any buz(); >buz() : void ->buz : () => void +>buz : typeof buz } } diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.types b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.types index 0907a21a969..aa0dfdb4762 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen4.types +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen4.types @@ -13,7 +13,7 @@ module superContain { >data : typeof data export function foo() { } ->foo : () => void +>foo : typeof foo } } export module my.buz { @@ -24,7 +24,7 @@ module superContain { >data : typeof data export function bar(contain, my, buz, data) { ->bar : (contain: any, my: any, buz: any, data: any) => void +>bar : typeof bar >contain : any >my : any >buz : any @@ -32,7 +32,7 @@ module superContain { foo(); >foo() : void ->foo : () => void +>foo : typeof foo } } } diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.types b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.types index 344f052eb4c..0b835325cb9 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.types +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.types @@ -5,10 +5,10 @@ module M.buz.plop { >plop : typeof plop export function doom() { } ->doom : () => void +>doom : typeof doom export function M() { } ->M : () => void +>M : typeof M } module M.buz.plop { >M : typeof M @@ -16,10 +16,10 @@ module M.buz.plop { >plop : typeof plop function gunk() { } ->gunk : () => void +>gunk : typeof gunk function buz() { } ->buz : () => void +>buz : typeof buz export class fudge { } >fudge : fudge @@ -29,20 +29,20 @@ module M.buz.plop { // Emit these references as follows var v1 = gunk; // gunk ->v1 : () => void ->gunk : () => void +>v1 : typeof gunk +>gunk : typeof gunk var v2 = buz; // buz ->v2 : () => void ->buz : () => void +>v2 : typeof buz +>buz : typeof buz export var v3 = doom; // _plop.doom ->v3 : () => void ->doom : () => void +>v3 : typeof doom +>doom : typeof doom export var v4 = M; // _plop.M ->v4 : () => void ->M : () => void +>v4 : typeof M +>M : typeof M export var v5 = fudge; // fudge >v5 : typeof fudge diff --git a/tests/baselines/reference/methodContainingLocalFunction.types b/tests/baselines/reference/methodContainingLocalFunction.types index 29d39cd9e19..fb52c3831ba 100644 --- a/tests/baselines/reference/methodContainingLocalFunction.types +++ b/tests/baselines/reference/methodContainingLocalFunction.types @@ -92,7 +92,7 @@ module M { >M : typeof M export function exhibitBug() { ->exhibitBug : () => void +>exhibitBug : typeof exhibitBug function localFunction() { } >localFunction : () => void @@ -112,24 +112,9 @@ enum E { A = (() => { >A : E ->(() => { - function localFunction() { } - var x: { (): void; }; - x = localFunction; - return 0; - })() : number ->(() => { - function localFunction() { } - var x: { (): void; }; - x = localFunction; - return 0; - }) : () => number ->() => { - function localFunction() { } - var x: { (): void; }; - x = localFunction; - return 0; - } : () => number +>(() => { function localFunction() { } var x: { (): void; }; x = localFunction; return 0; })() : number +>(() => { function localFunction() { } var x: { (): void; }; x = localFunction; return 0; }) : () => number +>() => { function localFunction() { } var x: { (): void; }; x = localFunction; return 0; } : () => number function localFunction() { } >localFunction : () => void diff --git a/tests/baselines/reference/missingRequiredDeclare.d.errors.txt b/tests/baselines/reference/missingRequiredDeclare.d.errors.txt new file mode 100644 index 00000000000..932512ba8d8 --- /dev/null +++ b/tests/baselines/reference/missingRequiredDeclare.d.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/compiler/missingRequiredDeclare.d.ts (2 errors) ==== + var x = 1; + ~~~ +!!! A 'declare' modifier is required for a top level declaration in a .d.ts file. + ~ +!!! Initializers are not allowed in ambient contexts. \ No newline at end of file diff --git a/tests/baselines/reference/mixedExports.js b/tests/baselines/reference/mixedExports.js deleted file mode 100644 index 1e99ad3c720..00000000000 --- a/tests/baselines/reference/mixedExports.js +++ /dev/null @@ -1,19 +0,0 @@ -//// [mixedExports.ts] -declare module M { - function foo(); - export function foo(); - function foo(); -} - -declare module M1 { - export interface Foo {} - interface Foo {} -} - -module A { - interface X {x} - export module X {} - interface X {y} -} - -//// [mixedExports.js] diff --git a/tests/baselines/reference/mixedExports.types b/tests/baselines/reference/mixedExports.types deleted file mode 100644 index c9448423cb9..00000000000 --- a/tests/baselines/reference/mixedExports.types +++ /dev/null @@ -1,38 +0,0 @@ -=== tests/cases/compiler/mixedExports.ts === -declare module M { ->M : typeof M - - function foo(); ->foo : { (): any; (): any; (): any; } - - export function foo(); ->foo : { (): any; (): any; (): any; } - - function foo(); ->foo : { (): any; (): any; (): any; } -} - -declare module M1 { ->M1 : M1 - - export interface Foo {} ->Foo : Foo - - interface Foo {} ->Foo : Foo -} - -module A { ->A : A - - interface X {x} ->X : X ->x : any - - export module X {} ->X : X - - interface X {y} ->X : X ->y : any -} diff --git a/tests/baselines/reference/modFunctionCrash.types b/tests/baselines/reference/modFunctionCrash.types index 596dac999a1..0bbeb588c7e 100644 --- a/tests/baselines/reference/modFunctionCrash.types +++ b/tests/baselines/reference/modFunctionCrash.types @@ -3,16 +3,16 @@ declare module Q { >Q : typeof Q function f(fn:()=>void); // typechecking the function type shouldnot crash the compiler ->f : (fn: () => void) => any +>f : typeof f >fn : () => void } Q.f(function() {this;}); >Q.f(function() {this;}) : any ->Q.f : (fn: () => void) => any +>Q.f : typeof f >Q : typeof Q ->f : (fn: () => void) => any +>f : typeof f >function() {this;} : () => void >this : any diff --git a/tests/baselines/reference/moduleAliasAsFunctionArgument.types b/tests/baselines/reference/moduleAliasAsFunctionArgument.types index 15954c681e7..bb9bda32376 100644 --- a/tests/baselines/reference/moduleAliasAsFunctionArgument.types +++ b/tests/baselines/reference/moduleAliasAsFunctionArgument.types @@ -4,7 +4,7 @@ import a = require('moduleAliasAsFunctionArgument_0'); >a : typeof "tests/cases/compiler/moduleAliasAsFunctionArgument_0" function fn(arg: { x: number }) { ->fn : (arg: { x: number; }) => void +>fn : typeof fn >arg : { x: number; } >x : number } @@ -16,7 +16,7 @@ a.x; // OK fn(a); // Error: property 'x' is missing from 'a' >fn(a) : void ->fn : (arg: { x: number; }) => void +>fn : typeof fn >a : typeof "tests/cases/compiler/moduleAliasAsFunctionArgument_0" === tests/cases/compiler/moduleAliasAsFunctionArgument_0.ts === diff --git a/tests/baselines/reference/moduleCodeGenTest5.types b/tests/baselines/reference/moduleCodeGenTest5.types index 40161509aff..57f7b7e45e1 100644 --- a/tests/baselines/reference/moduleCodeGenTest5.types +++ b/tests/baselines/reference/moduleCodeGenTest5.types @@ -6,10 +6,10 @@ var y = 0; >y : number export function f1() {} ->f1 : () => void +>f1 : typeof f1 function f2() {} ->f2 : () => void +>f2 : typeof f2 export class C1 { >C1 : C1 diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types index d8f6083b2c9..aea08c53613 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation1.types @@ -34,9 +34,9 @@ module TypeScript { return Syntax.childIndex(); >Syntax.childIndex() : void ->Syntax.childIndex : () => void +>Syntax.childIndex : typeof childIndex >Syntax : typeof Syntax ->childIndex : () => void +>childIndex : typeof childIndex } } @@ -91,7 +91,7 @@ module TypeScript.Syntax { >Syntax : typeof Syntax export function childIndex() { } ->childIndex : () => void +>childIndex : typeof childIndex export class VariableWidthTokenWithTrailingTrivia implements ISyntaxToken { >VariableWidthTokenWithTrailingTrivia : VariableWidthTokenWithTrailingTrivia diff --git a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types index 2a5d2c76e76..3a1c0b07d92 100644 --- a/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types +++ b/tests/baselines/reference/moduleMemberWithoutTypeAnnotation2.types @@ -17,7 +17,7 @@ module TypeScript { >diagnosticWriter : any export function Alert(output: string) { ->Alert : (output: string) => void +>Alert : typeof Alert >output : string if (diagnosticWriter) { diff --git a/tests/baselines/reference/moduleScopingBug.types b/tests/baselines/reference/moduleScopingBug.types index b92b8de0c81..00cd06d076c 100644 --- a/tests/baselines/reference/moduleScopingBug.types +++ b/tests/baselines/reference/moduleScopingBug.types @@ -8,7 +8,7 @@ module M >outer : number function f() { ->f : () => void +>f : typeof f var inner = outer; // Ok >inner : number diff --git a/tests/baselines/reference/moduleSymbolMerging.types b/tests/baselines/reference/moduleSymbolMerging.types deleted file mode 100644 index 29354592a42..00000000000 --- a/tests/baselines/reference/moduleSymbolMerging.types +++ /dev/null @@ -1,21 +0,0 @@ -=== tests/cases/compiler/B.ts === -/// -module A { ; } ->A : typeof A - -module B { ->B : typeof B - - export function f(): A.I { return null; } ->f : () => I ->A : A ->I : I -} - - -=== tests/cases/compiler/A.ts === - -module A { export interface I {} } ->A : typeof A ->I : I - diff --git a/tests/baselines/reference/moduleUnassignedVariable.types b/tests/baselines/reference/moduleUnassignedVariable.types index 7d1dd8600cf..c4eeecbf39f 100644 --- a/tests/baselines/reference/moduleUnassignedVariable.types +++ b/tests/baselines/reference/moduleUnassignedVariable.types @@ -6,14 +6,14 @@ module Bar { >a : number function fooA() { return a; } // Correct: return Bar.a ->fooA : () => number +>fooA : typeof fooA >a : number export var b; >b : any function fooB() { return b; } // Incorrect: return b ->fooB : () => any +>fooB : typeof fooB >b : any } diff --git a/tests/baselines/reference/moduleVisibilityTest1.types b/tests/baselines/reference/moduleVisibilityTest1.types index 0f266892351..3c450978d55 100644 --- a/tests/baselines/reference/moduleVisibilityTest1.types +++ b/tests/baselines/reference/moduleVisibilityTest1.types @@ -5,14 +5,14 @@ module OuterMod { >OuterMod : typeof OuterMod export function someExportedOuterFunc() { return -1; } ->someExportedOuterFunc : () => number +>someExportedOuterFunc : typeof someExportedOuterFunc >-1 : number export module OuterInnerMod { >OuterInnerMod : typeof OuterInnerMod export function someExportedOuterInnerFunc() { return "foo"; } ->someExportedOuterInnerFunc : () => string +>someExportedOuterInnerFunc : typeof someExportedOuterInnerFunc } } @@ -28,7 +28,7 @@ module M { >InnerMod : typeof InnerMod export function someExportedInnerFunc() { return -2; } ->someExportedInnerFunc : () => number +>someExportedInnerFunc : typeof someExportedInnerFunc >-2 : number } @@ -76,23 +76,23 @@ module M { public someMethodThatCallsAnOuterMethod() {return OuterInnerAlias.someExportedOuterInnerFunc();} >someMethodThatCallsAnOuterMethod : () => string >OuterInnerAlias.someExportedOuterInnerFunc() : string ->OuterInnerAlias.someExportedOuterInnerFunc : () => string +>OuterInnerAlias.someExportedOuterInnerFunc : typeof someExportedOuterInnerFunc >OuterInnerAlias : typeof OuterInnerMod ->someExportedOuterInnerFunc : () => string +>someExportedOuterInnerFunc : typeof someExportedOuterInnerFunc public someMethodThatCallsAnInnerMethod() {return InnerMod.someExportedInnerFunc();} >someMethodThatCallsAnInnerMethod : () => number >InnerMod.someExportedInnerFunc() : number ->InnerMod.someExportedInnerFunc : () => number +>InnerMod.someExportedInnerFunc : typeof someExportedInnerFunc >InnerMod : typeof InnerMod ->someExportedInnerFunc : () => number +>someExportedInnerFunc : typeof someExportedInnerFunc public someMethodThatCallsAnOuterInnerMethod() {return OuterMod.someExportedOuterFunc();} >someMethodThatCallsAnOuterInnerMethod : () => number >OuterMod.someExportedOuterFunc() : number ->OuterMod.someExportedOuterFunc : () => number +>OuterMod.someExportedOuterFunc : typeof someExportedOuterFunc >OuterMod : typeof OuterMod ->someExportedOuterFunc : () => number +>someExportedOuterFunc : typeof someExportedOuterFunc public someMethod() { return 0; } >someMethod : () => number @@ -113,7 +113,7 @@ module M { >someModuleVar : number function someModuleFunction() { return 5;} ->someModuleFunction : () => number +>someModuleFunction : typeof someModuleFunction } module M { diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types index 1855f6eb587..2e1860fc2c9 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.types +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.types @@ -47,7 +47,7 @@ module A { >x : number function F(s: string): number { ->F : (s: string) => number +>F : typeof F >s : string return 2; @@ -58,9 +58,7 @@ module A { var fn = (s: string) => { >fn : (s: string) => string ->(s: string) => { - return 'hello ' + s; - } : (s: string) => string +>(s: string) => { return 'hello ' + s; } : (s: string) => string >s : string return 'hello ' + s; @@ -123,7 +121,7 @@ module Y { >x : number export function F(s: string): number { ->F : (s: string) => number +>F : typeof F >s : string return 2; @@ -134,9 +132,7 @@ module Y { export var fn = (s: string) => { >fn : (s: string) => string ->(s: string) => { - return 'hello ' + s; - } : (s: string) => string +>(s: string) => { return 'hello ' + s; } : (s: string) => string >s : string return 'hello ' + s; diff --git a/tests/baselines/reference/multiCallOverloads.types b/tests/baselines/reference/multiCallOverloads.types index 8c789510580..effde837b3c 100644 --- a/tests/baselines/reference/multiCallOverloads.types +++ b/tests/baselines/reference/multiCallOverloads.types @@ -7,7 +7,7 @@ interface ICallback { } function load(f: ICallback) {} ->load : (f: ICallback) => void +>load : typeof load >f : ICallback >ICallback : ICallback @@ -25,22 +25,22 @@ var f2: ICallback = function(z?) {} load(f1) // ok >load(f1) : void ->load : (f: ICallback) => void +>load : typeof load >f1 : ICallback load(f2) // ok >load(f2) : void ->load : (f: ICallback) => void +>load : typeof load >f2 : ICallback load(function() {}) // this shouldn’t be an error >load(function() {}) : void ->load : (f: ICallback) => void +>load : typeof load >function() {} : () => void load(function(z?) {}) // this shouldn't be an error >load(function(z?) {}) : void ->load : (f: ICallback) => void +>load : typeof load >function(z?) {} : (z?: string) => void >z : string diff --git a/tests/baselines/reference/multiImportExport.errors.txt b/tests/baselines/reference/multiImportExport.errors.txt new file mode 100644 index 00000000000..6237131d641 --- /dev/null +++ b/tests/baselines/reference/multiImportExport.errors.txt @@ -0,0 +1,26 @@ +==== tests/cases/compiler/consumer.ts (0 errors) ==== + import Drawing = require('./Drawing'); + var addr = new Drawing.Math.Adder(); + +==== tests/cases/compiler/Drawing.ts (0 errors) ==== + export import Math = require('Math/Math') + +==== tests/cases/compiler/Math/Math.ts (0 errors) ==== + import Adder = require('Math/Adder'); + + var Math = { + Adder:Adder + }; + + export = Math + +==== tests/cases/compiler/Math/Adder.ts (1 errors) ==== + class Adder { + add(a: number, b: number) { + + } + } + + export = Adder; + ~~~~~~~~~~~~~~~ +!!! Cannot compile external modules unless the '--module' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/multiImportExport.js b/tests/baselines/reference/multiImportExport.js deleted file mode 100644 index 06d81f7e984..00000000000 --- a/tests/baselines/reference/multiImportExport.js +++ /dev/null @@ -1,63 +0,0 @@ -//// [tests/cases/compiler/multiImportExport.ts] //// - -//// [consumer.ts] -import Drawing = require('./Drawing'); -var addr = new Drawing.Math.Adder(); - -//// [Drawing.ts] -export import Math = require('Math/Math') - -//// [Math.ts] -import Adder = require('Math/Adder'); - -var Math = { - Adder:Adder -}; - -export = Math - -//// [Adder.ts] -class Adder { - add(a: number, b: number) { - - } -} - -export = Adder; - -//// [Adder.js] -var Adder = (function () { - function Adder() { - } - Adder.prototype.add = function (a, b) { - }; - return Adder; -})(); -module.exports = Adder; -//// [Math.js] -var Adder = require('Math/Adder'); -var Math = { - Adder: Adder -}; -module.exports = Math; -//// [Drawing.js] -exports.Math = require('Math/Math'); -//// [consumer.js] -var Drawing = require('./Drawing'); -var addr = new Drawing.Math.Adder(); - - -//// [Adder.d.ts] -declare class Adder { - add(a: number, b: number): void; -} -export = Adder; -//// [Math.d.ts] -import Adder = require('Math/Adder'); -declare var Math: { - Adder: typeof Adder; -}; -export = Math; -//// [Drawing.d.ts] -export import Math = require('Math/Math'); -//// [consumer.d.ts] diff --git a/tests/baselines/reference/multiImportExport.types b/tests/baselines/reference/multiImportExport.types deleted file mode 100644 index 1504fda69d3..00000000000 --- a/tests/baselines/reference/multiImportExport.types +++ /dev/null @@ -1,51 +0,0 @@ -=== tests/cases/compiler/consumer.ts === -import Drawing = require('./Drawing'); ->Drawing : typeof "tests/cases/compiler/Drawing" - -var addr = new Drawing.Math.Adder(); ->addr : Adder ->new Drawing.Math.Adder() : Adder ->Drawing.Math.Adder : typeof Adder ->Drawing.Math : { Adder: typeof Adder; } ->Drawing : typeof "tests/cases/compiler/Drawing" ->Math : { Adder: typeof Adder; } ->Adder : typeof Adder - -=== tests/cases/compiler/Drawing.ts === -export import Math = require('Math/Math') ->Math : { Adder: typeof Adder; } - -=== tests/cases/compiler/Math/Math.ts === -import Adder = require('Math/Adder'); ->Adder : typeof Adder - -var Math = { ->Math : { Adder: typeof Adder; } ->{ - Adder:Adder -} : { Adder: typeof Adder; } - - Adder:Adder ->Adder : typeof Adder ->Adder : Adder - -}; - -export = Math ->Math : { Adder: typeof Adder; } - -=== tests/cases/compiler/Math/Adder.ts === -class Adder { ->Adder : Adder - - add(a: number, b: number) { ->add : (a: number, b: number) => void ->a : number ->b : number - - } -} - -export = Adder; ->Adder : Adder - diff --git a/tests/baselines/reference/multiModuleClodule1.types b/tests/baselines/reference/multiModuleClodule1.types index f7379e33173..6d1b7b600a9 100644 --- a/tests/baselines/reference/multiModuleClodule1.types +++ b/tests/baselines/reference/multiModuleClodule1.types @@ -12,7 +12,7 @@ class C { >bar : () => void static boo() { } ->boo : () => void +>boo : typeof boo } module C { @@ -28,10 +28,10 @@ module C { >C : typeof C export function foo() { } ->foo : () => void +>foo : typeof foo function baz() { return ''; } ->baz : () => string +>baz : typeof baz } var c = new C(C.x); @@ -43,11 +43,11 @@ var c = new C(C.x); >x : number c.foo = C.foo; ->c.foo = C.foo : () => void +>c.foo = C.foo : typeof foo >c.foo : () => void >c : C >foo : () => void ->C.foo : () => void +>C.foo : typeof foo >C : typeof C ->foo : () => void +>foo : typeof foo diff --git a/tests/baselines/reference/multiModuleFundule1.types b/tests/baselines/reference/multiModuleFundule1.types index c78a195f4b1..1e6f125fd3e 100644 --- a/tests/baselines/reference/multiModuleFundule1.types +++ b/tests/baselines/reference/multiModuleFundule1.types @@ -13,7 +13,7 @@ module C { >C : typeof C export function foo() { } ->foo : () => void +>foo : typeof foo } var r = C(2); @@ -29,7 +29,7 @@ var r2 = new C(2); // using void returning function as constructor var r3 = C.foo(); >r3 : void >C.foo() : void ->C.foo : () => void +>C.foo : typeof foo >C : typeof C ->foo : () => void +>foo : typeof foo diff --git a/tests/baselines/reference/mutrec.types b/tests/baselines/reference/mutrec.types index 6c147174484..602c6209be7 100644 --- a/tests/baselines/reference/mutrec.types +++ b/tests/baselines/reference/mutrec.types @@ -16,7 +16,7 @@ interface B { } function f(p: A) { return p }; ->f : (p: A) => A +>f : typeof f >p : A >A : A >p : A @@ -27,7 +27,7 @@ var b:B; f(b); >f(b) : A ->f : (p: A) => A +>f : typeof f >b : B interface I1 { @@ -55,7 +55,7 @@ interface I3 { } function g(p: I1) { return p }; ->g : (p: I1) => I1 +>g : typeof g >p : I1 >I1 : I1 >p : I1 @@ -66,7 +66,7 @@ var i2:I2; g(i2); >g(i2) : I1 ->g : (p: I1) => I1 +>g : typeof g >i2 : I2 var i3:I3; @@ -75,7 +75,7 @@ var i3:I3; g(i3); >g(i3) : I1 ->g : (p: I1) => I1 +>g : typeof g >i3 : I3 interface I4 { @@ -100,7 +100,7 @@ var i4:I4; g(i4); >g(i4) : I1 ->g : (p: I1) => I1 +>g : typeof g >i4 : I4 diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.js b/tests/baselines/reference/nameCollisionsInPropertyAssignments.js deleted file mode 100644 index 3035ab6e628..00000000000 --- a/tests/baselines/reference/nameCollisionsInPropertyAssignments.js +++ /dev/null @@ -1,9 +0,0 @@ -//// [nameCollisionsInPropertyAssignments.ts] -var x = 1 -var y = { x() { x++; } }; - -//// [nameCollisionsInPropertyAssignments.js] -var x = 1; -var y = { x: function () { - x++; -} }; diff --git a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types b/tests/baselines/reference/nameCollisionsInPropertyAssignments.types deleted file mode 100644 index 1628b673621..00000000000 --- a/tests/baselines/reference/nameCollisionsInPropertyAssignments.types +++ /dev/null @@ -1,12 +0,0 @@ -=== tests/cases/compiler/nameCollisionsInPropertyAssignments.ts === -var x = 1 ->x : number - -var y = { x() { x++; } }; ->y : { x: () => void; } ->{ x() { x++; } } : { x: () => void; } ->x : () => void ->x() { x++; } : () => void ->x++ : number ->x : number - diff --git a/tests/baselines/reference/nameWithRelativePaths.types b/tests/baselines/reference/nameWithRelativePaths.types index c20c4bc152d..4e438711548 100644 --- a/tests/baselines/reference/nameWithRelativePaths.types +++ b/tests/baselines/reference/nameWithRelativePaths.types @@ -22,9 +22,9 @@ if(foo2.M2.x){ >foo0 : typeof "tests/cases/conformance/externalModules/foo_0" >foo : number >foo1.f() : number ->foo1.f : () => number +>foo1.f : typeof f >foo1 : typeof "tests/cases/conformance/externalModules/test/test/foo_1" ->f : () => number +>f : typeof f } === tests/cases/conformance/externalModules/foo_0.ts === @@ -33,7 +33,7 @@ export var foo = 42; === tests/cases/conformance/externalModules/test/test/foo_1.ts === export function f(){ ->f : () => number +>f : typeof f return 42; } diff --git a/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.types b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.types index 870734b0c6e..49ba563379e 100644 --- a/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.types +++ b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.types @@ -4,9 +4,7 @@ class Foo{ a = function bar(){ >a : () => void ->function bar(){ - - } : () => void +>function bar(){ } : () => void >bar : () => void }; // this shouldn't crash the compiler... diff --git a/tests/baselines/reference/namedFunctionExpressionCall.types b/tests/baselines/reference/namedFunctionExpressionCall.types index 2f36c07f7d7..018cf64afcd 100644 --- a/tests/baselines/reference/namedFunctionExpressionCall.types +++ b/tests/baselines/reference/namedFunctionExpressionCall.types @@ -1,13 +1,7 @@ === tests/cases/compiler/namedFunctionExpressionCall.ts === var recurser = function foo() { >recurser : any ->function foo() { - // using the local name - foo(); - - // using the globally visible name - recurser(); -} : () => void +>function foo() { // using the local name foo(); // using the globally visible name recurser();} : () => void >foo : () => void // using the local name @@ -24,12 +18,8 @@ var recurser = function foo() { (function bar() { ->(function bar() { - bar(); -}) : () => void ->function bar() { - bar(); -} : () => void +>(function bar() { bar();}) : () => void +>function bar() { bar();} : () => void >bar : () => void bar(); diff --git a/tests/baselines/reference/namedFunctionExpressionInModule.types b/tests/baselines/reference/namedFunctionExpressionInModule.types index 4898b2cbc1e..9643d9ca069 100644 --- a/tests/baselines/reference/namedFunctionExpressionInModule.types +++ b/tests/baselines/reference/namedFunctionExpressionInModule.types @@ -4,8 +4,7 @@ module Variables{ var x = function bar(a, b, c) { >x : (a: any, b: any, c: any) => void ->function bar(a, b, c) { - } : (a: any, b: any, c: any) => void +>function bar(a, b, c) { } : (a: any, b: any, c: any) => void >bar : (a: any, b: any, c: any) => void >a : any >b : any diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.types b/tests/baselines/reference/negateOperatorWithAnyOtherType.types index 8785ab073b2..a44027aefc3 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.types +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.types @@ -22,7 +22,7 @@ var obj1 = { x: "", y: () => { }}; >() => { } : () => void function foo(): any { ->foo : () => any +>foo : typeof foo var a; >a : any @@ -37,7 +37,7 @@ class A { >a : any static foo() { ->foo : () => any +>foo : typeof foo var a; >a : any @@ -137,15 +137,15 @@ var ResultIsNumber13 = -foo(); >ResultIsNumber13 : number >-foo() : number >foo() : any ->foo : () => any +>foo : typeof foo var ResultIsNumber14 = -A.foo(); >ResultIsNumber14 : number >-A.foo() : number >A.foo() : any ->A.foo : () => any +>A.foo : typeof foo >A : typeof A ->foo : () => any +>foo : typeof foo var ResultIsNumber15 = -(ANY - ANY1); >ResultIsNumber15 : number diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.types b/tests/baselines/reference/negateOperatorWithBooleanType.types index 49467d87845..41d993b64ca 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.types +++ b/tests/baselines/reference/negateOperatorWithBooleanType.types @@ -4,7 +4,7 @@ var BOOLEAN: boolean; >BOOLEAN : boolean function foo(): boolean { return true; } ->foo : () => boolean +>foo : typeof foo class A { >A : A @@ -13,7 +13,7 @@ class A { >a : boolean static foo() { return false; } ->foo : () => boolean +>foo : typeof foo } module M { >M : typeof M @@ -64,15 +64,15 @@ var ResultIsNumber6 = -foo(); >ResultIsNumber6 : number >-foo() : number >foo() : boolean ->foo : () => boolean +>foo : typeof foo var ResultIsNumber7 = -A.foo(); >ResultIsNumber7 : number >-A.foo() : number >A.foo() : boolean ->A.foo : () => boolean +>A.foo : typeof foo >A : typeof A ->foo : () => boolean +>foo : typeof foo // miss assignment operators -true; @@ -85,7 +85,7 @@ var ResultIsNumber7 = -A.foo(); -foo(); >-foo() : number >foo() : boolean ->foo : () => boolean +>foo : typeof foo -true, false; >-true, false : boolean diff --git a/tests/baselines/reference/negateOperatorWithNumberType.types b/tests/baselines/reference/negateOperatorWithNumberType.types index f6cee89f6df..f6c60179f5e 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.types +++ b/tests/baselines/reference/negateOperatorWithNumberType.types @@ -8,7 +8,7 @@ var NUMBER1: number[] = [1, 2]; >[1, 2] : number[] function foo(): number { return 1; } ->foo : () => number +>foo : typeof foo class A { >A : A @@ -17,7 +17,7 @@ class A { >a : number static foo() { return 1; } ->foo : () => number +>foo : typeof foo } module M { >M : typeof M @@ -89,15 +89,15 @@ var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number >-foo() : number >foo() : number ->foo : () => number +>foo : typeof foo var ResultIsNumber10 = -A.foo(); >ResultIsNumber10 : number >-A.foo() : number >A.foo() : number ->A.foo : () => number +>A.foo : typeof foo >A : typeof A ->foo : () => number +>foo : typeof foo var ResultIsNumber11 = -(NUMBER - NUMBER); >ResultIsNumber11 : number @@ -122,7 +122,7 @@ var ResultIsNumber11 = -(NUMBER - NUMBER); -foo(); >-foo() : number >foo() : number ->foo : () => number +>foo : typeof foo -objA.a; >-objA.a : number diff --git a/tests/baselines/reference/negateOperatorWithStringType.types b/tests/baselines/reference/negateOperatorWithStringType.types index 43a9f05cc5b..5baec327f8e 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.types +++ b/tests/baselines/reference/negateOperatorWithStringType.types @@ -8,7 +8,7 @@ var STRING1: string[] = ["", "abc"]; >["", "abc"] : string[] function foo(): string { return "abc"; } ->foo : () => string +>foo : typeof foo class A { >A : A @@ -17,7 +17,7 @@ class A { >a : string static foo() { return ""; } ->foo : () => string +>foo : typeof foo } module M { >M : typeof M @@ -89,15 +89,15 @@ var ResultIsNumber9 = -foo(); >ResultIsNumber9 : number >-foo() : number >foo() : string ->foo : () => string +>foo : typeof foo var ResultIsNumber10 = -A.foo(); >ResultIsNumber10 : number >-A.foo() : number >A.foo() : string ->A.foo : () => string +>A.foo : typeof foo >A : typeof A ->foo : () => string +>foo : typeof foo var ResultIsNumber11 = -(STRING + STRING); >ResultIsNumber11 : number @@ -130,7 +130,7 @@ var ResultIsNumber12 = -STRING.charAt(0); -foo(); >-foo() : number >foo() : string ->foo : () => string +>foo : typeof foo -objA.a,M.n; >-objA.a,M.n : string diff --git a/tests/baselines/reference/nestedIndexer.types b/tests/baselines/reference/nestedIndexer.types index 612f6a260b7..5511f322fd7 100644 --- a/tests/baselines/reference/nestedIndexer.types +++ b/tests/baselines/reference/nestedIndexer.types @@ -1,6 +1,6 @@ === tests/cases/compiler/nestedIndexer.ts === function then(x) { ->then : (x: any) => void +>then : typeof then >x : any var match: { [index: number]: string; } diff --git a/tests/baselines/reference/nestedRecursiveLambda.types b/tests/baselines/reference/nestedRecursiveLambda.types index 358ebda8abf..160204cb772 100644 --- a/tests/baselines/reference/nestedRecursiveLambda.types +++ b/tests/baselines/reference/nestedRecursiveLambda.types @@ -1,6 +1,6 @@ === tests/cases/compiler/nestedRecursiveLambda.ts === function f(a:any) { ->f : (a: any) => void +>f : typeof f >a : any void (r =>(r => r)); @@ -15,7 +15,7 @@ void (r =>(r => r)); } f((r =>(r => r))); >f((r =>(r => r))) : void ->f : (a: any) => void +>f : typeof f >(r =>(r => r)) : (r: any) => (r: any) => any >r =>(r => r) : (r: any) => (r: any) => any >r : any diff --git a/tests/baselines/reference/newOperatorConformance.types b/tests/baselines/reference/newOperatorConformance.types index 37205bd6177..266aa89086e 100644 --- a/tests/baselines/reference/newOperatorConformance.types +++ b/tests/baselines/reference/newOperatorConformance.types @@ -84,7 +84,7 @@ var d = new anyCtor1(undefined); // Construct expression of type where apparent type has a construct signature with 0 arguments function newFn1(s: T) { ->newFn1 : number>(s: T) => void +>newFn1 : typeof newFn1 >T : T >s : T >T : T @@ -100,7 +100,7 @@ function newFn1(s: T) { // Construct expression of type where apparent type has a construct signature with 1 arguments function newFn2(s: T) { ->newFn2 : string>(s: T) => void +>newFn2 : typeof newFn2 >T : T >s : number >s : T @@ -117,12 +117,12 @@ function newFn2(s: T) { // Construct expression of void returning function function fnVoid(): void { } ->fnVoid : () => void +>fnVoid : typeof fnVoid var t = new fnVoid(); >t : any >new fnVoid() : any ->fnVoid : () => void +>fnVoid : typeof fnVoid var t: any; >t : any diff --git a/tests/baselines/reference/noCatchBlock.js b/tests/baselines/reference/noCatchBlock.js deleted file mode 100644 index 7b0404c3cad..00000000000 --- a/tests/baselines/reference/noCatchBlock.js +++ /dev/null @@ -1,14 +0,0 @@ -//// [noCatchBlock.ts] - -try { - // ... -} finally { - // N.B. No 'catch' block -} - -//// [noCatchBlock.js] -try { -} -finally { -} -//# sourceMappingURL=noCatchBlock.js.map \ No newline at end of file diff --git a/tests/baselines/reference/noCatchBlock.js.map b/tests/baselines/reference/noCatchBlock.js.map deleted file mode 100644 index dccc7798c92..00000000000 --- a/tests/baselines/reference/noCatchBlock.js.map +++ /dev/null @@ -1,2 +0,0 @@ -//// [noCatchBlock.js.map] -{"version":3,"file":"noCatchBlock.js","sourceRoot":"","sources":["noCatchBlock.ts"],"names":[],"mappings":"AACA,IAAA,CAAC;AAED,CAAC;QAAC,CAAC;AAEH,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/noCatchBlock.sourcemap.txt b/tests/baselines/reference/noCatchBlock.sourcemap.txt deleted file mode 100644 index 8d5a67339f6..00000000000 --- a/tests/baselines/reference/noCatchBlock.sourcemap.txt +++ /dev/null @@ -1,53 +0,0 @@ -=================================================================== -JsFile: noCatchBlock.js -mapUrl: noCatchBlock.js.map -sourceRoot: -sources: noCatchBlock.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:tests/cases/compiler/noCatchBlock.js -sourceFile:noCatchBlock.ts -------------------------------------------------------------------- ->>>try { -1 > -2 >^^^^ -3 > ^ -1 > - > -2 > -3 > t -1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(1, 5) Source(2, 1) + SourceIndex(0) -3 >Emitted(1, 6) Source(2, 2) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^-> -1 >ry { - > // ... - > -2 >} -1 >Emitted(2, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(2, 2) Source(4, 2) + SourceIndex(0) ---- ->>>finally { -1->^^^^^^^^ -2 > ^ -1-> -2 > f -1->Emitted(3, 9) Source(4, 3) + SourceIndex(0) -2 >Emitted(3, 10) Source(4, 4) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 >inally { - > // N.B. No 'catch' block - > -2 >} -1 >Emitted(4, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(6, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=noCatchBlock.js.map \ No newline at end of file diff --git a/tests/baselines/reference/noCatchBlock.types b/tests/baselines/reference/noCatchBlock.types deleted file mode 100644 index cf7689660a3..00000000000 --- a/tests/baselines/reference/noCatchBlock.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/compiler/noCatchBlock.ts === - -No type information for this code.try { -No type information for this code. // ... -No type information for this code.} finally { -No type information for this code. // N.B. No 'catch' block -No type information for this code.} -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types index b41f5cd6074..f9537974161 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInConstructor.types @@ -5,24 +5,13 @@ class class1 { constructor() { var x2 = { >x2 : { doStuff: (callback: any) => () => any; } ->{ - doStuff: (callback) => () => { - var _this = 2; - return callback(_this); - } - } : { doStuff: (callback: any) => () => any; } +>{ doStuff: (callback) => () => { var _this = 2; return callback(_this); } } : { doStuff: (callback: any) => () => any; } doStuff: (callback) => () => { >doStuff : (callback: any) => () => any ->(callback) => () => { - var _this = 2; - return callback(_this); - } : (callback: any) => () => any +>(callback) => () => { var _this = 2; return callback(_this); } : (callback: any) => () => any >callback : any ->() => { - var _this = 2; - return callback(_this); - } : () => any +>() => { var _this = 2; return callback(_this); } : () => any var _this = 2; >_this : number @@ -45,21 +34,13 @@ class class2 { var x2 = { >x2 : { doStuff: (callback: any) => () => any; } ->{ - doStuff: (callback) => () => { - return callback(_this); - } - } : { doStuff: (callback: any) => () => any; } +>{ doStuff: (callback) => () => { return callback(_this); } } : { doStuff: (callback: any) => () => any; } doStuff: (callback) => () => { >doStuff : (callback: any) => () => any ->(callback) => () => { - return callback(_this); - } : (callback: any) => () => any +>(callback) => () => { return callback(_this); } : (callback: any) => () => any >callback : any ->() => { - return callback(_this); - } : () => any +>() => { return callback(_this); } : () => any return callback(_this); >callback(_this) : any diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types index 56f5701e912..daeee8e1864 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInFunction.types @@ -7,7 +7,7 @@ var console: { >val : any } function x() { ->x : () => void +>x : typeof x var _this = 5; >_this : number diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types index a8e7a622366..c67508c16d7 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types @@ -1,28 +1,17 @@ === tests/cases/compiler/noCollisionThisExpressionAndLocalVarInLambda.ts === declare function alert(message?: any): void; ->alert : (message?: any) => void +>alert : typeof alert >message : any var x = { >x : { doStuff: (callback: any) => () => any; } ->{ - doStuff: (callback) => () => { - var _this = 2; - return callback(_this); - } -} : { doStuff: (callback: any) => () => any; } +>{ doStuff: (callback) => () => { var _this = 2; return callback(_this); }} : { doStuff: (callback: any) => () => any; } doStuff: (callback) => () => { >doStuff : (callback: any) => () => any ->(callback) => () => { - var _this = 2; - return callback(_this); - } : (callback: any) => () => any +>(callback) => () => { var _this = 2; return callback(_this); } : (callback: any) => () => any >callback : any ->() => { - var _this = 2; - return callback(_this); - } : () => any +>() => { var _this = 2; return callback(_this); } : () => any var _this = 2; >_this : number @@ -35,7 +24,7 @@ var x = { } alert(x.doStuff(x => alert(x))); >alert(x.doStuff(x => alert(x))) : void ->alert : (message?: any) => void +>alert : typeof alert >x.doStuff(x => alert(x)) : () => any >x.doStuff : (callback: any) => () => any >x : { doStuff: (callback: any) => () => any; } @@ -43,6 +32,6 @@ alert(x.doStuff(x => alert(x))); >x => alert(x) : (x: any) => void >x : any >alert(x) : void ->alert : (message?: any) => void +>alert : typeof alert >x : any diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types index b08ce3e57c1..cb543b33ad4 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInMethod.types @@ -9,24 +9,13 @@ class a { >method1 : () => { doStuff: (callback: any) => () => any; } return { ->{ - doStuff: (callback) => () => { - var _this = 2; - return callback(_this); - } - } : { doStuff: (callback: any) => () => any; } +>{ doStuff: (callback) => () => { var _this = 2; return callback(_this); } } : { doStuff: (callback: any) => () => any; } doStuff: (callback) => () => { >doStuff : (callback: any) => () => any ->(callback) => () => { - var _this = 2; - return callback(_this); - } : (callback: any) => () => any +>(callback) => () => { var _this = 2; return callback(_this); } : (callback: any) => () => any >callback : any ->() => { - var _this = 2; - return callback(_this); - } : () => any +>() => { var _this = 2; return callback(_this); } : () => any var _this = 2; >_this : number @@ -45,21 +34,13 @@ class a { >_this : number return { ->{ - doStuff: (callback) => () => { - return callback(_this); - } - } : { doStuff: (callback: any) => () => any; } +>{ doStuff: (callback) => () => { return callback(_this); } } : { doStuff: (callback: any) => () => any; } doStuff: (callback) => () => { >doStuff : (callback: any) => () => any ->(callback) => () => { - return callback(_this); - } : (callback: any) => () => any +>(callback) => () => { return callback(_this); } : (callback: any) => () => any >callback : any ->() => { - return callback(_this); - } : () => any +>() => { return callback(_this); } : () => any return callback(_this); >callback(_this) : any diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types index 3ab8c345887..df4ad5113f2 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInProperty.types @@ -4,24 +4,13 @@ class class1 { public prop1 = { >prop1 : { doStuff: (callback: any) => () => any; } ->{ - doStuff: (callback) => () => { - var _this = 2; - return callback(_this); - } - } : { doStuff: (callback: any) => () => any; } +>{ doStuff: (callback) => () => { var _this = 2; return callback(_this); } } : { doStuff: (callback: any) => () => any; } doStuff: (callback) => () => { >doStuff : (callback: any) => () => any ->(callback) => () => { - var _this = 2; - return callback(_this); - } : (callback: any) => () => any +>(callback) => () => { var _this = 2; return callback(_this); } : (callback: any) => () => any >callback : any ->() => { - var _this = 2; - return callback(_this); - } : () => any +>() => { var _this = 2; return callback(_this); } : () => any var _this = 2; >_this : number @@ -43,21 +32,13 @@ class class2 { } public prop1 = { >prop1 : { doStuff: (callback: any) => () => any; } ->{ - doStuff: (callback) => () => { - return callback(10); - } - } : { doStuff: (callback: any) => () => any; } +>{ doStuff: (callback) => () => { return callback(10); } } : { doStuff: (callback: any) => () => any; } doStuff: (callback) => () => { >doStuff : (callback: any) => () => any ->(callback) => () => { - return callback(10); - } : (callback: any) => () => any +>(callback) => () => { return callback(10); } : (callback: any) => () => any >callback : any ->() => { - return callback(10); - } : () => any +>() => { return callback(10); } : () => any return callback(10); >callback(10) : any diff --git a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types index 35a62c6f671..1413afd3938 100644 --- a/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types +++ b/tests/baselines/reference/noCollisionThisExpressionInFunctionAndVarInGlobal.types @@ -10,7 +10,7 @@ var _this = 5; >_this : number function x() { ->x : () => void +>x : typeof x x => { console.log(this); }; >x => { console.log(this); } : (x: any) => void diff --git a/tests/baselines/reference/noConstraintInReturnType1.types b/tests/baselines/reference/noConstraintInReturnType1.types index 19a7529ac79..45927b22d1e 100644 --- a/tests/baselines/reference/noConstraintInReturnType1.types +++ b/tests/baselines/reference/noConstraintInReturnType1.types @@ -4,7 +4,7 @@ class List { >T : T static empty(): List { return null; } ->empty : () => List +>empty : typeof empty >T : T >List : List >T : T diff --git a/tests/baselines/reference/noImplicitAnyForIn.errors.txt b/tests/baselines/reference/noImplicitAnyForIn.errors.txt deleted file mode 100644 index 7e4122a8f26..00000000000 --- a/tests/baselines/reference/noImplicitAnyForIn.errors.txt +++ /dev/null @@ -1,42 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyForIn.ts (5 errors) ==== - - var x: {}[] = [[1, 2, 3], ["hello"]]; - - for (var i in x) { - for (var j in x[i]) { - - //Should yield an implicit 'any' error - var _j = x[i][j]; - ~~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. - } - - for (var k in x[0]) { - var k1 = x[0]; - - //Should yield an implicit 'any' error - var k2 = k1[k]; - ~~~~~ -!!! Index signature of object type implicitly has an 'any' type. - } - } - - for (var a in x) { - // Should yield an implicit 'any' error. - var b; - ~ -!!! Variable 'b' implicitly has an 'any' type. - - var c = a || b; - } - - var idx = 0; - var m = [1, 2, 3, 4, 5]; - // Should yield an implicit 'any' error. - var n = [[]] || []; - ~ -!!! Variable 'n' implicitly has an 'any[][]' type. - - for (n[idx++] in m); - ~~~~~~~~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyIndexing.errors.txt b/tests/baselines/reference/noImplicitAnyIndexing.errors.txt deleted file mode 100644 index 857809c3e84..00000000000 --- a/tests/baselines/reference/noImplicitAnyIndexing.errors.txt +++ /dev/null @@ -1,58 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyIndexing.ts (4 errors) ==== - - enum MyEmusEnum { - emu - } - - // Should be okay; should be a string. - var strRepresentation1 = MyEmusEnum[0] - - // Should be okay; should be a string. - var strRepresentation2 = MyEmusEnum[MyEmusEnum.emu] - - // Should be implicit 'any' ; property access fails, no string indexer. - var strRepresentation3 = MyEmusEnum["monehh"]; - ~~~~~~~~~~~~~~~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. - - // Should be okay; should be a MyEmusEnum - var strRepresentation4 = MyEmusEnum["emu"]; - - - // Should report an implicit 'any'. - var x = {}["hi"]; - ~~~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. - - // Should report an implicit 'any'. - var y = {}[10]; - ~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. - - - var hi: any = "hi"; - - var emptyObj = {}; - - // Should report an implicit 'any'. - var z1 = emptyObj[hi]; - ~~~~~~~~~~~~ -!!! Index signature of object type implicitly has an 'any' type. - var z2 = (emptyObj)[hi]; - - interface MyMap { - [key: string]: T; - } - - var m: MyMap = { - "0": 0, - "1": 1, - "2": 2, - "Okay that's enough for today.": NaN - }; - - var mResult1 = m[MyEmusEnum.emu]; - var mResult2 = m[MyEmusEnum[MyEmusEnum.emu]]; - var mResult3 = m[hi]; - - \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt deleted file mode 100644 index d81e3e38404..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.errors.txt +++ /dev/null @@ -1,155 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyParametersInAmbientClass.ts (31 errors) ==== - - declare class D_C { - // No implicit-'any' errors. - public pub_f1(): void; - - // Implicit-'any' errors for x. - public pub_f2(x): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // No implicit-'any' errors. - public pub_f3(x: any): void; - - // Implicit-'any' errors for x, y, and z. - public pub_f4(x, y, z): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x, and z. - public pub_f5(x, y: any, z): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' errors for r. - public pub_f6(...r): void; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - public pub_f7(x, ...r): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any' errors for x1, y2, x3, and y3. - public pub_f8(x1, y1: number): any; - ~~ -!!! Parameter 'x1' implicitly has an 'any' type. - public pub_f8(x2: string, y2): any; - ~~ -!!! Parameter 'y2' implicitly has an 'any' type. - public pub_f8(x3, y3): any; - ~~ -!!! Parameter 'x3' implicitly has an 'any' type. - ~~ -!!! Parameter 'y3' implicitly has an 'any' type. - - // No implicit-'any' errors. - public pub_f9: () => string; - - // Implicit-'any' error for x. - public pub_f10: (x) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // Implicit-'any' errors for x, y, and z. - public pub_f11: (x, y, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x and z. - public pub_f12: (x, y: any, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' error for r. - public pub_f13: (...r) => string; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - public pub_f14: (x, ...r) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - /////////////////////////////////////////// - - // No implicit-'any' errors. - private priv_f1(): void; - - // No implicit-'any' errors. - private priv_f2(x): void; - - // No implicit-'any' errors. - private priv_f3(x: any): void; - - // No implicit-'any' errors. - private priv_f4(x, y, z): void; - - // No implicit-'any' errors. - private priv_f5(x, y: any, z): void; - - // No implicit-'any' errors. - private priv_f6(...r): void; - - // No implicit-'any' errors. - private priv_f7(x, ...r): void; - - // No implicit-'any' errors. - private priv_f8(x1, y1: number): any; - private priv_f8(x2: string, y2): any; - private priv_f8(x3, y3): any; - - // No implicit-'any' errors. - private priv_f9: () => string; - - // Implicit-'any' error for x. - private priv_f10: (x) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // Implicit-'any' errors for x, y, and z. - private priv_f11: (x, y, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x and z. - private priv_f12: (x, y: any, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' error for r. - private priv_f13: (...r) => string; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - private priv_f14: (x, ...r) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.js b/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.js deleted file mode 100644 index 4af0a8c74a3..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientClass.js +++ /dev/null @@ -1,95 +0,0 @@ -//// [noImplicitAnyParametersInAmbientClass.ts] - -declare class D_C { - // No implicit-'any' errors. - public pub_f1(): void; - - // Implicit-'any' errors for x. - public pub_f2(x): void; - - // No implicit-'any' errors. - public pub_f3(x: any): void; - - // Implicit-'any' errors for x, y, and z. - public pub_f4(x, y, z): void; - - // Implicit-'any' errors for x, and z. - public pub_f5(x, y: any, z): void; - - // Implicit-'any[]' errors for r. - public pub_f6(...r): void; - - // Implicit-'any'/'any[]' errors for x, r. - public pub_f7(x, ...r): void; - - // Implicit-'any' errors for x1, y2, x3, and y3. - public pub_f8(x1, y1: number): any; - public pub_f8(x2: string, y2): any; - public pub_f8(x3, y3): any; - - // No implicit-'any' errors. - public pub_f9: () => string; - - // Implicit-'any' error for x. - public pub_f10: (x) => string; - - // Implicit-'any' errors for x, y, and z. - public pub_f11: (x, y, z) => string; - - // Implicit-'any' errors for x and z. - public pub_f12: (x, y: any, z) => string; - - // Implicit-'any[]' error for r. - public pub_f13: (...r) => string; - - // Implicit-'any'/'any[]' errors for x, r. - public pub_f14: (x, ...r) => string; - - /////////////////////////////////////////// - - // No implicit-'any' errors. - private priv_f1(): void; - - // No implicit-'any' errors. - private priv_f2(x): void; - - // No implicit-'any' errors. - private priv_f3(x: any): void; - - // No implicit-'any' errors. - private priv_f4(x, y, z): void; - - // No implicit-'any' errors. - private priv_f5(x, y: any, z): void; - - // No implicit-'any' errors. - private priv_f6(...r): void; - - // No implicit-'any' errors. - private priv_f7(x, ...r): void; - - // No implicit-'any' errors. - private priv_f8(x1, y1: number): any; - private priv_f8(x2: string, y2): any; - private priv_f8(x3, y3): any; - - // No implicit-'any' errors. - private priv_f9: () => string; - - // Implicit-'any' error for x. - private priv_f10: (x) => string; - - // Implicit-'any' errors for x, y, and z. - private priv_f11: (x, y, z) => string; - - // Implicit-'any' errors for x and z. - private priv_f12: (x, y: any, z) => string; - - // Implicit-'any[]' error for r. - private priv_f13: (...r) => string; - - // Implicit-'any'/'any[]' errors for x, r. - private priv_f14: (x, ...r) => string; -} - -//// [noImplicitAnyParametersInAmbientClass.js] diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt deleted file mode 100644 index 905ea1ac9f0..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.errors.txt +++ /dev/null @@ -1,89 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyParametersInAmbientFunctions.ts (22 errors) ==== - - // No implicit-'any' errors. - declare function d_f1(): void; - - // Implicit-'any' errors for x. - declare function d_f2(x): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // No implicit-'any' errors. - declare function d_f3(x: any): void; - - // Implicit-'any' errors for x, y, and z. - declare function d_f4(x, y, z): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x, and z. - declare function d_f5(x, y: any, z): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' errors for r. - declare function d_f6(...r): void; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - declare function d_f7(x, ...r): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any' errors for x1, y2, x3, and y3. - declare function d_f8(x1, y1: number): any; - ~~ -!!! Parameter 'x1' implicitly has an 'any' type. - declare function d_f8(x2: string, y2): any; - ~~ -!!! Parameter 'y2' implicitly has an 'any' type. - declare function d_f8(x3, y3): any; - ~~ -!!! Parameter 'x3' implicitly has an 'any' type. - ~~ -!!! Parameter 'y3' implicitly has an 'any' type. - - // No implicit-'any' errors. - declare var d_f9: () => string; - - // Implicit-'any' error for x. - declare var d_f10: (x) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // Implicit-'any' errors for x, y, and z. - declare var d_f11: (x, y, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x and z. - declare var d_f12: (x, y: any, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' error for r. - declare var d_f13: (...r) => string; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - declare var d_f14: (x, ...r) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.js b/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.js deleted file mode 100644 index 3e825c2b24f..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientFunctions.js +++ /dev/null @@ -1,47 +0,0 @@ -//// [noImplicitAnyParametersInAmbientFunctions.ts] - -// No implicit-'any' errors. -declare function d_f1(): void; - -// Implicit-'any' errors for x. -declare function d_f2(x): void; - -// No implicit-'any' errors. -declare function d_f3(x: any): void; - -// Implicit-'any' errors for x, y, and z. -declare function d_f4(x, y, z): void; - -// Implicit-'any' errors for x, and z. -declare function d_f5(x, y: any, z): void; - -// Implicit-'any[]' errors for r. -declare function d_f6(...r): void; - -// Implicit-'any'/'any[]' errors for x, r. -declare function d_f7(x, ...r): void; - -// Implicit-'any' errors for x1, y2, x3, and y3. -declare function d_f8(x1, y1: number): any; -declare function d_f8(x2: string, y2): any; -declare function d_f8(x3, y3): any; - -// No implicit-'any' errors. -declare var d_f9: () => string; - -// Implicit-'any' error for x. -declare var d_f10: (x) => string; - -// Implicit-'any' errors for x, y, and z. -declare var d_f11: (x, y, z) => string; - -// Implicit-'any' errors for x and z. -declare var d_f12: (x, y: any, z) => string; - -// Implicit-'any[]' error for r. -declare var d_f13: (...r) => string; - -// Implicit-'any'/'any[]' errors for x, r. -declare var d_f14: (x, ...r) => string; - -//// [noImplicitAnyParametersInAmbientFunctions.js] diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt deleted file mode 100644 index 99779ab7697..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.errors.txt +++ /dev/null @@ -1,91 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyParametersInAmbientModule.ts (22 errors) ==== - - declare module D_M { - // No implicit-'any' errors. - function dm_f1(): void; - - // No implicit-'any' errors. - function dm_f2(x): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // No implicit-'any' errors. - function dm_f3(x: any): void; - - // No implicit-'any' errors. - function dm_f4(x, y, z): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // No implicit-'any' errors. - function dm_f5(x, y: any, z): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // No implicit-'any' errors. - function dm_f6(...r): void; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // No implicit-'any' errors. - function dm_f7(x, ...r): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // No implicit-'any' errors. - function dm_f8(x1, y1: number): any; - ~~ -!!! Parameter 'x1' implicitly has an 'any' type. - function dm_f8(x2: string, y2): any; - ~~ -!!! Parameter 'y2' implicitly has an 'any' type. - function dm_f8(x3, y3): any; - ~~ -!!! Parameter 'x3' implicitly has an 'any' type. - ~~ -!!! Parameter 'y3' implicitly has an 'any' type. - - // No implicit-'any' errors. - var dm_f9: () => string; - - // No implicit-'any' errors. - var dm_f10: (x) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // No implicit-'any' errors. - var dm_f11: (x, y, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // No implicit-'any' errors. - var dm_f12: (x, y: any, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // No implicit-'any' errors. - var dm_f13: (...r) => string; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // No implicit-'any' errors. - var dm_f14: (x, ...r) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.js b/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.js deleted file mode 100644 index d35cbe9d9d4..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInAmbientModule.js +++ /dev/null @@ -1,49 +0,0 @@ -//// [noImplicitAnyParametersInAmbientModule.ts] - -declare module D_M { - // No implicit-'any' errors. - function dm_f1(): void; - - // No implicit-'any' errors. - function dm_f2(x): void; - - // No implicit-'any' errors. - function dm_f3(x: any): void; - - // No implicit-'any' errors. - function dm_f4(x, y, z): void; - - // No implicit-'any' errors. - function dm_f5(x, y: any, z): void; - - // No implicit-'any' errors. - function dm_f6(...r): void; - - // No implicit-'any' errors. - function dm_f7(x, ...r): void; - - // No implicit-'any' errors. - function dm_f8(x1, y1: number): any; - function dm_f8(x2: string, y2): any; - function dm_f8(x3, y3): any; - - // No implicit-'any' errors. - var dm_f9: () => string; - - // No implicit-'any' errors. - var dm_f10: (x) => string; - - // No implicit-'any' errors. - var dm_f11: (x, y, z) => string; - - // No implicit-'any' errors. - var dm_f12: (x, y: any, z) => string; - - // No implicit-'any' errors. - var dm_f13: (...r) => string; - - // No implicit-'any' errors. - var dm_f14: (x, ...r) => string; -} - -//// [noImplicitAnyParametersInAmbientModule.js] diff --git a/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt deleted file mode 100644 index ed49e1dbd11..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInBareFunctions.errors.txt +++ /dev/null @@ -1,89 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyParametersInBareFunctions.ts (22 errors) ==== - - // No implicit-'any' errors. - function f1(): void { } - - // Implicit-'any' error for x. - function f2(x): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // No implicit-'any' errors. - function f3(x: any): void { } - - // Implicit-'any' errors for x, y, and z. - function f4(x, y, z): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x, and z. - function f5(x, y: any, z): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' error for r. - function f6(...r): void { } - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - function f7(x, ...r): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any' errors for x1, y2, x3, and y3. - function f8(x1, y1: number): any; - ~~ -!!! Parameter 'x1' implicitly has an 'any' type. - function f8(x2: string, y2): any; - ~~ -!!! Parameter 'y2' implicitly has an 'any' type. - function f8(x3, y3): any { } - ~~ -!!! Parameter 'x3' implicitly has an 'any' type. - ~~ -!!! Parameter 'y3' implicitly has an 'any' type. - - // No implicit-'any' errors. - var f9 = () => ""; - - // Implicit-'any' errors for x. - var f10 = (x) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // Implicit-'any' errors for x, y, and z. - var f11 = (x, y, z) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x and z. - var f12 = (x, y: any, z) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' error for r. - var f13 = (...r) => ""; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - var f14 = (x, ...r) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt deleted file mode 100644 index 785ebe83b87..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInClass.errors.txt +++ /dev/null @@ -1,181 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyParametersInClass.ts (44 errors) ==== - - class C { - // No implicit-'any' errors. - public pub_f1(): void { } - - // Implicit-'any' errors for x. - public pub_f2(x): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // No implicit-'any' errors. - public pub_f3(x: any): void { } - - // Implicit-'any' errors for x, y, and z. - public pub_f4(x, y, z): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x, and z. - public pub_f5(x, y: any, z): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' errors for r. - public pub_f6(...r): void { } - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - public pub_f7(x, ...r): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any' errors for x1, y2, x3, and y3. - public pub_f8(x1, y1: number): any; - ~~ -!!! Parameter 'x1' implicitly has an 'any' type. - public pub_f8(x2: string, y2): any; - ~~ -!!! Parameter 'y2' implicitly has an 'any' type. - public pub_f8(x3, y3): any { } - ~~ -!!! Parameter 'x3' implicitly has an 'any' type. - ~~ -!!! Parameter 'y3' implicitly has an 'any' type. - - // No implicit-'any' errors. - public pub_f9 = () => ""; - - // Implicit-'any' errors for x. - public pub_f10 = (x) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // Implicit-'any' errors for x, y, and z. - public pub_f11 = (x, y, z) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x and z. - public pub_f12 = (x, y: any, z) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' error for r. - public pub_f13 = (...r) => ""; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - public pub_f14 = (x, ...r) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - /////////////////////////////////////////// - - // No implicit-'any' errors. - private priv_f1(): void { } - - // Implicit-'any' errors for x. - private priv_f2(x): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // No implicit-'any' errors. - private priv_f3(x: any): void { } - - // Implicit-'any' errors for x, y, and z. - private priv_f4(x, y, z): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x, and z. - private priv_f5(x, y: any, z): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' errors for r. - private priv_f6(...r): void { } - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - private priv_f7(x, ...r): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any' errors for x1, y2, x3, and y3. - private priv_f8(x1, y1: number): any; - ~~ -!!! Parameter 'x1' implicitly has an 'any' type. - private priv_f8(x2: string, y2): any; - ~~ -!!! Parameter 'y2' implicitly has an 'any' type. - private priv_f8(x3, y3): any { } - ~~ -!!! Parameter 'x3' implicitly has an 'any' type. - ~~ -!!! Parameter 'y3' implicitly has an 'any' type. - - // No implicit-'any' errors. - private priv_f9 = () => ""; - - // Implicit-'any' errors for x. - private priv_f10 = (x) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // Implicit-'any' errors for x, y, and z. - private priv_f11 = (x, y, z) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x and z. - private priv_f12 = (x, y: any, z) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' error for r. - private priv_f13 = (...r) => ""; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - private priv_f14 = (x, ...r) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt deleted file mode 100644 index c9bece57671..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInInterface.errors.txt +++ /dev/null @@ -1,106 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyParametersInInterface.ts (27 errors) ==== - - interface I { - // Implicit-'any' errors for first two call signatures, x1, x2, z2. - (); - ~~~ -!!! Call signature, which lacks return-type annotation, implicitly has an 'any' return type. - (x1); - ~~~~~ -!!! Call signature, which lacks return-type annotation, implicitly has an 'any' return type. - ~~ -!!! Parameter 'x1' implicitly has an 'any' type. - (x2, y2: string, z2): any; - ~~ -!!! Parameter 'x2' implicitly has an 'any' type. - ~~ -!!! Parameter 'z2' implicitly has an 'any' type. - - // No implicit-'any' errors. - f1(): void; - - // Implicit-'any' errors for x. - f2(x): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // No implicit-'any' errors. - f3(x: any): void; - - // Implicit-'any' errors for x, y, and z. - f4(x, y, z): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x, and z. - f5(x, y: any, z): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' errors for r. - f6(...r): void; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - f7(x, ...r): void; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any' errors for x1, y2, x3, and y3. - f8(x1, y1: number): any; - ~~ -!!! Parameter 'x1' implicitly has an 'any' type. - f8(x2: string, y2): any; - ~~ -!!! Parameter 'y2' implicitly has an 'any' type. - f8(x3, y3): any; - ~~ -!!! Parameter 'x3' implicitly has an 'any' type. - ~~ -!!! Parameter 'y3' implicitly has an 'any' type. - - // No implicit-'any' errors. - f9: () => string; - - // Implicit-'any' errors for x. - f10: (x) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // Implicit-'any' errors for x, y, and z. - f11: (x, y, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x and z. - f12: (x, y: any, z) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' error for r. - f13: (...r) => string; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x, r. - f14: (x, ...r) => string; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - } \ No newline at end of file diff --git a/tests/baselines/reference/noImplicitAnyParametersInInterface.js b/tests/baselines/reference/noImplicitAnyParametersInInterface.js deleted file mode 100644 index e8844fa1fad..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInInterface.js +++ /dev/null @@ -1,54 +0,0 @@ -//// [noImplicitAnyParametersInInterface.ts] - -interface I { - // Implicit-'any' errors for first two call signatures, x1, x2, z2. - (); - (x1); - (x2, y2: string, z2): any; - - // No implicit-'any' errors. - f1(): void; - - // Implicit-'any' errors for x. - f2(x): void; - - // No implicit-'any' errors. - f3(x: any): void; - - // Implicit-'any' errors for x, y, and z. - f4(x, y, z): void; - - // Implicit-'any' errors for x, and z. - f5(x, y: any, z): void; - - // Implicit-'any[]' errors for r. - f6(...r): void; - - // Implicit-'any'/'any[]' errors for x, r. - f7(x, ...r): void; - - // Implicit-'any' errors for x1, y2, x3, and y3. - f8(x1, y1: number): any; - f8(x2: string, y2): any; - f8(x3, y3): any; - - // No implicit-'any' errors. - f9: () => string; - - // Implicit-'any' errors for x. - f10: (x) => string; - - // Implicit-'any' errors for x, y, and z. - f11: (x, y, z) => string; - - // Implicit-'any' errors for x and z. - f12: (x, y: any, z) => string; - - // Implicit-'any[]' error for r. - f13: (...r) => string; - - // Implicit-'any'/'any[]' errors for x, r. - f14: (x, ...r) => string; -} - -//// [noImplicitAnyParametersInInterface.js] diff --git a/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt b/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt deleted file mode 100644 index 87912f0dcfa..00000000000 --- a/tests/baselines/reference/noImplicitAnyParametersInModule.errors.txt +++ /dev/null @@ -1,91 +0,0 @@ -==== tests/cases/compiler/noImplicitAnyParametersInModule.ts (22 errors) ==== - - module M { - // No implicit-'any' errors. - function m_f1(): void { } - - // Implicit-'any' error for x. - function m_f2(x): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // No implicit-'any' errors. - function m_f3(x: any): void { } - - // Implicit-'any' errors for x, y, and z. - function m_f4(x, y, z): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x and z. - function m_f5(x, y: any, z): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' error for r. - function m_f6(...r): void { } - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x and r. - function m_f7(x, ...r): void { } - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any' errors for x1, y2, x3, and y3. - function m_f8(x1, y1: number): any; - ~~ -!!! Parameter 'x1' implicitly has an 'any' type. - function m_f8(x2: string, y2): any; - ~~ -!!! Parameter 'y2' implicitly has an 'any' type. - function m_f8(x3, y3): any { } - ~~ -!!! Parameter 'x3' implicitly has an 'any' type. - ~~ -!!! Parameter 'y3' implicitly has an 'any' type. - - // No implicit-'any' errors. - var m_f9 = () => ""; - - // Implicit-'any' error for x. - var m_f10 = (x) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - - // Implicit-'any' errors for x, y, and z. - var m_f11 = (x, y, z) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'y' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any' errors for x and z. - var m_f12 = (x, y: any, z) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~ -!!! Parameter 'z' implicitly has an 'any' type. - - // Implicit-'any[]' errors for r. - var m_f13 = (...r) => ""; - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - - // Implicit-'any'/'any[]' errors for x and r. - var m_f14 = (x, ...r) => ""; - ~ -!!! Parameter 'x' implicitly has an 'any' type. - ~~~~ -!!! Rest parameter 'r' implicitly has an 'any[]' type. - } \ No newline at end of file diff --git a/tests/baselines/reference/noSelfOnVars.types b/tests/baselines/reference/noSelfOnVars.types index 8a059d8bc60..3f7f637a468 100644 --- a/tests/baselines/reference/noSelfOnVars.types +++ b/tests/baselines/reference/noSelfOnVars.types @@ -1,6 +1,6 @@ === tests/cases/compiler/noSelfOnVars.ts === function foo() { ->foo : () => void +>foo : typeof foo function bar() { } >bar : () => void diff --git a/tests/baselines/reference/nonInstantiatedModule.types b/tests/baselines/reference/nonInstantiatedModule.types index 64ca01d029d..04ad14a3d37 100644 --- a/tests/baselines/reference/nonInstantiatedModule.types +++ b/tests/baselines/reference/nonInstantiatedModule.types @@ -45,7 +45,7 @@ module M2 { >Point : typeof Point export function Origin(): Point { ->Origin : () => Point +>Origin : typeof Origin >Point : Point return { x: 0, y: 0 }; diff --git a/tests/baselines/reference/null.types b/tests/baselines/reference/null.types index 0614b5efec4..6e937ce732e 100644 --- a/tests/baselines/reference/null.types +++ b/tests/baselines/reference/null.types @@ -15,7 +15,7 @@ class C { >C : C } function f() { ->f : () => C +>f : typeof f return null; return new C(); @@ -23,7 +23,7 @@ function f() { >C : typeof C } function g() { ->g : () => number +>g : typeof g return null; return 3; diff --git a/tests/baselines/reference/nullAssignableToEveryType.types b/tests/baselines/reference/nullAssignableToEveryType.types index aaf3b3bd8c5..3fe16f828a4 100644 --- a/tests/baselines/reference/nullAssignableToEveryType.types +++ b/tests/baselines/reference/nullAssignableToEveryType.types @@ -99,7 +99,7 @@ var q: String = null; >String : String function foo(x: T, y: U, z: V) { ->foo : (x: T, y: U, z: V) => void +>foo : typeof foo >T : T >U : U >V : V diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types index 0395ae8faf5..e954f677bb7 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.types @@ -62,12 +62,10 @@ var r4 = true ? null : new Date(); var r5 = true ? /1/ : null; >r5 : RegExp >true ? /1/ : null : RegExp ->/1/ : RegExp var r5 = true ? null : /1/; >r5 : RegExp >true ? null : /1/ : RegExp ->/1/ : RegExp var r6 = true ? { foo: 1 } : null; >r6 : { foo: number; } @@ -241,7 +239,7 @@ var r16 = true ? null : ac; >ac : typeof c function f17(x: T) { ->f17 : (x: T) => void +>f17 : typeof f17 >T : T >x : T >T : T @@ -258,7 +256,7 @@ function f17(x: T) { } function f18(x: U) { ->f18 : (x: U) => void +>f18 : typeof f18 >T : T >U : U >x : U diff --git a/tests/baselines/reference/objectLitGetterSetter.types b/tests/baselines/reference/objectLitGetterSetter.types index 271b3bf4e74..9ac8643baab 100644 --- a/tests/baselines/reference/objectLitGetterSetter.types +++ b/tests/baselines/reference/objectLitGetterSetter.types @@ -4,61 +4,29 @@ >{} : {} Object.defineProperty(obj, "accProperty", ({ ->Object.defineProperty(obj, "accProperty", ({ - get: function () { - eval("public = 1;"); - return 11; - }, - set: function (v) { - } - })) : any +>Object.defineProperty(obj, "accProperty", ({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } })) : any >Object.defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >Object : { (): any; (value: any): any; new (value?: any): Object; prototype: Object; getPrototypeOf(o: any): any; getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: any): any; freeze(o: any): any; preventExtensions(o: any): any; isSealed(o: any): boolean; isFrozen(o: any): boolean; isExtensible(o: any): boolean; keys(o: any): string[]; } >defineProperty : (o: any, p: string, attributes: PropertyDescriptor) => any >obj : {} ->({ - get: function () { - eval("public = 1;"); - return 11; - }, - set: function (v) { - } - }) : PropertyDescriptor +>({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : PropertyDescriptor >PropertyDescriptor : PropertyDescriptor ->({ - get: function () { - eval("public = 1;"); - return 11; - }, - set: function (v) { - } - }) : { get: () => number; set: (v: any) => void; } ->{ - get: function () { - eval("public = 1;"); - return 11; - }, - set: function (v) { - } - } : { get: () => number; set: (v: any) => void; } +>({ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } }) : { get: () => number; set: (v: any) => void; } +>{ get: function () { eval("public = 1;"); return 11; }, set: function (v) { } } : { get: () => number; set: (v: any) => void; } get: function () { >get : () => number ->function () { - eval("public = 1;"); - return 11; - } : () => number +>function () { eval("public = 1;"); return 11; } : () => number eval("public = 1;"); >eval("public = 1;") : any ->eval : (x: string) => any +>eval : typeof eval return 11; }, set: function (v) { >set : (v: any) => void ->function (v) { - } : (v: any) => void +>function (v) { } : (v: any) => void >v : any } })) diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.types b/tests/baselines/reference/objectLiteralArraySpecialization.types index d077354728b..b7be0f6c1a0 100644 --- a/tests/baselines/reference/objectLiteralArraySpecialization.types +++ b/tests/baselines/reference/objectLiteralArraySpecialization.types @@ -1,6 +1,6 @@ === tests/cases/compiler/objectLiteralArraySpecialization.ts === declare function create(initialValues?: T[]): MyArrayWrapper; ->create : (initialValues?: T[]) => MyArrayWrapper +>create : typeof create >T : T >initialValues : T[] >T : T @@ -27,7 +27,7 @@ interface MyArrayWrapper { var thing = create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]); // should not error >thing : MyArrayWrapper<{ name: string; id: number; }> >create([ { name: "bob", id: 24 }, { name: "doug", id: 32 } ]) : MyArrayWrapper<{ name: string; id: number; }> ->create : (initialValues?: T[]) => MyArrayWrapper +>create : typeof create >[ { name: "bob", id: 24 }, { name: "doug", id: 32 } ] : { name: string; id: number; }[] >{ name: "bob", id: 24 } : { name: string; id: number; } >name : string diff --git a/tests/baselines/reference/objectLiteralWidened.types b/tests/baselines/reference/objectLiteralWidened.types index cd62d194f23..e8dc707a489 100644 --- a/tests/baselines/reference/objectLiteralWidened.types +++ b/tests/baselines/reference/objectLiteralWidened.types @@ -3,10 +3,7 @@ var x = { >x : { foo: any; bar: any; } ->{ - foo: null, - bar: undefined -} : { foo: null; bar: undefined; } +>{ foo: null, bar: undefined} : { foo: null; bar: undefined; } foo: null, >foo : any @@ -18,23 +15,14 @@ var x = { var y = { >y : { foo: any; bar: { baz: any; boo: any; }; } ->{ - foo: null, - bar: { - baz: null, - boo: undefined - } -} : { foo: null; bar: { baz: null; boo: undefined; }; } +>{ foo: null, bar: { baz: null, boo: undefined }} : { foo: null; bar: { baz: null; boo: undefined; }; } foo: null, >foo : any bar: { >bar : { baz: any; boo: any; } ->{ - baz: null, - boo: undefined - } : { baz: null; boo: undefined; } +>{ baz: null, boo: undefined } : { baz: null; boo: undefined; } baz: null, >baz : any diff --git a/tests/baselines/reference/objectTypeHidingMembersOfObject.types b/tests/baselines/reference/objectTypeHidingMembersOfObject.types index 1926969b8bb..5bbd3a555ee 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfObject.types +++ b/tests/baselines/reference/objectTypeHidingMembersOfObject.types @@ -39,9 +39,7 @@ var r2: void = i.valueOf(); var a = { >a : { valueOf: () => void; } ->{ - valueOf: () => { } -} : { valueOf: () => void; } +>{ valueOf: () => { }} : { valueOf: () => void; } valueOf: () => { } >valueOf : () => void diff --git a/tests/baselines/reference/objectTypePropertyAccess.types b/tests/baselines/reference/objectTypePropertyAccess.types index 2ad370fd7aa..56e45f1bae0 100644 --- a/tests/baselines/reference/objectTypePropertyAccess.types +++ b/tests/baselines/reference/objectTypePropertyAccess.types @@ -71,9 +71,7 @@ var r7 = i['bar']; var a = { >a : { foo: string; } ->{ - foo: '' -} : { foo: string; } +>{ foo: ''} : { foo: string; } foo: '' >foo : string diff --git a/tests/baselines/reference/objectTypeWithNumericProperty.types b/tests/baselines/reference/objectTypeWithNumericProperty.types index fb9e20f94a0..7c507cd4f64 100644 --- a/tests/baselines/reference/objectTypeWithNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithNumericProperty.types @@ -92,10 +92,7 @@ var r4 = a['1.1']; var b = { >b : { 1: number; 1.1: string; } ->{ - 1: 1, - 1.1: "" -} : { 1: number; 1.1: string; } +>{ 1: 1, 1.1: ""} : { 1: number; 1.1: string; } 1: 1, 1.1: "" diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types index 8f445923024..7a25f163efe 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.types @@ -344,16 +344,7 @@ var r13 = i[-01] var b = { >b : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": { (): string; new (): Date; new (value: number): Date; new (value: string): Date; new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; prototype: Date; parse(s: string): number; UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; now(): number; }; } ->{ - "0.1": null, - ".1": new Object(), - "1": 1, - "1.": "", - "1..": true, - "1.0": new Date(), - "-1.0": /123/, - "-1": Date -} : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": { (): string; new (): Date; new (value: number): Date; new (value: string): Date; new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; prototype: Date; parse(s: string): number; UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; now(): number; }; } +>{ "0.1": null, ".1": new Object(), "1": 1, "1.": "", "1..": true, "1.0": new Date(), "-1.0": /123/, "-1": Date} : { "1": number; "0.1": void; ".1": Object; "1.": string; "1..": boolean; "1.0": Date; "-1.0": RegExp; "-1": { (): string; new (): Date; new (value: number): Date; new (value: string): Date; new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; prototype: Date; parse(s: string): number; UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; now(): number; }; } "0.1": null, >null : void @@ -370,8 +361,6 @@ var b = { >Date : { (): string; new (): Date; new (value: number): Date; new (value: string): Date; new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; prototype: Date; parse(s: string): number; UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; now(): number; } "-1.0": /123/, ->/123/ : RegExp - "-1": Date >Date : Date diff --git a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types index 032f54a8565..fce2b03f53f 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types +++ b/tests/baselines/reference/objectTypeWithStringNamedPropertyOfIllegalCharacters.types @@ -99,11 +99,7 @@ var r4 = a["~!@#$%^&*()_+{}|:'<>?\/.,`"]; var b = { >b : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } ->{ - " ": 1, - "a b": "", - "~!@#$%^&*()_+{}|:'<>?\/.,`": 1, -} : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } +>{ " ": 1, "a b": "", "~!@#$%^&*()_+{}|:'<>?\/.,`": 1,} : { " ": number; "a b": string; "~!@#$%^&*()_+{}|:'<>?\/.,`": number; } " ": 1, "a b": "", diff --git a/tests/baselines/reference/objectTypesIdentity.types b/tests/baselines/reference/objectTypesIdentity.types index c148c4223ed..7a7db0b15d7 100644 --- a/tests/baselines/reference/objectTypesIdentity.types +++ b/tests/baselines/reference/objectTypesIdentity.types @@ -41,240 +41,240 @@ var b = { foo: '' }; >foo : string function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo3 : typeof foo3 >x : { foo: string; } >a : { foo: string; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo3 : typeof foo3 >x : { foo: string; } >a : { foo: string; } function foo3(x: any) { } ->foo3 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo4 : typeof foo4 >x : { foo: string; } >b : { foo: string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo4 : typeof foo4 >x : { foo: string; } >b : { foo: string; } function foo4(x: any) { } ->foo4 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // error ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // error ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // error ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo: string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // error ->foo7 : { (x: A): any; (x: { foo: string; }): any; } +>foo7 : typeof foo7 >x : { foo: string; } >a : { foo: string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo: string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo: string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // error ->foo10 : { (x: B): any; (x: { foo: string; }): any; } +>foo10 : typeof foo10 >x : { foo: string; } >a : { foo: string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo: string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // error ->foo11 : { (x: B): any; (x: { foo: string; }): any; } +>foo11 : typeof foo11 >x : { foo: string; } >b : { foo: string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: string; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo: string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: { foo: string; }): any; } +>foo13 : typeof foo13 >x : { foo: string; } >a : { foo: string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo: string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : { foo: string; } >b : { foo: string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentity2.types b/tests/baselines/reference/objectTypesIdentity2.types index 1969d55bd11..891a0e25c04 100644 --- a/tests/baselines/reference/objectTypesIdentity2.types +++ b/tests/baselines/reference/objectTypesIdentity2.types @@ -50,156 +50,156 @@ var b = { foo: E.A }; >A : E function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo: RegExp; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // ok ->foo7 : { (x: A): any; (x: { foo: RegExp; }): any; } +>foo7 : typeof foo7 >x : { foo: RegExp; } >a : { foo: RegExp; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo: RegExp; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo: RegExp; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo: RegExp; }): any; } +>foo10 : typeof foo10 >x : { foo: RegExp; } >a : { foo: RegExp; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo: RegExp; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: E; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: E; }): any; } +>foo11 : typeof foo11 >x : { foo: E; } >b : { foo: E; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: E; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo: RegExp; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo: RegExp; }): any; } +>foo13 : typeof foo13 >x : { foo: RegExp; } >a : { foo: RegExp; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo: RegExp; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: E; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: E; }): any; } +>foo14 : typeof foo14 >x : { foo: E; } >b : { foo: E; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: E; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types index f73785fab0d..d484446b91e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures.types @@ -60,268 +60,268 @@ var b = { foo(x: string) { return ''; } }; >x : string function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: string): string; }): any; (x: { foo(x: string): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: string): string; } >a : { foo(x: string): string; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: string): string; }): any; (x: { foo(x: string): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: string): string; } >a : { foo(x: string): string; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: string): string; }): any; (x: { foo(x: string): string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: string) => string; } >b : { foo: (x: string) => string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: string) => string; } >b : { foo: (x: string) => string; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // error ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // error ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // error ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: string): string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // error ->foo7 : { (x: A): any; (x: { foo(x: string): string; }): any; } +>foo7 : typeof foo7 >x : { foo(x: string): string; } >a : { foo(x: string): string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: string): string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: string): string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // error ->foo10 : { (x: B): any; (x: { foo(x: string): string; }): any; } +>foo10 : typeof foo10 >x : { foo(x: string): string; } >a : { foo(x: string): string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: string): string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // error ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: string) => string; } >b : { foo: (x: string) => string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // error ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: string): string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: { foo(x: string): string; }): any; } +>foo13 : typeof foo13 >x : { foo(x: string): string; } >a : { foo(x: string): string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: string): string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: string) => string; } >b : { foo: (x: string) => string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types index 16b658d0e43..f45434ed589 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.types @@ -62,268 +62,268 @@ var b = { foo(x: RegExp) { return ''; } }; >RegExp : RegExp function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: Date): string; }): any; (x: { foo(x: Date): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: Date): string; } >a : { foo(x: Date): string; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: Date): string; }): any; (x: { foo(x: Date): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: Date): string; } >a : { foo(x: Date): string; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: Date): string; }): any; (x: { foo(x: Date): string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: RegExp) => string; }): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: RegExp) => string; } >b : { foo: (x: RegExp) => string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: RegExp) => string; }): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: RegExp) => string; } >b : { foo: (x: RegExp) => string; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: RegExp) => string; }): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // error ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: Date): string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // ok ->foo7 : { (x: A): any; (x: { foo(x: Date): string; }): any; } +>foo7 : typeof foo7 >x : { foo(x: Date): string; } >a : { foo(x: Date): string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: Date): string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: Date): string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: Date): string; }): any; } +>foo10 : typeof foo10 >x : { foo(x: Date): string; } >a : { foo(x: Date): string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: Date): string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: RegExp) => string; } >b : { foo: (x: RegExp) => string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // error ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: Date): string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: Date): string; }): any; } +>foo13 : typeof foo13 >x : { foo(x: Date): string; } >a : { foo(x: Date): string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: Date): string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: RegExp) => string; } >b : { foo: (x: RegExp) => string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: RegExp) => string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types index 0ebbc639e5f..c0b3bbfcd45 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts.types @@ -64,268 +64,268 @@ var b = { foo(x: string) { return ''; } }; >x : string function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: string, y: string): string; }): any; (x: { foo(x: string, y: string): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: string, y: string): string; } >a : { foo(x: string, y: string): string; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: string, y: string): string; }): any; (x: { foo(x: string, y: string): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: string, y: string): string; } >a : { foo(x: string, y: string): string; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: string, y: string): string; }): any; (x: { foo(x: string, y: string): string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: string) => string; } >b : { foo: (x: string) => string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: string) => string; } >b : { foo: (x: string) => string; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: string) => string; }): any; (x: { foo: (x: string) => string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // error ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: string, y: string): string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // ok ->foo7 : { (x: A): any; (x: { foo(x: string, y: string): string; }): any; } +>foo7 : typeof foo7 >x : { foo(x: string, y: string): string; } >a : { foo(x: string, y: string): string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: string, y: string): string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: string, y: string): string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // error ->foo10 : { (x: B): any; (x: { foo(x: string, y: string): string; }): any; } +>foo10 : typeof foo10 >x : { foo(x: string, y: string): string; } >a : { foo(x: string, y: string): string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: string, y: string): string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: string) => string; } >b : { foo: (x: string) => string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: string) => string; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: string, y: string): string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: string, y: string): string; }): any; } +>foo13 : typeof foo13 >x : { foo(x: string, y: string): string; } >a : { foo(x: string, y: string): string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: string, y: string): string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: string) => string; } >b : { foo: (x: string) => string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: string) => string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.types index b72d0a799e4..becd0d14850 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesDifferingParamCounts2.types @@ -24,114 +24,114 @@ var a: { (x: string, y: string): string } >y : string function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: (x: string, y: string) => string): any; (x: (x: string, y: string) => string): any; } +>foo3 : typeof foo3 >x : (x: string, y: string) => string >a : (x: string, y: string) => string function foo3(x: typeof a); // error ->foo3 : { (x: (x: string, y: string) => string): any; (x: (x: string, y: string) => string): any; } +>foo3 : typeof foo3 >x : (x: string, y: string) => string >a : (x: string, y: string) => string function foo3(x: any) { } ->foo3 : { (x: (x: string, y: string) => string): any; (x: (x: string, y: string) => string): any; } +>foo3 : typeof foo3 >x : any function foo4(x: I2); ->foo4 : { (x: I2): any; (x: I2): any; } +>foo4 : typeof foo4 >x : I2 >I2 : I2 function foo4(x: I2); // error ->foo4 : { (x: I2): any; (x: I2): any; } +>foo4 : typeof foo4 >x : I2 >I2 : I2 function foo4(x: any) { } ->foo4 : { (x: I2): any; (x: I2): any; } +>foo4 : typeof foo4 >x : any function foo5(x: I2); ->foo5 : { (x: I2): any; (x: I2): any; } +>foo5 : typeof foo5 >x : I2 >I2 : I2 function foo5(x: I2); // ok ->foo5 : { (x: I2): any; (x: I2): any; } +>foo5 : typeof foo5 >x : I2 >I2 : I2 function foo5(x: any) { } ->foo5 : { (x: I2): any; (x: I2): any; } +>foo5 : typeof foo5 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: (x: string, y: string) => string): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: (x: string, y: string) => string): any; } +>foo13 : typeof foo13 >x : (x: string, y: string) => string >a : (x: string, y: string) => string function foo13(x: any) { } ->foo13 : { (x: I): any; (x: (x: string, y: string) => string): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: I2): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: I2); // error ->foo14 : { (x: I): any; (x: I2): any; } +>foo14 : typeof foo14 >x : I2 >I2 : I2 function foo14(x: any) { } ->foo14 : { (x: I): any; (x: I2): any; } +>foo14 : typeof foo14 >x : any function foo14b(x: typeof a); ->foo14b : { (x: (x: string, y: string) => string): any; (x: I2): any; } +>foo14b : typeof foo14b >x : (x: string, y: string) => string >a : (x: string, y: string) => string function foo14b(x: I2); // ok ->foo14b : { (x: (x: string, y: string) => string): any; (x: I2): any; } +>foo14b : typeof foo14b >x : I2 >I2 : I2 function foo14b(x: any) { } ->foo14b : { (x: (x: string, y: string) => string): any; (x: I2): any; } +>foo14b : typeof foo14b >x : any function foo15(x: I); ->foo15 : { (x: I): any; (x: I2): any; } +>foo15 : typeof foo15 >x : I >I : I function foo15(x: I2); // ok ->foo15 : { (x: I): any; (x: I2): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: any) { } ->foo15 : { (x: I): any; (x: I2): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types index efca8fc72dd..e24ea1c88ac 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignaturesWithOverloads.types @@ -101,9 +101,7 @@ var a: { var b = { >b : { foo: (x: any) => any; } ->{ - foo(x: any) { return ''; } -} : { foo: (x: any) => any; } +>{ foo(x: any) { return ''; }} : { foo: (x: any) => any; } foo(x: any) { return ''; } >foo : (x: any) => any @@ -114,268 +112,268 @@ var b = { }; function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: number): number; foo(x: string): string; }): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: number): number; foo(x: string): string; } >a : { foo(x: number): number; foo(x: string): string; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: number): number; foo(x: string): string; }): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: number): number; foo(x: string): string; } >a : { foo(x: number): number; foo(x: string): string; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: number): number; foo(x: string): string; }): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: any) => any; }): any; (x: { foo: (x: any) => any; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: any) => any; } >b : { foo: (x: any) => any; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: any) => any; }): any; (x: { foo: (x: any) => any; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: any) => any; } >b : { foo: (x: any) => any; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: any) => any; }): any; (x: { foo: (x: any) => any; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // error ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // BUG 831930 ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // BUG 831930 ->foo7 : { (x: A): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo7 : typeof foo7 >x : { foo(x: number): number; foo(x: string): string; } >a : { foo(x: number): number; foo(x: string): string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // BUG 831930 ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // BUG 831930 ->foo10 : { (x: B): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo10 : typeof foo10 >x : { foo(x: number): number; foo(x: string): string; } >a : { foo(x: number): number; foo(x: string): string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: any) => any; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: any) => any; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: any) => any; } >b : { foo: (x: any) => any; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: any) => any; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo13 : typeof foo13 >x : { foo(x: number): number; foo(x: string): string; } >a : { foo(x: number): number; foo(x: string): string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: number): number; foo(x: string): string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: any) => any; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: any) => any; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: any) => any; } >b : { foo: (x: any) => any; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: any) => any; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.types index a29f213bdde..f78a89f9097 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures.types @@ -46,226 +46,226 @@ var a: { new(x: string) } >x : string function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: string) => any): any; (x: new (x: string) => any): any; } +>foo3 : typeof foo3 >x : new (x: string) => any >a : new (x: string) => any function foo3(x: typeof a); // error ->foo3 : { (x: new (x: string) => any): any; (x: new (x: string) => any): any; } +>foo3 : typeof foo3 >x : new (x: string) => any >a : new (x: string) => any function foo3(x: any) { } ->foo3 : { (x: new (x: string) => any): any; (x: new (x: string) => any): any; } +>foo3 : typeof foo3 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // error ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // error ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: new (x: string) => any): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // ok ->foo7 : { (x: A): any; (x: new (x: string) => any): any; } +>foo7 : typeof foo7 >x : new (x: string) => any >a : new (x: string) => any function foo7(x: any) { } ->foo7 : { (x: A): any; (x: new (x: string) => any): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: string) => any): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: new (x: string) => any): any; } +>foo10 : typeof foo10 >x : new (x: string) => any >a : new (x: string) => any function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: string) => any): any; } +>foo10 : typeof foo10 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: string) => any): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: new (x: string) => any): any; } +>foo13 : typeof foo13 >x : new (x: string) => any >a : new (x: string) => any function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: string) => any): any; } +>foo13 : typeof foo13 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types index c530f1ced9b..2245a3c8cef 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.types @@ -48,198 +48,198 @@ var b = { new(x: RegExp) { return ''; } }; // not a construct signature, functio >RegExp : RegExp function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: Date) => string): any; (x: new (x: Date) => string): any; } +>foo3 : typeof foo3 >x : new (x: Date) => string >a : new (x: Date) => string function foo3(x: typeof a); // error ->foo3 : { (x: new (x: Date) => string): any; (x: new (x: Date) => string): any; } +>foo3 : typeof foo3 >x : new (x: Date) => string >a : new (x: Date) => string function foo3(x: any) { } ->foo3 : { (x: new (x: Date) => string): any; (x: new (x: Date) => string): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: RegExp) => string; }): any; (x: { new: (x: RegExp) => string; }): any; } +>foo4 : typeof foo4 >x : { new: (x: RegExp) => string; } >b : { new: (x: RegExp) => string; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: RegExp) => string; }): any; (x: { new: (x: RegExp) => string; }): any; } +>foo4 : typeof foo4 >x : { new: (x: RegExp) => string; } >b : { new: (x: RegExp) => string; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: RegExp) => string; }): any; (x: { new: (x: RegExp) => string; }): any; } +>foo4 : typeof foo4 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error, types are structurally equal ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: Date) => string): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: new (x: Date) => string): any; } +>foo10 : typeof foo10 >x : new (x: Date) => string >a : new (x: Date) => string function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: Date) => string): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: RegExp) => string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: RegExp) => string; }): any; } +>foo11 : typeof foo11 >x : { new: (x: RegExp) => string; } >b : { new: (x: RegExp) => string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: RegExp) => string; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: Date) => string): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: new (x: Date) => string): any; } +>foo13 : typeof foo13 >x : new (x: Date) => string >a : new (x: Date) => string function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: Date) => string): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: RegExp) => string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: RegExp) => string; }): any; } +>foo14 : typeof foo14 >x : { new: (x: RegExp) => string; } >b : { new: (x: RegExp) => string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: RegExp) => string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types index e5598f874e0..615a1cd6e6b 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.types @@ -50,198 +50,198 @@ var b = { new(x: string) { return ''; } }; // not a construct signature, functio >x : string function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: string, y: string) => string): any; (x: new (x: string, y: string) => string): any; } +>foo3 : typeof foo3 >x : new (x: string, y: string) => string >a : new (x: string, y: string) => string function foo3(x: typeof a); // error ->foo3 : { (x: new (x: string, y: string) => string): any; (x: new (x: string, y: string) => string): any; } +>foo3 : typeof foo3 >x : new (x: string, y: string) => string >a : new (x: string, y: string) => string function foo3(x: any) { } ->foo3 : { (x: new (x: string, y: string) => string): any; (x: new (x: string, y: string) => string): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: string) => string; }): any; (x: { new: (x: string) => string; }): any; } +>foo4 : typeof foo4 >x : { new: (x: string) => string; } >b : { new: (x: string) => string; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: string) => string; }): any; (x: { new: (x: string) => string; }): any; } +>foo4 : typeof foo4 >x : { new: (x: string) => string; } >b : { new: (x: string) => string; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: string) => string; }): any; (x: { new: (x: string) => string; }): any; } +>foo4 : typeof foo4 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error, types are structurally equal ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: string, y: string) => string): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: new (x: string, y: string) => string): any; } +>foo10 : typeof foo10 >x : new (x: string, y: string) => string >a : new (x: string, y: string) => string function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: string, y: string) => string): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: string) => string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: string) => string; }): any; } +>foo11 : typeof foo11 >x : { new: (x: string) => string; } >b : { new: (x: string) => string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: string) => string; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: string, y: string) => string): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: new (x: string, y: string) => string): any; } +>foo13 : typeof foo13 >x : new (x: string, y: string) => string >a : new (x: string, y: string) => string function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: string, y: string) => string): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: string) => string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: string) => string; }): any; } +>foo14 : typeof foo14 >x : { new: (x: string) => string; } >b : { new: (x: string) => string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: string) => string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types index 240e12b1c22..a6223aae995 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures.types @@ -75,268 +75,268 @@ var b = { foo(x: T) { return x; } }; >x : T function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T) => T; }): any; (x: { foo: (x: T) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T) => T; } >b : { foo: (x: T) => T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T) => T; }): any; (x: { foo: (x: T) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T) => T; } >b : { foo: (x: T) => T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T) => T; }): any; (x: { foo: (x: T) => T; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: T): T; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // error ->foo7 : { (x: A): any; (x: { foo(x: T): T; }): any; } +>foo7 : typeof foo7 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: T): T; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>foo10 : typeof foo10 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T) => T; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T) => T; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: T) => T; } >b : { foo: (x: T) => T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T) => T; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>foo13 : typeof foo13 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T) => T; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T) => T; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: T) => T; } >b : { foo: (x: T) => T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T) => T; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types index 932dbf7e9b3..f3ecf95b1f8 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignatures2.types @@ -96,268 +96,268 @@ var b = { foo(x: T, y: U) { return x; } }; >x : T function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: T, y: U): T; }): any; (x: { foo(x: T, y: U): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T, y: U): T; } >a : { foo(x: T, y: U): T; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: T, y: U): T; }): any; (x: { foo(x: T, y: U): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T, y: U): T; } >a : { foo(x: T, y: U): T; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: T, y: U): T; }): any; (x: { foo(x: T, y: U): T; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T, y: U) => T; } >b : { foo: (x: T, y: U) => T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T, y: U) => T; } >b : { foo: (x: T, y: U) => T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: T, y: U): T; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // no error, bug? ->foo7 : { (x: A): any; (x: { foo(x: T, y: U): T; }): any; } +>foo7 : typeof foo7 >x : { foo(x: T, y: U): T; } >a : { foo(x: T, y: U): T; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: T, y: U): T; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: T, y: U): T; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: T, y: U): T; }): any; } +>foo10 : typeof foo10 >x : { foo(x: T, y: U): T; } >a : { foo(x: T, y: U): T; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: T, y: U): T; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: T, y: U) => T; } >b : { foo: (x: T, y: U) => T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: T, y: U): T; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: T, y: U): T; }): any; } +>foo13 : typeof foo13 >x : { foo(x: T, y: U): T; } >a : { foo(x: T, y: U): T; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: T, y: U): T; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: T, y: U) => T; } >b : { foo: (x: T, y: U) => T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types index 2a5ab2dfe70..a0a1ace5645 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.types @@ -77,289 +77,289 @@ var b = { foo(x: T) { return ''; } }; >T : T function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B>); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B >Array : T[] function foo1b(x: B>); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B >Array : T[] function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C >String : String function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C >String : String function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I >Number : Number function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I >Number : Number function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: T): string; }): any; (x: { foo(x: T): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T): string; } >a : { foo(x: T): string; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: T): string; }): any; (x: { foo(x: T): string; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T): string; } >a : { foo(x: T): string; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: T): string; }): any; (x: { foo(x: T): string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T) => string; }): any; (x: { foo: (x: T) => string; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T) => string; } >b : { foo: (x: T) => string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T) => string; }): any; (x: { foo: (x: T) => string; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T) => string; } >b : { foo: (x: T) => string; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T) => string; }): any; (x: { foo: (x: T) => string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B>); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B >Array : T[] function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C >String : String function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I >Number : Number function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: T): string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // ok ->foo7 : { (x: A): any; (x: { foo(x: T): string; }): any; } +>foo7 : typeof foo7 >x : { foo(x: T): string; } >a : { foo(x: T): string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: T): string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B>); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B >Array : T[] function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I >Number : Number function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B>); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B >Array : T[] function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C >String : String function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B>); ->foo10 : { (x: B): any; (x: { foo(x: T): string; }): any; } +>foo10 : typeof foo10 >x : B >B : B >Array : T[] function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: T): string; }): any; } +>foo10 : typeof foo10 >x : { foo(x: T): string; } >a : { foo(x: T): string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: T): string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B>); ->foo11 : { (x: B): any; (x: { foo: (x: T) => string; }): any; } +>foo11 : typeof foo11 >x : B >B : B >Array : T[] function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T) => string; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: T) => string; } >b : { foo: (x: T) => string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T) => string; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I >Number : Number function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C >String : String function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C >String : String function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: T): string; }): any; } +>foo13 : typeof foo13 >x : I >I : I >Number : Number function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: T): string; }): any; } +>foo13 : typeof foo13 >x : { foo(x: T): string; } >a : { foo(x: T): string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: T): string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T) => string; }): any; } +>foo14 : typeof foo14 >x : I >I : I >Number : Number function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T) => string; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: T) => string; } >b : { foo: (x: T) => string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T) => string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C >String : String function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types index 9de1a816ab7..d06da02469b 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.types @@ -73,268 +73,268 @@ var b = { foo(x: T) { return null; } }; >T : T function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T) => any; } >b : { foo: (x: T) => any; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T) => any; } >b : { foo: (x: T) => any; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: T): T; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // ok ->foo7 : { (x: A): any; (x: { foo(x: T): T; }): any; } +>foo7 : typeof foo7 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: T): T; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>foo10 : typeof foo10 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: T) => any; } >b : { foo: (x: T) => any; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>foo13 : typeof foo13 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: T) => any; } >b : { foo: (x: T) => any; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types index f6f33890c07..710c440e2d0 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.types @@ -80,289 +80,289 @@ var b = { foo(x: T) { return null; } }; >T : T function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B >Date : Date function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B >Date : Date function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C >Date : Date function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C >Date : Date function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I >Date : Date function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I >Date : Date function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: T): T; }): any; (x: { foo(x: T): T; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T) => any; } >b : { foo: (x: T) => any; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T) => any; } >b : { foo: (x: T) => any; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T) => any; }): any; (x: { foo: (x: T) => any; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B >Date : Date function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C >Date : Date function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I >Date : Date function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: T): T; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // ok ->foo7 : { (x: A): any; (x: { foo(x: T): T; }): any; } +>foo7 : typeof foo7 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: T): T; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B >Date : Date function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I >Date : Date function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B >Date : Date function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C >Date : Date function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>foo10 : typeof foo10 >x : B >B : B >Date : Date function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>foo10 : typeof foo10 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: T): T; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : typeof foo11 >x : B >B : B >Date : Date function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: T) => any; } >b : { foo: (x: T) => any; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T) => any; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I >Date : Date function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C >Date : Date function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C >Date : Date function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>foo13 : typeof foo13 >x : I >I : I >Date : Date function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>foo13 : typeof foo13 >x : { foo(x: T): T; } >a : { foo(x: T): T; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: T): T; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : typeof foo14 >x : I >I : I >Date : Date function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: T) => any; } >b : { foo: (x: T) => any; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T) => any; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C >Date : Date function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types index dbd6d3e7d03..dd8f28b684d 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.types @@ -93,238 +93,238 @@ var b = { foo(x: A) { return x; } }; >x : A function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: Z): Z; }): any; (x: { foo(x: Z): Z; }): any; } +>foo3 : typeof foo3 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: Z): Z; }): any; (x: { foo(x: Z): Z; }): any; } +>foo3 : typeof foo3 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: Z): Z; }): any; (x: { foo(x: Z): Z; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: A) => A; } >b : { foo: (x: A) => A; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: A) => A; } >b : { foo: (x: A) => A; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I >Date : Date function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: Z): Z; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // no error, bug? ->foo7 : { (x: A): any; (x: { foo(x: Z): Z; }): any; } +>foo7 : typeof foo7 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: Z): Z; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I >Date : Date function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C>): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C>); // error ->foo9 : { (x: B): any; (x: C>): any; } +>foo9 : typeof foo9 >x : C> >C : C >B : B function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C>): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: Z): Z; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: Z): Z; }): any; } +>foo10 : typeof foo10 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: Z): Z; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: A) => A; } >b : { foo: (x: A) => A; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I, number, Date, string>); ->foo12 : { (x: I, number, Date, string>): any; (x: C, number, Date>): any; } +>foo12 : typeof foo12 >x : I, number, Date, string> >I : I >B : B >Date : Date function foo12(x: C, number, Date>); // error ->foo12 : { (x: I, number, Date, string>): any; (x: C, number, Date>): any; } +>foo12 : typeof foo12 >x : C, number, Date> >C : C >B : B >Date : Date function foo12(x: any) { } ->foo12 : { (x: I, number, Date, string>): any; (x: C, number, Date>): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: Z): Z; }): any; } +>foo13 : typeof foo13 >x : I >I : I >Date : Date @@ -332,43 +332,43 @@ function foo13(x: I); >Date : Date function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: Z): Z; }): any; } +>foo13 : typeof foo13 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: Z): Z; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : typeof foo14 >x : I >I : I >Date : Date >RegExp : RegExp function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: A) => A; } >b : { foo: (x: A) => A; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C, B>): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C, B>); // ok ->foo15 : { (x: I2): any; (x: C, B>): any; } +>foo15 : typeof foo15 >x : C, B> >C : C >B : B >B : B function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C, B>): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.types index 8cc0042cc9e..0340ce46d6e 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.types @@ -40,103 +40,103 @@ var a: { (x: Z): Z } >Z : Z function foo1(x: I); ->foo1 : { (x: I): any; (x: I): any; } +>foo1 : typeof foo1 >x : I >I : I function foo1(x: I); // error ->foo1 : { (x: I): any; (x: I): any; } +>foo1 : typeof foo1 >x : I >I : I function foo1(x: any) { } ->foo1 : { (x: I): any; (x: I): any; } +>foo1 : typeof foo1 >x : any function foo2(x: I2); ->foo2 : { (x: I2): any; (x: I2): any; } +>foo2 : typeof foo2 >x : I2 >I2 : I2 function foo2(x: I2); // error ->foo2 : { (x: I2): any; (x: I2): any; } +>foo2 : typeof foo2 >x : I2 >I2 : I2 function foo2(x: any) { } ->foo2 : { (x: I2): any; (x: I2): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: (x: Z) => Z): any; (x: (x: Z) => Z): any; } +>foo3 : typeof foo3 >x : (x: Z) => Z >a : (x: Z) => Z function foo3(x: typeof a); // error ->foo3 : { (x: (x: Z) => Z): any; (x: (x: Z) => Z): any; } +>foo3 : typeof foo3 >x : (x: Z) => Z >a : (x: Z) => Z function foo3(x: any) { } ->foo3 : { (x: (x: Z) => Z): any; (x: (x: Z) => Z): any; } +>foo3 : typeof foo3 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: (x: Z) => Z): any; } +>foo13 : typeof foo13 >x : I >I : I >Date : Date function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: (x: Z) => Z): any; } +>foo13 : typeof foo13 >x : (x: Z) => Z >a : (x: Z) => Z function foo13(x: any) { } ->foo13 : { (x: I): any; (x: (x: Z) => Z): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: I2): any; } +>foo14 : typeof foo14 >x : I >I : I >Date : Date function foo14(x: I2); // error ->foo14 : { (x: I): any; (x: I2): any; } +>foo14 : typeof foo14 >x : I2 >I2 : I2 function foo14(x: any) { } ->foo14 : { (x: I): any; (x: I2): any; } +>foo14 : typeof foo14 >x : any function foo14b(x: typeof a); ->foo14b : { (x: (x: Z) => Z): any; (x: I2): any; } +>foo14b : typeof foo14b >x : (x: Z) => Z >a : (x: Z) => Z function foo14b(x: I2); // ok ->foo14b : { (x: (x: Z) => Z): any; (x: I2): any; } +>foo14b : typeof foo14b >x : I2 >I2 : I2 function foo14b(x: any) { } ->foo14b : { (x: (x: Z) => Z): any; (x: I2): any; } +>foo14b : typeof foo14b >x : any function foo15(x: I); ->foo15 : { (x: I): any; (x: I2): any; } +>foo15 : typeof foo15 >x : I >I : I >Date : Date function foo15(x: I2); // ok ->foo15 : { (x: I): any; (x: I2): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: any) { } ->foo15 : { (x: I): any; (x: I2): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types index 85e83528cd0..7c90a214fff 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterNames.types @@ -75,268 +75,268 @@ var b = { foo(x: A) { return x; } }; >x : A function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: Z): Z; }): any; (x: { foo(x: Z): Z; }): any; } +>foo3 : typeof foo3 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: Z): Z; }): any; (x: { foo(x: Z): Z; }): any; } +>foo3 : typeof foo3 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: Z): Z; }): any; (x: { foo(x: Z): Z; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: A) => A; } >b : { foo: (x: A) => A; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: A) => A; } >b : { foo: (x: A) => A; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: A) => A; }): any; (x: { foo: (x: A) => A; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: Z): Z; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // error ->foo7 : { (x: A): any; (x: { foo(x: Z): Z; }): any; } +>foo7 : typeof foo7 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: Z): Z; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: Z): Z; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: Z): Z; }): any; } +>foo10 : typeof foo10 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: Z): Z; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: A) => A; } >b : { foo: (x: A) => A; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: A) => A; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: Z): Z; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: Z): Z; }): any; } +>foo13 : typeof foo13 >x : { foo(x: Z): Z; } >a : { foo(x: Z): Z; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: Z): Z; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: A) => A; } >b : { foo: (x: A) => A; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: A) => A; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types index bef916fc410..c0bcf8e394c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams.types @@ -91,268 +91,268 @@ var b = { foo(x: T, y?: T) { return x; } }; >x : T function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: T, y?: T): T; }): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T, y?: T): T; } >a : { foo(x: T, y?: T): T; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: T, y?: T): T; }): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T, y?: T): T; } >a : { foo(x: T, y?: T): T; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: T, y?: T): T; }): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T, y?: T) => T; }): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T, y?: T) => T; } >b : { foo: (x: T, y?: T) => T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T, y?: T) => T; }): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T, y?: T) => T; } >b : { foo: (x: T, y?: T) => T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T, y?: T) => T; }): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // no error, bug? ->foo7 : { (x: A): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo7 : typeof foo7 >x : { foo(x: T, y?: T): T; } >a : { foo(x: T, y?: T): T; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo10 : typeof foo10 >x : { foo(x: T, y?: T): T; } >a : { foo(x: T, y?: T): T; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: T, y?: T) => T; } >b : { foo: (x: T, y?: T) => T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo13 : typeof foo13 >x : { foo(x: T, y?: T): T; } >a : { foo(x: T, y?: T): T; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: T, y?: T): T; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: T, y?: T) => T; } >b : { foo: (x: T, y?: T) => T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: T) => T; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types index c8a4ad6be29..cbf9db01907 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams2.types @@ -98,268 +98,268 @@ var b = { foo(x: T, y?: U) { return x; } }; >x : T function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: T, y?: U): T; }): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: T, y?: U): T; }): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: T, y?: U): T; }): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T, y?: U) => T; }): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T, y?: U) => T; } >b : { foo: (x: T, y?: U) => T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T, y?: U) => T; }): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T, y?: U) => T; } >b : { foo: (x: T, y?: U) => T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T, y?: U) => T; }): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // no error, bug? ->foo7 : { (x: A): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo7 : typeof foo7 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo10 : typeof foo10 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: T, y?: U) => T; } >b : { foo: (x: T, y?: U) => T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo13 : typeof foo13 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: T, y?: U) => T; } >b : { foo: (x: T, y?: U) => T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T, y?: U) => T; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types index 06c23dcd0b1..f03e7b89ce6 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesOptionalParams3.types @@ -98,268 +98,268 @@ var b = { foo(x: T, y: U) { return x; } }; >x : T function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo(x: T, y?: U): T; }): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo(x: T, y?: U): T; }): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo3 : typeof foo3 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo3(x: any) { } ->foo3 : { (x: { foo(x: T, y?: U): T; }): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T, y: U) => T; } >b : { foo: (x: T, y: U) => T; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo4 : typeof foo4 >x : { foo: (x: T, y: U) => T; } >b : { foo: (x: T, y: U) => T; } function foo4(x: any) { } ->foo4 : { (x: { foo: (x: T, y: U) => T; }): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // no error, bug? ->foo7 : { (x: A): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo7 : typeof foo7 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo10 : typeof foo10 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : typeof foo11 >x : { foo: (x: T, y: U) => T; } >b : { foo: (x: T, y: U) => T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo13 : typeof foo13 >x : { foo(x: T, y?: U): T; } >a : { foo(x: T, y?: U): T; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo(x: T, y?: U): T; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : typeof foo14 >x : { foo: (x: T, y: U) => T; } >b : { foo: (x: T, y: U) => T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: (x: T, y: U) => T; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types index 8a41814e1a9..5a9db264031 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.types @@ -61,201 +61,201 @@ var b = { new(x: T) { return ''; } }; // not a construct signa >T : T function foo1b(x: B>); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B >Array : T[] function foo1b(x: B>); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B >Array : T[] function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C >String : String function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C >String : String function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I >Number : Number function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I >Number : Number function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: T) => string): any; (x: new (x: T) => string): any; } +>foo3 : typeof foo3 >x : new (x: T) => string >a : new (x: T) => string function foo3(x: typeof a); // error ->foo3 : { (x: new (x: T) => string): any; (x: new (x: T) => string): any; } +>foo3 : typeof foo3 >x : new (x: T) => string >a : new (x: T) => string function foo3(x: any) { } ->foo3 : { (x: new (x: T) => string): any; (x: new (x: T) => string): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T) => string; }): any; (x: { new: (x: T) => string; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T) => string; } >b : { new: (x: T) => string; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T) => string; }): any; (x: { new: (x: T) => string; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T) => string; } >b : { new: (x: T) => string; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T) => string; }): any; (x: { new: (x: T) => string; }): any; } +>foo4 : typeof foo4 >x : any function foo8(x: B>); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B >Array : T[] function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I >Number : Number function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B>); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B >Array : T[] function foo9(x: C); // error, types are structurally equal ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C >String : String function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B>); ->foo10 : { (x: B): any; (x: new (x: T) => string): any; } +>foo10 : typeof foo10 >x : B >B : B >Array : T[] function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: new (x: T) => string): any; } +>foo10 : typeof foo10 >x : new (x: T) => string >a : new (x: T) => string function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: T) => string): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B>); ->foo11 : { (x: B): any; (x: { new: (x: T) => string; }): any; } +>foo11 : typeof foo11 >x : B >B : B >Array : T[] function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T) => string; }): any; } +>foo11 : typeof foo11 >x : { new: (x: T) => string; } >b : { new: (x: T) => string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T) => string; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I >Number : Number function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C >String : String function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C >String : String function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: T) => string): any; } +>foo13 : typeof foo13 >x : I >I : I >Number : Number function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: new (x: T) => string): any; } +>foo13 : typeof foo13 >x : new (x: T) => string >a : new (x: T) => string function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: T) => string): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T) => string; }): any; } +>foo14 : typeof foo14 >x : I >I : I >Number : Number function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T) => string; }): any; } +>foo14 : typeof foo14 >x : { new: (x: T) => string; } >b : { new: (x: T) => string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T) => string; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types index 1eac69f7f23..c07d0e2430f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.types @@ -59,212 +59,212 @@ var b = { new(x: T): T { return null; } }; // not a construct signature, func >T : T function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: T) => T): any; (x: new (x: T) => T): any; } +>foo3 : typeof foo3 >x : new (x: T) => T >a : new (x: T) => T function foo3(x: typeof a); // error ->foo3 : { (x: new (x: T) => T): any; (x: new (x: T) => T): any; } +>foo3 : typeof foo3 >x : new (x: T) => T >a : new (x: T) => T function foo3(x: any) { } ->foo3 : { (x: new (x: T) => T): any; (x: new (x: T) => T): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T) => T; }): any; (x: { new: (x: T) => T; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T) => T; } >b : { new: (x: T) => T; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T) => T; }): any; (x: { new: (x: T) => T; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T) => T; } >b : { new: (x: T) => T; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T) => T; }): any; (x: { new: (x: T) => T; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: typeof a): number; ->foo5 : { (x: new (x: T) => T): number; (x: { new: (x: T) => T; }): string; } +>foo5 : typeof foo5 >x : new (x: T) => T >a : new (x: T) => T function foo5(x: typeof b): string; // ok ->foo5 : { (x: new (x: T) => T): number; (x: { new: (x: T) => T; }): string; } +>foo5 : typeof foo5 >x : { new: (x: T) => T; } >b : { new: (x: T) => T; } function foo5(x: any): any { } ->foo5 : { (x: new (x: T) => T): number; (x: { new: (x: T) => T; }): string; } +>foo5 : typeof foo5 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error since types are structurally equal ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: T) => T): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: new (x: T) => T): any; } +>foo10 : typeof foo10 >x : new (x: T) => T >a : new (x: T) => T function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: T) => T): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T) => T; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T) => T; }): any; } +>foo11 : typeof foo11 >x : { new: (x: T) => T; } >b : { new: (x: T) => T; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T) => T; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: T) => T): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: new (x: T) => T): any; } +>foo13 : typeof foo13 >x : new (x: T) => T >a : new (x: T) => T function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: T) => T): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T) => T; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T) => T; }): any; } +>foo14 : typeof foo14 >x : { new: (x: T) => T; } >b : { new: (x: T) => T; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T) => T; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types index 308f592ef12..80086f62f9c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.types @@ -64,216 +64,216 @@ var b = { new(x: T) { return null; } }; // not a construct signa >T : T function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B >Date : Date function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B >Date : Date function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C >Date : Date function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C >Date : Date function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I >Date : Date function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I >Date : Date function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: T) => T): any; (x: new (x: T) => T): any; } +>foo3 : typeof foo3 >x : new (x: T) => T >a : new (x: T) => T function foo3(x: typeof a); // error ->foo3 : { (x: new (x: T) => T): any; (x: new (x: T) => T): any; } +>foo3 : typeof foo3 >x : new (x: T) => T >a : new (x: T) => T function foo3(x: any) { } ->foo3 : { (x: new (x: T) => T): any; (x: new (x: T) => T): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T) => any; }): any; (x: { new: (x: T) => any; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T) => any; } >b : { new: (x: T) => any; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T) => any; }): any; (x: { new: (x: T) => any; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T) => any; } >b : { new: (x: T) => any; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T) => any; }): any; (x: { new: (x: T) => any; }): any; } +>foo4 : typeof foo4 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B >Date : Date function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I >Date : Date function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B >Date : Date function foo9(x: C); // error since types are structurally equal ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C >Date : Date function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: T) => T): any; } +>foo10 : typeof foo10 >x : B >B : B >Date : Date function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: new (x: T) => T): any; } +>foo10 : typeof foo10 >x : new (x: T) => T >a : new (x: T) => T function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: T) => T): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T) => any; }): any; } +>foo11 : typeof foo11 >x : B >B : B >Date : Date function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T) => any; }): any; } +>foo11 : typeof foo11 >x : { new: (x: T) => any; } >b : { new: (x: T) => any; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T) => any; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I >Date : Date function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C >Date : Date function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C >Date : Date function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: T) => T): any; } +>foo13 : typeof foo13 >x : I >I : I >Date : Date function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: new (x: T) => T): any; } +>foo13 : typeof foo13 >x : new (x: T) => T >a : new (x: T) => T function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: T) => T): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T) => any; }): any; } +>foo14 : typeof foo14 >x : I >I : I >Date : Date function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T) => any; }): any; } +>foo14 : typeof foo14 >x : { new: (x: T) => any; } >b : { new: (x: T) => any; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T) => any; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I2); ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : I2 >I2 : I2 function foo15(x: C); // ok ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : C >C : C >Date : Date function foo15(x: any) { } ->foo15 : { (x: I2): any; (x: C): any; } +>foo15 : typeof foo15 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types index 0276458ea91..52cee1f5bcd 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.types @@ -83,167 +83,167 @@ var b = { new(x: A) { return x; } }; >x : A function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: Z) => C): any; (x: new (x: Z) => C): any; } +>foo3 : typeof foo3 >x : new (x: Z) => C >a : new (x: Z) => C function foo3(x: typeof a); // error ->foo3 : { (x: new (x: Z) => C): any; (x: new (x: Z) => C): any; } +>foo3 : typeof foo3 >x : new (x: Z) => C >a : new (x: Z) => C function foo3(x: any) { } ->foo3 : { (x: new (x: Z) => C): any; (x: new (x: Z) => C): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: A) => A; }): any; (x: { new: (x: A) => A; }): any; } +>foo4 : typeof foo4 >x : { new: (x: A) => A; } >b : { new: (x: A) => A; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: A) => A; }): any; (x: { new: (x: A) => A; }): any; } +>foo4 : typeof foo4 >x : { new: (x: A) => A; } >b : { new: (x: A) => A; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: A) => A; }): any; (x: { new: (x: A) => A; }): any; } +>foo4 : typeof foo4 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // BUG 832086 ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I >Date : Date function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C>): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C>); // error ->foo9 : { (x: B): any; (x: C>): any; } +>foo9 : typeof foo9 >x : C> >C : C >B : B function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C>): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: Z) => C): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: new (x: Z) => C): any; } +>foo10 : typeof foo10 >x : new (x: Z) => C >a : new (x: Z) => C function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: Z) => C): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: A) => A; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: A) => A; }): any; } +>foo11 : typeof foo11 >x : { new: (x: A) => A; } >b : { new: (x: A) => A; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: A) => A; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I, number, Date, string>); ->foo12 : { (x: I, number, Date, string>): any; (x: C, number, Date>): any; } +>foo12 : typeof foo12 >x : I, number, Date, string> >I : I >B : B >Date : Date function foo12(x: C, number, Date>); // ok ->foo12 : { (x: I, number, Date, string>): any; (x: C, number, Date>): any; } +>foo12 : typeof foo12 >x : C, number, Date> >C : C >B : B >Date : Date function foo12(x: any) { } ->foo12 : { (x: I, number, Date, string>): any; (x: C, number, Date>): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // BUG 832086 ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: Z) => C): any; } +>foo13 : typeof foo13 >x : I >I : I >Date : Date @@ -251,27 +251,27 @@ function foo13(x: I); >Date : Date function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: new (x: Z) => C): any; } +>foo13 : typeof foo13 >x : new (x: Z) => C >a : new (x: Z) => C function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: Z) => C): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: A) => A; }): any; } +>foo14 : typeof foo14 >x : I >I : I >Date : Date >RegExp : RegExp function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: A) => A; }): any; } +>foo14 : typeof foo14 >x : { new: (x: A) => A; } >b : { new: (x: A) => A; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: A) => A; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types index 10a8da26907..a1c1e1aca99 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterNames.types @@ -63,184 +63,184 @@ var b = { new(x: A) { return new C(x); } }; >x : A function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: Z) => B): any; (x: new (x: Z) => B): any; } +>foo3 : typeof foo3 >x : new (x: Z) => B >a : new (x: Z) => B function foo3(x: typeof a); // error ->foo3 : { (x: new (x: Z) => B): any; (x: new (x: Z) => B): any; } +>foo3 : typeof foo3 >x : new (x: Z) => B >a : new (x: Z) => B function foo3(x: any) { } ->foo3 : { (x: new (x: Z) => B): any; (x: new (x: Z) => B): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: A) => C; }): any; (x: { new: (x: A) => C; }): any; } +>foo4 : typeof foo4 >x : { new: (x: A) => C; } >b : { new: (x: A) => C; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: A) => C; }): any; (x: { new: (x: A) => C; }): any; } +>foo4 : typeof foo4 >x : { new: (x: A) => C; } >b : { new: (x: A) => C; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: A) => C; }): any; (x: { new: (x: A) => C; }): any; } +>foo4 : typeof foo4 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // BUG 832086 ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: Z) => B): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // BUG 832086 ->foo10 : { (x: B): any; (x: new (x: Z) => B): any; } +>foo10 : typeof foo10 >x : new (x: Z) => B >a : new (x: Z) => B function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: Z) => B): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: A) => C; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: A) => C; }): any; } +>foo11 : typeof foo11 >x : { new: (x: A) => C; } >b : { new: (x: A) => C; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: A) => C; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // BUG 832086 ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: Z) => B): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // BUG 832086 ->foo13 : { (x: I): any; (x: new (x: Z) => B): any; } +>foo13 : typeof foo13 >x : new (x: Z) => B >a : new (x: Z) => B function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: Z) => B): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: A) => C; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: A) => C; }): any; } +>foo14 : typeof foo14 >x : { new: (x: A) => C; } >b : { new: (x: A) => C; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: A) => C; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types index 28ef6a81505..9da0c3ae436 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.types @@ -78,184 +78,184 @@ var b = { new(x: T, y?: T) { return new C(x, y); } }; // not a construct s >y : T function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: T, y?: T) => B): any; (x: new (x: T, y?: T) => B): any; } +>foo3 : typeof foo3 >x : new (x: T, y?: T) => B >a : new (x: T, y?: T) => B function foo3(x: typeof a); // error ->foo3 : { (x: new (x: T, y?: T) => B): any; (x: new (x: T, y?: T) => B): any; } +>foo3 : typeof foo3 >x : new (x: T, y?: T) => B >a : new (x: T, y?: T) => B function foo3(x: any) { } ->foo3 : { (x: new (x: T, y?: T) => B): any; (x: new (x: T, y?: T) => B): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T, y?: T) => C; }): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T, y?: T) => C; } >b : { new: (x: T, y?: T) => C; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T, y?: T) => C; }): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T, y?: T) => C; } >b : { new: (x: T, y?: T) => C; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T, y?: T) => C; }): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo4 : typeof foo4 >x : any function foo8(x: B): string; ->foo8 : { (x: B): string; (x: I): number; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I): number; // BUG 832086 ->foo8 : { (x: B): string; (x: I): number; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any): any { } ->foo8 : { (x: B): string; (x: I): number; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error, differ only by return type ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: T, y?: T) => B): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // BUG 832086 ->foo10 : { (x: B): any; (x: new (x: T, y?: T) => B): any; } +>foo10 : typeof foo10 >x : new (x: T, y?: T) => B >a : new (x: T, y?: T) => B function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: T, y?: T) => B): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo11 : typeof foo11 >x : { new: (x: T, y?: T) => C; } >b : { new: (x: T, y?: T) => C; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // BUG 832086 ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: T, y?: T) => B): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // BUG 832086 ->foo13 : { (x: I): any; (x: new (x: T, y?: T) => B): any; } +>foo13 : typeof foo13 >x : new (x: T, y?: T) => B >a : new (x: T, y?: T) => B function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: T, y?: T) => B): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo14 : typeof foo14 >x : { new: (x: T, y?: T) => C; } >b : { new: (x: T, y?: T) => C; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T, y?: T) => C; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types index e75f1ce7cbb..1a500ad8a62 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.types @@ -88,184 +88,184 @@ var b = { new(x: T, y?: U) { return new C(x, y); } }; // not a const >y : U function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: T, y?: U) => B): any; (x: new (x: T, y?: U) => B): any; } +>foo3 : typeof foo3 >x : new (x: T, y?: U) => B >a : new (x: T, y?: U) => B function foo3(x: typeof a); // error ->foo3 : { (x: new (x: T, y?: U) => B): any; (x: new (x: T, y?: U) => B): any; } +>foo3 : typeof foo3 >x : new (x: T, y?: U) => B >a : new (x: T, y?: U) => B function foo3(x: any) { } ->foo3 : { (x: new (x: T, y?: U) => B): any; (x: new (x: T, y?: U) => B): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T, y?: U) => C; }): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T, y?: U) => C; } >b : { new: (x: T, y?: U) => C; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T, y?: U) => C; }): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T, y?: U) => C; } >b : { new: (x: T, y?: U) => C; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T, y?: U) => C; }): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo4 : typeof foo4 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // BUG 832086 ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: T, y?: U) => B): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // BUG 832086 ->foo10 : { (x: B): any; (x: new (x: T, y?: U) => B): any; } +>foo10 : typeof foo10 >x : new (x: T, y?: U) => B >a : new (x: T, y?: U) => B function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: T, y?: U) => B): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo11 : typeof foo11 >x : { new: (x: T, y?: U) => C; } >b : { new: (x: T, y?: U) => C; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // BUG 832086 ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // ok ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: T, y?: U) => B): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // BUG 832086 ->foo13 : { (x: I): any; (x: new (x: T, y?: U) => B): any; } +>foo13 : typeof foo13 >x : new (x: T, y?: U) => B >a : new (x: T, y?: U) => B function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: T, y?: U) => B): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo14 : typeof foo14 >x : { new: (x: T, y?: U) => C; } >b : { new: (x: T, y?: U) => C; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T, y?: U) => C; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types index 5f5d592df34..1fd61d4cf8c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.types @@ -88,184 +88,184 @@ var b = { new(x: T, y: U) { return new C(x, y); } }; // not a constr >y : U function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: new (x: T, y?: U) => B): any; (x: new (x: T, y?: U) => B): any; } +>foo3 : typeof foo3 >x : new (x: T, y?: U) => B >a : new (x: T, y?: U) => B function foo3(x: typeof a); // error ->foo3 : { (x: new (x: T, y?: U) => B): any; (x: new (x: T, y?: U) => B): any; } +>foo3 : typeof foo3 >x : new (x: T, y?: U) => B >a : new (x: T, y?: U) => B function foo3(x: any) { } ->foo3 : { (x: new (x: T, y?: U) => B): any; (x: new (x: T, y?: U) => B): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { new: (x: T, y: U) => C; }): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T, y: U) => C; } >b : { new: (x: T, y: U) => C; } function foo4(x: typeof b); // error ->foo4 : { (x: { new: (x: T, y: U) => C; }): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo4 : typeof foo4 >x : { new: (x: T, y: U) => C; } >b : { new: (x: T, y: U) => C; } function foo4(x: any) { } ->foo4 : { (x: { new: (x: T, y: U) => C; }): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo4 : typeof foo4 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // BUG 832086 ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error, differ only by return type ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: new (x: T, y?: U) => B): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // BUG 832086 ->foo10 : { (x: B): any; (x: new (x: T, y?: U) => B): any; } +>foo10 : typeof foo10 >x : new (x: T, y?: U) => B >a : new (x: T, y?: U) => B function foo10(x: any) { } ->foo10 : { (x: B): any; (x: new (x: T, y?: U) => B): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo11 : typeof foo11 >x : { new: (x: T, y: U) => C; } >b : { new: (x: T, y: U) => C; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo12b(x: I2); ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : I2 >I2 : I2 function foo12b(x: C); // BUG 832086 ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : C >C : C function foo12b(x: any) { } ->foo12b : { (x: I2): any; (x: C): any; } +>foo12b : typeof foo12b >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: new (x: T, y?: U) => B): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // BUG 832086 ->foo13 : { (x: I): any; (x: new (x: T, y?: U) => B): any; } +>foo13 : typeof foo13 >x : new (x: T, y?: U) => B >a : new (x: T, y?: U) => B function foo13(x: any) { } ->foo13 : { (x: I): any; (x: new (x: T, y?: U) => B): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo14 : typeof foo14 >x : { new: (x: T, y: U) => C; } >b : { new: (x: T, y: U) => C; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { new: (x: T, y: U) => C; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types index ab83b0c78f0..7182fd542de 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.types @@ -54,325 +54,325 @@ var b: { [x: number]: string; } = { foo: '' }; >foo : string function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { [x: number]: string; }): any; (x: { [x: number]: string; }): any; } +>foo3 : typeof foo3 >x : { [x: number]: string; } >a : { [x: number]: string; } function foo3(x: typeof a); // error ->foo3 : { (x: { [x: number]: string; }): any; (x: { [x: number]: string; }): any; } +>foo3 : typeof foo3 >x : { [x: number]: string; } >a : { [x: number]: string; } function foo3(x: any) { } ->foo3 : { (x: { [x: number]: string; }): any; (x: { [x: number]: string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { [x: number]: string; }): any; (x: { [x: number]: string; }): any; } +>foo4 : typeof foo4 >x : { [x: number]: string; } >b : { [x: number]: string; } function foo4(x: typeof b); // error ->foo4 : { (x: { [x: number]: string; }): any; (x: { [x: number]: string; }): any; } +>foo4 : typeof foo4 >x : { [x: number]: string; } >b : { [x: number]: string; } function foo4(x: any) { } ->foo4 : { (x: { [x: number]: string; }): any; (x: { [x: number]: string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // error ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // error ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo5c(x: A); ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : A >A : A function foo5c(x: PA); // error ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : PA >PA : PA function foo5c(x: any) { } ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : any function foo5d(x: A); ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : A >A : A function foo5d(x: PB); // error ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : PB >PB : PB function foo5d(x: any) { } ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // error ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { [x: number]: string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // error ->foo7 : { (x: A): any; (x: { [x: number]: string; }): any; } +>foo7 : typeof foo7 >x : { [x: number]: string; } >a : { [x: number]: string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { [x: number]: string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { [x: number]: string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // error ->foo10 : { (x: B): any; (x: { [x: number]: string; }): any; } +>foo10 : typeof foo10 >x : { [x: number]: string; } >a : { [x: number]: string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { [x: number]: string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { [x: number]: string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // error ->foo11 : { (x: B): any; (x: { [x: number]: string; }): any; } +>foo11 : typeof foo11 >x : { [x: number]: string; } >b : { [x: number]: string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { [x: number]: string; }): any; } +>foo11 : typeof foo11 >x : any function foo11b(x: B); ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : B >B : B function foo11b(x: PA); // error ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : PA >PA : PA function foo11b(x: any) { } ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : any function foo11c(x: B); ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : B >B : B function foo11c(x: PB); // error ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : PB >PB : PB function foo11c(x: any) { } ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { [x: number]: string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: { [x: number]: string; }): any; } +>foo13 : typeof foo13 >x : { [x: number]: string; } >a : { [x: number]: string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { [x: number]: string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { [x: number]: string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { [x: number]: string; }): any; } +>foo14 : typeof foo14 >x : { [x: number]: string; } >b : { [x: number]: string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { [x: number]: string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I); ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : I >I : I function foo15(x: PA); // error ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : PA >PA : PA function foo15(x: any) { } ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : any function foo16(x: I); ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : I >I : I function foo16(x: PB); // error ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : PB >PB : PB function foo16(x: any) { } ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types index cd8f19b2b7e..dc5616ebba6 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.types @@ -70,328 +70,328 @@ var b: { [x: number]: Derived; } = { foo: null }; >Derived : Derived function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { [x: number]: Base; }): any; (x: { [x: number]: Base; }): any; } +>foo3 : typeof foo3 >x : { [x: number]: Base; } >a : { [x: number]: Base; } function foo3(x: typeof a); // error ->foo3 : { (x: { [x: number]: Base; }): any; (x: { [x: number]: Base; }): any; } +>foo3 : typeof foo3 >x : { [x: number]: Base; } >a : { [x: number]: Base; } function foo3(x: any) { } ->foo3 : { (x: { [x: number]: Base; }): any; (x: { [x: number]: Base; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { [x: number]: Derived; }): any; (x: { [x: number]: Derived; }): any; } +>foo4 : typeof foo4 >x : { [x: number]: Derived; } >b : { [x: number]: Derived; } function foo4(x: typeof b); // error ->foo4 : { (x: { [x: number]: Derived; }): any; (x: { [x: number]: Derived; }): any; } +>foo4 : typeof foo4 >x : { [x: number]: Derived; } >b : { [x: number]: Derived; } function foo4(x: any) { } ->foo4 : { (x: { [x: number]: Derived; }): any; (x: { [x: number]: Derived; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C >Derived : Derived function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo5c(x: A); ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : A >A : A function foo5c(x: PA); // error ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : PA >PA : PA function foo5c(x: any) { } ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : any function foo5d(x: A); ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : A >A : A function foo5d(x: PB); // ok ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : PB >PB : PB function foo5d(x: any) { } ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { [x: number]: Base; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // error ->foo7 : { (x: A): any; (x: { [x: number]: Base; }): any; } +>foo7 : typeof foo7 >x : { [x: number]: Base; } >a : { [x: number]: Base; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { [x: number]: Base; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C >Base : Base function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { [x: number]: Base; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { [x: number]: Base; }): any; } +>foo10 : typeof foo10 >x : { [x: number]: Base; } >a : { [x: number]: Base; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { [x: number]: Base; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { [x: number]: Derived; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // error ->foo11 : { (x: B): any; (x: { [x: number]: Derived; }): any; } +>foo11 : typeof foo11 >x : { [x: number]: Derived; } >b : { [x: number]: Derived; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { [x: number]: Derived; }): any; } +>foo11 : typeof foo11 >x : any function foo11b(x: B); ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : B >B : B function foo11b(x: PA); // ok ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : PA >PA : PA function foo11b(x: any) { } ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : any function foo11c(x: B); ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : B >B : B function foo11c(x: PB); // error ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : PB >PB : PB function foo11c(x: any) { } ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C >Derived : Derived function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { [x: number]: Base; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { [x: number]: Base; }): any; } +>foo13 : typeof foo13 >x : { [x: number]: Base; } >a : { [x: number]: Base; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { [x: number]: Base; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { [x: number]: Derived; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { [x: number]: Derived; }): any; } +>foo14 : typeof foo14 >x : { [x: number]: Derived; } >b : { [x: number]: Derived; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { [x: number]: Derived; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I); ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : I >I : I function foo15(x: PA); // ok ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : PA >PA : PA function foo15(x: any) { } ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : any function foo16(x: I); ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : I >I : I function foo16(x: PB); // error ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : PB >PB : PB function foo16(x: any) { } ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types index 6a73749fc84..d62a05d7e23 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.types @@ -54,325 +54,325 @@ var b: { [x: number]: string; } = { foo: '' }; >foo : string function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { [x: string]: string; }): any; (x: { [x: string]: string; }): any; } +>foo3 : typeof foo3 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo3(x: typeof a); // error ->foo3 : { (x: { [x: string]: string; }): any; (x: { [x: string]: string; }): any; } +>foo3 : typeof foo3 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo3(x: any) { } ->foo3 : { (x: { [x: string]: string; }): any; (x: { [x: string]: string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { [x: number]: string; }): any; (x: { [x: number]: string; }): any; } +>foo4 : typeof foo4 >x : { [x: number]: string; } >b : { [x: number]: string; } function foo4(x: typeof b); // error ->foo4 : { (x: { [x: number]: string; }): any; (x: { [x: number]: string; }): any; } +>foo4 : typeof foo4 >x : { [x: number]: string; } >b : { [x: number]: string; } function foo4(x: any) { } ->foo4 : { (x: { [x: number]: string; }): any; (x: { [x: number]: string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // error ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo5c(x: A); ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : A >A : A function foo5c(x: PA); // error ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : PA >PA : PA function foo5c(x: any) { } ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : any function foo5d(x: A); ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : A >A : A function foo5d(x: PB); // ok ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : PB >PB : PB function foo5d(x: any) { } ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { [x: string]: string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // ok ->foo7 : { (x: A): any; (x: { [x: string]: string; }): any; } +>foo7 : typeof foo7 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { [x: string]: string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { [x: string]: string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // error ->foo10 : { (x: B): any; (x: { [x: string]: string; }): any; } +>foo10 : typeof foo10 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { [x: string]: string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { [x: number]: string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // ok ->foo11 : { (x: B): any; (x: { [x: number]: string; }): any; } +>foo11 : typeof foo11 >x : { [x: number]: string; } >b : { [x: number]: string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { [x: number]: string; }): any; } +>foo11 : typeof foo11 >x : any function foo11b(x: B); ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : B >B : B function foo11b(x: PA); // ok ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : PA >PA : PA function foo11b(x: any) { } ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : any function foo11c(x: B); ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : B >B : B function foo11c(x: PB); // error ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : PB >PB : PB function foo11c(x: any) { } ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { [x: string]: string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: { [x: string]: string; }): any; } +>foo13 : typeof foo13 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { [x: string]: string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { [x: number]: string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { [x: number]: string; }): any; } +>foo14 : typeof foo14 >x : { [x: number]: string; } >b : { [x: number]: string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { [x: number]: string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I); ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : I >I : I function foo15(x: PA); // ok ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : PA >PA : PA function foo15(x: any) { } ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : any function foo16(x: I); ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : I >I : I function foo16(x: PB); // error ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : PB >PB : PB function foo16(x: any) { } ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithOptionality.types b/tests/baselines/reference/objectTypesIdentityWithOptionality.types index 0ca5b552bf5..4a762d39fac 100644 --- a/tests/baselines/reference/objectTypesIdentityWithOptionality.types +++ b/tests/baselines/reference/objectTypesIdentityWithOptionality.types @@ -41,128 +41,128 @@ var b = { foo: '' }; >foo : string function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo?: string; }): any; (x: { foo?: string; }): any; } +>foo3 : typeof foo3 >x : { foo?: string; } >a : { foo?: string; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo?: string; }): any; (x: { foo?: string; }): any; } +>foo3 : typeof foo3 >x : { foo?: string; } >a : { foo?: string; } function foo3(x: any) { } ->foo3 : { (x: { foo?: string; }): any; (x: { foo?: string; }): any; } +>foo3 : typeof foo3 >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo?: string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // ok ->foo7 : { (x: A): any; (x: { foo?: string; }): any; } +>foo7 : typeof foo7 >x : { foo?: string; } >a : { foo?: string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo?: string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // ok ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo?: string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { foo?: string; }): any; } +>foo10 : typeof foo10 >x : { foo?: string; } >a : { foo?: string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo?: string; }): any; } +>foo10 : typeof foo10 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // ok ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo?: string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: { foo?: string; }): any; } +>foo13 : typeof foo13 >x : { foo?: string; } >a : { foo?: string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo?: string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // ok ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : { foo: string; } >b : { foo: string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.types b/tests/baselines/reference/objectTypesIdentityWithPrivates.types index 391f6f1f200..6bd61edbacf 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.types +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.types @@ -51,325 +51,325 @@ var b = { foo: '' }; >foo : string function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo3 : typeof foo3 >x : { foo: string; } >a : { foo: string; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo3 : typeof foo3 >x : { foo: string; } >a : { foo: string; } function foo3(x: any) { } ->foo3 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo4 : typeof foo4 >x : { foo: string; } >b : { foo: string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo4 : typeof foo4 >x : { foo: string; } >b : { foo: string; } function foo4(x: any) { } ->foo4 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // no error ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // no error ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo5c(x: A); ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : A >A : A function foo5c(x: PA); // error ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : PA >PA : PA function foo5c(x: any) { } ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : any function foo5d(x: A); ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : A >A : A function foo5d(x: PB); // no error ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : PB >PB : PB function foo5d(x: any) { } ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // no error ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo: string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // no error ->foo7 : { (x: A): any; (x: { foo: string; }): any; } +>foo7 : typeof foo7 >x : { foo: string; } >a : { foo: string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo: string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // no error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // no error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo: string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // no error ->foo10 : { (x: B): any; (x: { foo: string; }): any; } +>foo10 : typeof foo10 >x : { foo: string; } >a : { foo: string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo: string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // no error ->foo11 : { (x: B): any; (x: { foo: string; }): any; } +>foo11 : typeof foo11 >x : { foo: string; } >b : { foo: string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: string; }): any; } +>foo11 : typeof foo11 >x : any function foo11b(x: B); ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : B >B : B function foo11b(x: PA); // no error ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : PA >PA : PA function foo11b(x: any) { } ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : any function foo11c(x: B); ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : B >B : B function foo11c(x: PB); // error ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : PB >PB : PB function foo11c(x: any) { } ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // no error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo: string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: { foo: string; }): any; } +>foo13 : typeof foo13 >x : { foo: string; } >a : { foo: string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo: string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : { foo: string; } >b : { foo: string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I); ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : I >I : I function foo15(x: PA); // no error ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : PA >PA : PA function foo15(x: any) { } ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : any function foo16(x: I); ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : I >I : I function foo16(x: PB); // no error ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : PB >PB : PB function foo16(x: any) { } ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.types b/tests/baselines/reference/objectTypesIdentityWithPrivates2.types index a29edc75162..2756ce4a327 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates2.types +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.types @@ -18,101 +18,101 @@ class D extends C { } function foo1(x: C); ->foo1 : { (x: C): any; (x: C): any; } +>foo1 : typeof foo1 >x : C >C : C function foo1(x: C); // ok ->foo1 : { (x: C): any; (x: C): any; } +>foo1 : typeof foo1 >x : C >C : C function foo1(x: any) { } ->foo1 : { (x: C): any; (x: C): any; } +>foo1 : typeof foo1 >x : any function foo2(x: D); ->foo2 : { (x: D): any; (x: D): any; } +>foo2 : typeof foo2 >x : D >D : D function foo2(x: D); // ok ->foo2 : { (x: D): any; (x: D): any; } +>foo2 : typeof foo2 >x : D >D : D function foo2(x: any) { } ->foo2 : { (x: D): any; (x: D): any; } +>foo2 : typeof foo2 >x : any function foo3(x: C); ->foo3 : { (x: C): any; (x: D): any; } +>foo3 : typeof foo3 >x : C >C : C function foo3(x: D); // ok ->foo3 : { (x: C): any; (x: D): any; } +>foo3 : typeof foo3 >x : D >D : D function foo3(x: any) { } ->foo3 : { (x: C): any; (x: D): any; } +>foo3 : typeof foo3 >x : any function foo4(x: C): number; ->foo4 : { (x: C): number; (x: D): string; } +>foo4 : typeof foo4 >x : C >C : C function foo4(x: D): string; // BUG 831926 ->foo4 : { (x: C): number; (x: D): string; } +>foo4 : typeof foo4 >x : D >D : D function foo4(x: any): any { } ->foo4 : { (x: C): number; (x: D): string; } +>foo4 : typeof foo4 >x : any var r = foo4(new C()); >r : number >foo4(new C()) : number ->foo4 : { (x: C): number; (x: D): string; } +>foo4 : typeof foo4 >new C() : C >C : typeof C var r = foo4(new D()); >r : number >foo4(new D()) : number ->foo4 : { (x: C): number; (x: D): string; } +>foo4 : typeof foo4 >new D() : D >D : typeof D function foo5(x: C): number; ->foo5 : { (x: C): number; (x: C): string; } +>foo5 : typeof foo5 >x : C >C : C function foo5(x: C): string; // error ->foo5 : { (x: C): number; (x: C): string; } +>foo5 : typeof foo5 >x : C >C : C function foo5(x: any): any { } ->foo5 : { (x: C): number; (x: C): string; } +>foo5 : typeof foo5 >x : any function foo6(x: D): number; ->foo6 : { (x: D): number; (x: D): string; } +>foo6 : typeof foo6 >x : D >D : D function foo6(x: D): string; // error ->foo6 : { (x: D): number; (x: D): string; } +>foo6 : typeof foo6 >x : D >D : D function foo6(x: any): any { } ->foo6 : { (x: D): number; (x: D): string; } +>foo6 : typeof foo6 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithPublics.types b/tests/baselines/reference/objectTypesIdentityWithPublics.types index 411fe4fb88e..a15bc396bea 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPublics.types +++ b/tests/baselines/reference/objectTypesIdentityWithPublics.types @@ -41,240 +41,240 @@ var b = { foo: '' }; >foo : string function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo3 : typeof foo3 >x : { foo: string; } >a : { foo: string; } function foo3(x: typeof a); // error ->foo3 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo3 : typeof foo3 >x : { foo: string; } >a : { foo: string; } function foo3(x: any) { } ->foo3 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo4 : typeof foo4 >x : { foo: string; } >b : { foo: string; } function foo4(x: typeof b); // error ->foo4 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo4 : typeof foo4 >x : { foo: string; } >b : { foo: string; } function foo4(x: any) { } ->foo4 : { (x: { foo: string; }): any; (x: { foo: string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // error ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // error ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // error ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { foo: string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // error ->foo7 : { (x: A): any; (x: { foo: string; }): any; } +>foo7 : typeof foo7 >x : { foo: string; } >a : { foo: string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { foo: string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { foo: string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // error ->foo10 : { (x: B): any; (x: { foo: string; }): any; } +>foo10 : typeof foo10 >x : { foo: string; } >a : { foo: string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { foo: string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { foo: string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // error ->foo11 : { (x: B): any; (x: { foo: string; }): any; } +>foo11 : typeof foo11 >x : { foo: string; } >b : { foo: string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { foo: string; }): any; } +>foo11 : typeof foo11 >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { foo: string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: { foo: string; }): any; } +>foo13 : typeof foo13 >x : { foo: string; } >a : { foo: string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { foo: string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : { foo: string; } >b : { foo: string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { foo: string; }): any; } +>foo14 : typeof foo14 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types index 83a73646874..9488d61a819 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.types @@ -54,325 +54,325 @@ var b: { [x: string]: string; } = { foo: '' }; >foo : string function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { [x: string]: string; }): any; (x: { [x: string]: string; }): any; } +>foo3 : typeof foo3 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo3(x: typeof a); // error ->foo3 : { (x: { [x: string]: string; }): any; (x: { [x: string]: string; }): any; } +>foo3 : typeof foo3 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo3(x: any) { } ->foo3 : { (x: { [x: string]: string; }): any; (x: { [x: string]: string; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { [x: string]: string; }): any; (x: { [x: string]: string; }): any; } +>foo4 : typeof foo4 >x : { [x: string]: string; } >b : { [x: string]: string; } function foo4(x: typeof b); // error ->foo4 : { (x: { [x: string]: string; }): any; (x: { [x: string]: string; }): any; } +>foo4 : typeof foo4 >x : { [x: string]: string; } >b : { [x: string]: string; } function foo4(x: any) { } ->foo4 : { (x: { [x: string]: string; }): any; (x: { [x: string]: string; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // error ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // error ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo5c(x: A); ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : A >A : A function foo5c(x: PA); // error ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : PA >PA : PA function foo5c(x: any) { } ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : any function foo5d(x: A); ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : A >A : A function foo5d(x: PB); // error ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : PB >PB : PB function foo5d(x: any) { } ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // error ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { [x: string]: string; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // error ->foo7 : { (x: A): any; (x: { [x: string]: string; }): any; } +>foo7 : typeof foo7 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { [x: string]: string; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // error ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { [x: string]: string; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // error ->foo10 : { (x: B): any; (x: { [x: string]: string; }): any; } +>foo10 : typeof foo10 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { [x: string]: string; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { [x: string]: string; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // error ->foo11 : { (x: B): any; (x: { [x: string]: string; }): any; } +>foo11 : typeof foo11 >x : { [x: string]: string; } >b : { [x: string]: string; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { [x: string]: string; }): any; } +>foo11 : typeof foo11 >x : any function foo11b(x: B); ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : B >B : B function foo11b(x: PA); // error ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : PA >PA : PA function foo11b(x: any) { } ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : any function foo11c(x: B); ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : B >B : B function foo11c(x: PB); // error ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : PB >PB : PB function foo11c(x: any) { } ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { [x: string]: string; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // error ->foo13 : { (x: I): any; (x: { [x: string]: string; }): any; } +>foo13 : typeof foo13 >x : { [x: string]: string; } >a : { [x: string]: string; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { [x: string]: string; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { [x: string]: string; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { [x: string]: string; }): any; } +>foo14 : typeof foo14 >x : { [x: string]: string; } >b : { [x: string]: string; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { [x: string]: string; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I); ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : I >I : I function foo15(x: PA); // error ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : PA >PA : PA function foo15(x: any) { } ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : any function foo16(x: I); ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : I >I : I function foo16(x: PB); // error ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : PB >PB : PB function foo16(x: any) { } ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : any diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types index c621be1e26b..6a9d54b1062 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.types @@ -70,328 +70,328 @@ var b: { [x: string]: Derived; } = { foo: null }; >Derived : Derived function foo1(x: A); ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: A); // error ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : A >A : A function foo1(x: any) { } ->foo1 : { (x: A): any; (x: A): any; } +>foo1 : typeof foo1 >x : any function foo1b(x: B); ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: B); // error ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : B >B : B function foo1b(x: any) { } ->foo1b : { (x: B): any; (x: B): any; } +>foo1b : typeof foo1b >x : any function foo1c(x: C); ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: C); // error ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : C >C : C function foo1c(x: any) { } ->foo1c : { (x: C): any; (x: C): any; } +>foo1c : typeof foo1c >x : any function foo2(x: I); ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: I); // error ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : I >I : I function foo2(x: any) { } ->foo2 : { (x: I): any; (x: I): any; } +>foo2 : typeof foo2 >x : any function foo3(x: typeof a); ->foo3 : { (x: { [x: string]: Base; }): any; (x: { [x: string]: Base; }): any; } +>foo3 : typeof foo3 >x : { [x: string]: Base; } >a : { [x: string]: Base; } function foo3(x: typeof a); // error ->foo3 : { (x: { [x: string]: Base; }): any; (x: { [x: string]: Base; }): any; } +>foo3 : typeof foo3 >x : { [x: string]: Base; } >a : { [x: string]: Base; } function foo3(x: any) { } ->foo3 : { (x: { [x: string]: Base; }): any; (x: { [x: string]: Base; }): any; } +>foo3 : typeof foo3 >x : any function foo4(x: typeof b); ->foo4 : { (x: { [x: string]: Derived; }): any; (x: { [x: string]: Derived; }): any; } +>foo4 : typeof foo4 >x : { [x: string]: Derived; } >b : { [x: string]: Derived; } function foo4(x: typeof b); // error ->foo4 : { (x: { [x: string]: Derived; }): any; (x: { [x: string]: Derived; }): any; } +>foo4 : typeof foo4 >x : { [x: string]: Derived; } >b : { [x: string]: Derived; } function foo4(x: any) { } ->foo4 : { (x: { [x: string]: Derived; }): any; (x: { [x: string]: Derived; }): any; } +>foo4 : typeof foo4 >x : any function foo5(x: A); ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : A >A : A function foo5(x: B); // ok ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : B >B : B function foo5(x: any) { } ->foo5 : { (x: A): any; (x: B): any; } +>foo5 : typeof foo5 >x : any function foo5b(x: A); ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : A >A : A function foo5b(x: C); // ok ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : C >C : C >Derived : Derived function foo5b(x: any) { } ->foo5b : { (x: A): any; (x: C): any; } +>foo5b : typeof foo5b >x : any function foo5c(x: A); ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : A >A : A function foo5c(x: PA); // error ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : PA >PA : PA function foo5c(x: any) { } ->foo5c : { (x: A): any; (x: PA): any; } +>foo5c : typeof foo5c >x : any function foo5d(x: A); ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : A >A : A function foo5d(x: PB); // ok ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : PB >PB : PB function foo5d(x: any) { } ->foo5d : { (x: A): any; (x: PB): any; } +>foo5d : typeof foo5d >x : any function foo6(x: A); ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : A >A : A function foo6(x: I); // ok ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : I >I : I function foo6(x: any) { } ->foo6 : { (x: A): any; (x: I): any; } +>foo6 : typeof foo6 >x : any function foo7(x: A); ->foo7 : { (x: A): any; (x: { [x: string]: Base; }): any; } +>foo7 : typeof foo7 >x : A >A : A function foo7(x: typeof a); // error ->foo7 : { (x: A): any; (x: { [x: string]: Base; }): any; } +>foo7 : typeof foo7 >x : { [x: string]: Base; } >a : { [x: string]: Base; } function foo7(x: any) { } ->foo7 : { (x: A): any; (x: { [x: string]: Base; }): any; } +>foo7 : typeof foo7 >x : any function foo8(x: B); ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : B >B : B function foo8(x: I); // error ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : I >I : I function foo8(x: any) { } ->foo8 : { (x: B): any; (x: I): any; } +>foo8 : typeof foo8 >x : any function foo9(x: B); ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : B >B : B function foo9(x: C); // ok ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : C >C : C >Base : Base function foo9(x: any) { } ->foo9 : { (x: B): any; (x: C): any; } +>foo9 : typeof foo9 >x : any function foo10(x: B); ->foo10 : { (x: B): any; (x: { [x: string]: Base; }): any; } +>foo10 : typeof foo10 >x : B >B : B function foo10(x: typeof a); // ok ->foo10 : { (x: B): any; (x: { [x: string]: Base; }): any; } +>foo10 : typeof foo10 >x : { [x: string]: Base; } >a : { [x: string]: Base; } function foo10(x: any) { } ->foo10 : { (x: B): any; (x: { [x: string]: Base; }): any; } +>foo10 : typeof foo10 >x : any function foo11(x: B); ->foo11 : { (x: B): any; (x: { [x: string]: Derived; }): any; } +>foo11 : typeof foo11 >x : B >B : B function foo11(x: typeof b); // error ->foo11 : { (x: B): any; (x: { [x: string]: Derived; }): any; } +>foo11 : typeof foo11 >x : { [x: string]: Derived; } >b : { [x: string]: Derived; } function foo11(x: any) { } ->foo11 : { (x: B): any; (x: { [x: string]: Derived; }): any; } +>foo11 : typeof foo11 >x : any function foo11b(x: B); ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : B >B : B function foo11b(x: PA); // ok ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : PA >PA : PA function foo11b(x: any) { } ->foo11b : { (x: B): any; (x: PA): any; } +>foo11b : typeof foo11b >x : any function foo11c(x: B); ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : B >B : B function foo11c(x: PB); // error ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : PB >PB : PB function foo11c(x: any) { } ->foo11c : { (x: B): any; (x: PB): any; } +>foo11c : typeof foo11c >x : any function foo12(x: I); ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : I >I : I function foo12(x: C); // error ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : C >C : C >Derived : Derived function foo12(x: any) { } ->foo12 : { (x: I): any; (x: C): any; } +>foo12 : typeof foo12 >x : any function foo13(x: I); ->foo13 : { (x: I): any; (x: { [x: string]: Base; }): any; } +>foo13 : typeof foo13 >x : I >I : I function foo13(x: typeof a); // ok ->foo13 : { (x: I): any; (x: { [x: string]: Base; }): any; } +>foo13 : typeof foo13 >x : { [x: string]: Base; } >a : { [x: string]: Base; } function foo13(x: any) { } ->foo13 : { (x: I): any; (x: { [x: string]: Base; }): any; } +>foo13 : typeof foo13 >x : any function foo14(x: I); ->foo14 : { (x: I): any; (x: { [x: string]: Derived; }): any; } +>foo14 : typeof foo14 >x : I >I : I function foo14(x: typeof b); // error ->foo14 : { (x: I): any; (x: { [x: string]: Derived; }): any; } +>foo14 : typeof foo14 >x : { [x: string]: Derived; } >b : { [x: string]: Derived; } function foo14(x: any) { } ->foo14 : { (x: I): any; (x: { [x: string]: Derived; }): any; } +>foo14 : typeof foo14 >x : any function foo15(x: I); ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : I >I : I function foo15(x: PA); // ok ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : PA >PA : PA function foo15(x: any) { } ->foo15 : { (x: I): any; (x: PA): any; } +>foo15 : typeof foo15 >x : any function foo16(x: I); ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : I >I : I function foo16(x: PB); // error ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : PB >PB : PB function foo16(x: any) { } ->foo16 : { (x: I): any; (x: PB): any; } +>foo16 : typeof foo16 >x : any diff --git a/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt b/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt deleted file mode 100644 index c282d871aff..00000000000 --- a/tests/baselines/reference/octalLiteralInStrictModeES3.errors.txt +++ /dev/null @@ -1,5 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/StrictMode/octalLiteralInStrictModeES3.ts (1 errors) ==== - "use strict"; - 03; - ~~ -!!! Octal literals are not allowed in strict mode. \ No newline at end of file diff --git a/tests/baselines/reference/optionalAccessorsInInterface1.types b/tests/baselines/reference/optionalAccessorsInInterface1.types index c426cdba178..ab541bd0400 100644 --- a/tests/baselines/reference/optionalAccessorsInInterface1.types +++ b/tests/baselines/reference/optionalAccessorsInInterface1.types @@ -11,7 +11,7 @@ interface MyPropertyDescriptor { } declare function defineMyProperty(o: any, p: string, attributes: MyPropertyDescriptor): any; ->defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any +>defineMyProperty : typeof defineMyProperty >o : any >p : string >attributes : MyPropertyDescriptor @@ -19,7 +19,7 @@ declare function defineMyProperty(o: any, p: string, attributes: MyPropertyDescr defineMyProperty({}, "name", { get: function () { return 5; } }); >defineMyProperty({}, "name", { get: function () { return 5; } }) : any ->defineMyProperty : (o: any, p: string, attributes: MyPropertyDescriptor) => any +>defineMyProperty : typeof defineMyProperty >{} : {} >{ get: function () { return 5; } } : { get: () => number; } >get : () => number @@ -37,7 +37,7 @@ interface MyPropertyDescriptor2 { } declare function defineMyProperty2(o: any, p: string, attributes: MyPropertyDescriptor2): any; ->defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any +>defineMyProperty2 : typeof defineMyProperty2 >o : any >p : string >attributes : MyPropertyDescriptor2 @@ -45,7 +45,7 @@ declare function defineMyProperty2(o: any, p: string, attributes: MyPropertyDesc defineMyProperty2({}, "name", { get: function () { return 5; } }); >defineMyProperty2({}, "name", { get: function () { return 5; } }) : any ->defineMyProperty2 : (o: any, p: string, attributes: MyPropertyDescriptor2) => any +>defineMyProperty2 : typeof defineMyProperty2 >{} : {} >{ get: function () { return 5; } } : { get: () => number; } >get : () => number diff --git a/tests/baselines/reference/optionalParamReferencingOtherParams1.types b/tests/baselines/reference/optionalParamReferencingOtherParams1.types index 3a62d51759c..8170b3e95f1 100644 --- a/tests/baselines/reference/optionalParamReferencingOtherParams1.types +++ b/tests/baselines/reference/optionalParamReferencingOtherParams1.types @@ -1,6 +1,6 @@ === tests/cases/compiler/optionalParamReferencingOtherParams1.ts === function strange(x: number, y = x * 1, z = x + y) { ->strange : (x: number, y?: number, z?: number) => number +>strange : typeof strange >x : number >y : number >x * 1 : number diff --git a/tests/baselines/reference/overload2.types b/tests/baselines/reference/overload2.types index 05a9533b2d2..b52ff0579ca 100644 --- a/tests/baselines/reference/overload2.types +++ b/tests/baselines/reference/overload2.types @@ -6,18 +6,18 @@ enum B { } >B : B function foo(a: A); ->foo : { (a: A): any; (b: B): any; } +>foo : typeof foo >a : A >A : A function foo(b: B); ->foo : { (a: A): any; (b: B): any; } +>foo : typeof foo >b : B >B : B // should be ok function foo(x: number) { ->foo : { (a: A): any; (b: B): any; } +>foo : typeof foo >x : number } @@ -25,18 +25,18 @@ class C { } >C : C function foo1(a: A); ->foo1 : { (a: A): any; (c: C): any; } +>foo1 : typeof foo1 >a : A >A : A function foo1(c: C); ->foo1 : { (a: A): any; (c: C): any; } +>foo1 : typeof foo1 >c : C >C : C // should be ok function foo1(x: number) { ->foo1 : { (a: A): any; (c: C): any; } +>foo1 : typeof foo1 >x : number } diff --git a/tests/baselines/reference/overloadCrash.types b/tests/baselines/reference/overloadCrash.types index 88c2b8c79c0..3a93fcb6d53 100644 --- a/tests/baselines/reference/overloadCrash.types +++ b/tests/baselines/reference/overloadCrash.types @@ -17,12 +17,12 @@ interface I3 {a:number; b:number; c:number; d:number;}; >d : number declare function foo(...n:I1[]); ->foo : { (...n: I1[]): any; (n1: I2, n3: I2): any; } +>foo : typeof foo >n : I1[] >I1 : I1 declare function foo(n1:I2, n3:I2); ->foo : { (...n: I1[]): any; (n1: I2, n3: I2): any; } +>foo : typeof foo >n1 : I2 >I2 : I2 >n3 : I2 @@ -34,7 +34,7 @@ var i3:I3; foo(i3, i3); // should not crash the compiler :) >foo(i3, i3) : any ->foo : { (...n: I1[]): any; (n1: I2, n3: I2): any; } +>foo : typeof foo >i3 : I3 >i3 : I3 diff --git a/tests/baselines/reference/overloadEquivalenceWithStatics.types b/tests/baselines/reference/overloadEquivalenceWithStatics.types index 96ad16ae19c..f55875576c2 100644 --- a/tests/baselines/reference/overloadEquivalenceWithStatics.types +++ b/tests/baselines/reference/overloadEquivalenceWithStatics.types @@ -4,7 +4,7 @@ class A1 { >T : T static B(v: A1): A1; // 1 ->B : { (v: A1): A1; (v: S): A1; } +>B : typeof B >S : S >v : A1 >A1 : A1 @@ -13,7 +13,7 @@ static B(v: A1): A1; // 1 >S : S static B(v: S): A1; // 2 : Error Duplicate signature ->B : { (v: A1): A1; (v: S): A1; } +>B : typeof B >S : S >v : S >S : S @@ -21,7 +21,7 @@ static B(v: S): A1; // 2 : Error Duplicate signature >S : S static B(v: any): A1 { ->B : { (v: A1): A1; (v: S): A1; } +>B : typeof B >S : S >v : any >A1 : A1 diff --git a/tests/baselines/reference/overloadGenericFunctionWithRestArgs.types b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.types index 17ecdeac503..5ea89a59e9b 100644 --- a/tests/baselines/reference/overloadGenericFunctionWithRestArgs.types +++ b/tests/baselines/reference/overloadGenericFunctionWithRestArgs.types @@ -17,7 +17,7 @@ class A{ >U : U } function Choice(...v_args: T[]): A; ->Choice : (...v_args: T[]) => A +>Choice : typeof Choice >T : T >v_args : T[] >T : T @@ -25,7 +25,7 @@ function Choice(...v_args: T[]): A; >T : T function Choice(...v_args: T[]): A { ->Choice : (...v_args: T[]) => A +>Choice : typeof Choice >T : T >v_args : T[] >T : T diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.types b/tests/baselines/reference/overloadOnConstConstraintChecks2.types index c5af206c6da..d4a62b4e9a7 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.types @@ -14,22 +14,22 @@ class C extends A { >foo : () => void } function foo(name: 'hi'): B; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : typeof foo >name : 'hi' >B : B function foo(name: 'bye'): C; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : typeof foo >name : 'bye' >C : C function foo(name: string): A; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : typeof foo >name : string >A : A function foo(name: any): A { ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : typeof foo >name : any >A : A diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.types b/tests/baselines/reference/overloadOnConstConstraintChecks3.types index adc41ff235c..e3c2ead8606 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.types +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.types @@ -15,22 +15,22 @@ class C extends A { >foo : () => void } function foo(name: 'hi'): B; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : typeof foo >name : 'hi' >B : B function foo(name: 'bye'): C; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : typeof foo >name : 'bye' >C : C function foo(name: string): A; ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : typeof foo >name : string >A : A function foo(name: any): A { ->foo : { (name: 'hi'): B; (name: 'bye'): C; (name: string): A; } +>foo : typeof foo >name : any >A : A diff --git a/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.types b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.types index c0d0533a533..c69b06e5c1c 100644 --- a/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.types +++ b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.types @@ -26,13 +26,13 @@ class X2 { x: string; } >x : string function f(a: X1): A; ->f : { (a: X1): A; (a: X): B; } +>f : typeof f >a : X1 >X1 : X1 >A : A function f(a: X): B; ->f : { (a: X1): A; (a: X): B; } +>f : typeof f >T : T >a : X >X : X @@ -40,7 +40,7 @@ function f(a: X): B; >B : B function f(a): any { ->f : { (a: X1): A; (a: X): B; } +>f : typeof f >a : any } @@ -51,7 +51,7 @@ var xs: X; var t3 = f(xs); >t3 : A >f(xs) : A ->f : { (a: X1): A; (a: X): B; } +>f : typeof f >xs : X var t3: A; // should not error diff --git a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types index 4b4781948a5..1936ac54b53 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTLambdas.types @@ -8,28 +8,17 @@ module Bugs { // replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; function bug2(message:string, ...args:any[]):string { ->bug2 : (message: string, ...args: any[]) => string +>bug2 : typeof bug2 >message : string >args : any[] var result= message.replace(/\{(\d+)\}/g, function(match, ...rest) { >result : string ->message.replace(/\{(\d+)\}/g, function(match, ...rest) { - var index= rest[0]; - return typeof args[index] !== 'undefined' - ? args[index] - : match; - }) : string +>message.replace(/\{(\d+)\}/g, function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; }) : string >message.replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } >message : string >replace : { (searchValue: string, replaceValue: string): string; (searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; (searchValue: RegExp, replaceValue: string): string; (searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; } ->/\{(\d+)\}/g : RegExp ->function(match, ...rest) { - var index= rest[0]; - return typeof args[index] !== 'undefined' - ? args[index] - : match; - } : (match: string, ...rest: any[]) => any +>function(match, ...rest) { var index= rest[0]; return typeof args[index] !== 'undefined' ? args[index] : match; } : (match: string, ...rest: any[]) => any >match : string >rest : any[] @@ -39,9 +28,7 @@ module Bugs { >rest : any[] return typeof args[index] !== 'undefined' ->typeof args[index] !== 'undefined' - ? args[index] - : match : any +>typeof args[index] !== 'undefined' ? args[index] : match : any >typeof args[index] !== 'undefined' : boolean >typeof args[index] : string >args[index] : any @@ -63,25 +50,25 @@ module Bugs { } function bug3(f:(x:string)=>string) { return f("s") } ->bug3 : (f: (x: string) => string) => string +>bug3 : typeof bug3 >f : (x: string) => string >x : string >f("s") : string >f : (x: string) => string function fprime(x:string):string { return x; } ->fprime : (x: string) => string +>fprime : typeof fprime >x : string >x : string bug3(fprime); >bug3(fprime) : string ->bug3 : (f: (x: string) => string) => string ->fprime : (x: string) => string +>bug3 : typeof bug3 +>fprime : typeof fprime bug3(function(x:string):string { return x; }); >bug3(function(x:string):string { return x; }) : string ->bug3 : (f: (x: string) => string) => string +>bug3 : typeof bug3 >function(x:string):string { return x; } : (x: string) => string >x : string >x : string diff --git a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types index 6bc491fd157..0a13b0084c1 100644 --- a/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types +++ b/tests/baselines/reference/overloadResolutionOverNonCTObjectLit.types @@ -32,7 +32,7 @@ module Bugs { } function bug3() { ->bug3 : () => void +>bug3 : typeof bug3 var tokens:IToken[]= []; >tokens : IToken[] diff --git a/tests/baselines/reference/overloadReturnTypes.types b/tests/baselines/reference/overloadReturnTypes.types index 1823c752ae7..125bca016d4 100644 --- a/tests/baselines/reference/overloadReturnTypes.types +++ b/tests/baselines/reference/overloadReturnTypes.types @@ -3,22 +3,22 @@ class Accessor {} >Accessor : Accessor function attr(name: string): string; ->attr : { (name: string): string; (name: string, value: string): Accessor; (map: any): Accessor; } +>attr : typeof attr >name : string function attr(name: string, value: string): Accessor; ->attr : { (name: string): string; (name: string, value: string): Accessor; (map: any): Accessor; } +>attr : typeof attr >name : string >value : string >Accessor : Accessor function attr(map: any): Accessor; ->attr : { (name: string): string; (name: string, value: string): Accessor; (map: any): Accessor; } +>attr : typeof attr >map : any >Accessor : Accessor function attr(nameOrMap: any, value?: string): any { ->attr : { (name: string): string; (name: string, value: string): Accessor; (map: any): Accessor; } +>attr : typeof attr >nameOrMap : any >value : string diff --git a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types index 2ed804ad012..dec652bc677 100644 --- a/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types +++ b/tests/baselines/reference/overloadWithCallbacksWithDifferingOptionalityOnArgs.types @@ -1,27 +1,27 @@ === tests/cases/compiler/overloadWithCallbacksWithDifferingOptionalityOnArgs.ts === function x2(callback: (x?: number) => number); ->x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } +>x2 : typeof x2 >callback : (x?: number) => number >x : number function x2(callback: (x: string) => number); ->x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } +>x2 : typeof x2 >callback : (x: string) => number >x : string function x2(callback: (x: any) => number) { } ->x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } +>x2 : typeof x2 >callback : (x: any) => number >x : any x2(() => 1); >x2(() => 1) : any ->x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } +>x2 : typeof x2 >() => 1 : () => number x2((x) => 1 ); >x2((x) => 1 ) : any ->x2 : { (callback: (x?: number) => number): any; (callback: (x: string) => number): any; } +>x2 : typeof x2 >(x) => 1 : (x: number) => number >x : number diff --git a/tests/baselines/reference/overloadedStaticMethodSpecialization.types b/tests/baselines/reference/overloadedStaticMethodSpecialization.types index bd60fc16fe0..9884a008e81 100644 --- a/tests/baselines/reference/overloadedStaticMethodSpecialization.types +++ b/tests/baselines/reference/overloadedStaticMethodSpecialization.types @@ -4,7 +4,7 @@ class A { >T : T static B(v: A): A; ->B : { (v: A): A; (v: S): A; } +>B : typeof B >S : S >v : A >A : A @@ -13,7 +13,7 @@ class A { >S : S static B(v: S): A; ->B : { (v: A): A; (v: S): A; } +>B : typeof B >S : S >v : S >S : S @@ -21,7 +21,7 @@ class A { >S : S static B(v: any): A { ->B : { (v: A): A; (v: S): A; } +>B : typeof B >S : S >v : any >A : A diff --git a/tests/baselines/reference/overloadsAndTypeArgumentArity.types b/tests/baselines/reference/overloadsAndTypeArgumentArity.types index 1b76b8e13fe..b7ac883b837 100644 --- a/tests/baselines/reference/overloadsAndTypeArgumentArity.types +++ b/tests/baselines/reference/overloadsAndTypeArgumentArity.types @@ -1,21 +1,21 @@ === tests/cases/compiler/overloadsAndTypeArgumentArity.ts === declare function Callbacks(flags?: string): void; ->Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>Callbacks : typeof Callbacks >flags : string declare function Callbacks(flags?: string): void; ->Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>Callbacks : typeof Callbacks >T : T >flags : string declare function Callbacks(flags?: string): void; ->Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>Callbacks : typeof Callbacks >T1 : T1 >T2 : T2 >flags : string declare function Callbacks(flags?: string): void; ->Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>Callbacks : typeof Callbacks >T1 : T1 >T2 : T2 >T3 : T3 @@ -23,9 +23,9 @@ declare function Callbacks(flags?: string): void; Callbacks('s'); // no error >Callbacks('s') : void ->Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>Callbacks : typeof Callbacks new Callbacks('s'); // no error >new Callbacks('s') : any ->Callbacks : { (flags?: string): void; (flags?: string): void; (flags?: string): void; (flags?: string): void; } +>Callbacks : typeof Callbacks diff --git a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt deleted file mode 100644 index 06bd4d0f62d..00000000000 --- a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -==== tests/cases/compiler/overloadsInDifferentContainersDisagreeOnAmbient.ts (1 errors) ==== - declare module M { - // Error because body is not ambient and this overload is - export function f(); - } - - module M { - export function f() { } - ~ -!!! Overload signatures must all be ambient or non-ambient. - } \ No newline at end of file diff --git a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js b/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js deleted file mode 100644 index 4d0ac15c717..00000000000 --- a/tests/baselines/reference/overloadsInDifferentContainersDisagreeOnAmbient.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [overloadsInDifferentContainersDisagreeOnAmbient.ts] -declare module M { - // Error because body is not ambient and this overload is - export function f(); -} - -module M { - export function f() { } -} - -//// [overloadsInDifferentContainersDisagreeOnAmbient.js] -var M; -(function (M) { - function f() { - } - M.f = f; -})(M || (M = {})); diff --git a/tests/baselines/reference/parametersWithNoAnnotationAreAny.types b/tests/baselines/reference/parametersWithNoAnnotationAreAny.types index 72fd2cb64be..791ab04550e 100644 --- a/tests/baselines/reference/parametersWithNoAnnotationAreAny.types +++ b/tests/baselines/reference/parametersWithNoAnnotationAreAny.types @@ -1,6 +1,6 @@ === tests/cases/conformance/types/objectTypeLiteral/callSignatures/parametersWithNoAnnotationAreAny.ts === function foo(x) { return x; } ->foo : (x: any) => any +>foo : typeof foo >x : any >x : any @@ -59,21 +59,11 @@ var a: { var b = { >b : { foo: (x: any) => any; a: (x: any) => any; b: (x: any) => any; } ->{ - foo(x) { - return x; - }, - a: function foo(x) { - return x; - }, - b: (x) => x -} : { foo: (x: any) => any; a: (x: any) => any; b: (x: any) => any; } +>{ foo(x) { return x; }, a: function foo(x) { return x; }, b: (x) => x} : { foo: (x: any) => any; a: (x: any) => any; b: (x: any) => any; } foo(x) { >foo : (x: any) => any ->foo(x) { - return x; - } : (x: any) => any +>foo(x) { return x; } : (x: any) => any >x : any return x; @@ -82,9 +72,7 @@ var b = { }, a: function foo(x) { >a : (x: any) => any ->function foo(x) { - return x; - } : (x: any) => any +>function foo(x) { return x; } : (x: any) => any >foo : (x: any) => any >x : any diff --git a/tests/baselines/reference/parser579071.types b/tests/baselines/reference/parser579071.types index bfdece6f787..6ae9576c036 100644 --- a/tests/baselines/reference/parser579071.types +++ b/tests/baselines/reference/parser579071.types @@ -1,5 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser579071.ts === var x = /fo(o/; >x : RegExp ->/fo(o/ : RegExp diff --git a/tests/baselines/reference/parser596700.types b/tests/baselines/reference/parser596700.types index b14e28be716..d92d4b68ef5 100644 --- a/tests/baselines/reference/parser596700.types +++ b/tests/baselines/reference/parser596700.types @@ -1,5 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser596700.ts === var regex2 = /[a-z/]$/i; >regex2 : RegExp ->/[a-z/]$/i : RegExp diff --git a/tests/baselines/reference/parser630933.types b/tests/baselines/reference/parser630933.types index 5134bda8c1f..4b1686fcbf2 100644 --- a/tests/baselines/reference/parser630933.types +++ b/tests/baselines/reference/parser630933.types @@ -8,5 +8,4 @@ var b = a.match(/\/ver=([^/]+)/); >a.match : { (regexp: string): RegExpMatchArray; (regexp: RegExp): RegExpMatchArray; } >a : string >match : { (regexp: string): RegExpMatchArray; (regexp: RegExp): RegExpMatchArray; } ->/\/ver=([^/]+)/ : RegExp diff --git a/tests/baselines/reference/parser645086_3.types b/tests/baselines/reference/parser645086_3.types index 8cf6c0e73a5..57ca07e1b2a 100644 --- a/tests/baselines/reference/parser645086_3.types +++ b/tests/baselines/reference/parser645086_3.types @@ -1,5 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_3.ts === var v = /[\]/]/ >v : RegExp ->/[\]/]/ : RegExp diff --git a/tests/baselines/reference/parser645086_4.types b/tests/baselines/reference/parser645086_4.types index a7c00b04fce..01a702e2a06 100644 --- a/tests/baselines/reference/parser645086_4.types +++ b/tests/baselines/reference/parser645086_4.types @@ -1,5 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_4.ts === var v = /[^\]/]/ >v : RegExp ->/[^\]/]/ : RegExp diff --git a/tests/baselines/reference/parser768531.types b/tests/baselines/reference/parser768531.types index 43b5dbfa547..2da2298c8e2 100644 --- a/tests/baselines/reference/parser768531.types +++ b/tests/baselines/reference/parser768531.types @@ -1,5 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/Fuzz/parser768531.ts === {a: 3} -/x/ ->/x/ : RegExp - +No type information for this code./x/ +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic11.types b/tests/baselines/reference/parserAccessibilityAfterStatic11.types index c3b3699bb27..d1be9d1e3c5 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic11.types +++ b/tests/baselines/reference/parserAccessibilityAfterStatic11.types @@ -3,6 +3,6 @@ class Outer >Outer : Outer { static public() {} ->public : () => void +>public : typeof public } diff --git a/tests/baselines/reference/parserAccessibilityAfterStatic14.types b/tests/baselines/reference/parserAccessibilityAfterStatic14.types index 6b4cff3e17f..547ad1baadb 100644 --- a/tests/baselines/reference/parserAccessibilityAfterStatic14.types +++ b/tests/baselines/reference/parserAccessibilityAfterStatic14.types @@ -3,7 +3,7 @@ class Outer >Outer : Outer { static public() {} ->public : () => void +>public : typeof public >T : T } diff --git a/tests/baselines/reference/parserAccessors1.errors.txt b/tests/baselines/reference/parserAccessors1.errors.txt index 76747e37104..3059fd7c506 100644 --- a/tests/baselines/reference/parserAccessors1.errors.txt +++ b/tests/baselines/reference/parserAccessors1.errors.txt @@ -1,6 +1,8 @@ -==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors1.ts (2 errors) ==== class C { get Foo() { } ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors1.js b/tests/baselines/reference/parserAccessors1.js deleted file mode 100644 index b4cc809e7b2..00000000000 --- a/tests/baselines/reference/parserAccessors1.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserAccessors1.ts] -class C { - get Foo() { } -} - -//// [parserAccessors1.js] -var C = (function () { - function C() { - } - Object.defineProperty(C.prototype, "Foo", { - get: function () { - }, - enumerable: true, - configurable: true - }); - return C; -})(); diff --git a/tests/baselines/reference/parserES3Accessors2.errors.txt b/tests/baselines/reference/parserAccessors2.errors.txt similarity index 54% rename from tests/baselines/reference/parserES3Accessors2.errors.txt rename to tests/baselines/reference/parserAccessors2.errors.txt index 13fd8c37b0f..80878ab0ab8 100644 --- a/tests/baselines/reference/parserES3Accessors2.errors.txt +++ b/tests/baselines/reference/parserAccessors2.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors2.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors2.ts (1 errors) ==== class C { set Foo(a) { } ~~~ diff --git a/tests/baselines/reference/parserAccessors2.js b/tests/baselines/reference/parserAccessors2.js deleted file mode 100644 index 71cbd6f466b..00000000000 --- a/tests/baselines/reference/parserAccessors2.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserAccessors2.ts] -class C { - set Foo(a) { } -} - -//// [parserAccessors2.js] -var C = (function () { - function C() { - } - Object.defineProperty(C.prototype, "Foo", { - set: function (a) { - }, - enumerable: true, - configurable: true - }); - return C; -})(); diff --git a/tests/baselines/reference/parserAccessors2.types b/tests/baselines/reference/parserAccessors2.types deleted file mode 100644 index 9a0d9b0fdaa..00000000000 --- a/tests/baselines/reference/parserAccessors2.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors2.ts === -class C { ->C : C - - set Foo(a) { } ->Foo : any ->a : any -} diff --git a/tests/baselines/reference/parserAccessors3.errors.txt b/tests/baselines/reference/parserAccessors3.errors.txt index dd1f2075ae6..a709168b0e0 100644 --- a/tests/baselines/reference/parserAccessors3.errors.txt +++ b/tests/baselines/reference/parserAccessors3.errors.txt @@ -1,4 +1,6 @@ -==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors3.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors3.ts (2 errors) ==== var v = { get Foo() { } }; ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors3.js b/tests/baselines/reference/parserAccessors3.js deleted file mode 100644 index 68d8ec15e63..00000000000 --- a/tests/baselines/reference/parserAccessors3.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [parserAccessors3.ts] -var v = { get Foo() { } }; - -//// [parserAccessors3.js] -var v = { get Foo() { -} }; diff --git a/tests/baselines/reference/parserES3Accessors4.errors.txt b/tests/baselines/reference/parserAccessors4.errors.txt similarity index 52% rename from tests/baselines/reference/parserES3Accessors4.errors.txt rename to tests/baselines/reference/parserAccessors4.errors.txt index 04de4d3c7fc..46569ff83a2 100644 --- a/tests/baselines/reference/parserES3Accessors4.errors.txt +++ b/tests/baselines/reference/parserAccessors4.errors.txt @@ -1,4 +1,4 @@ -==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors4.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors4.ts (1 errors) ==== var v = { set Foo(a) { } }; ~~~ !!! Accessors are only available when targeting ECMAScript 5 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors4.js b/tests/baselines/reference/parserAccessors4.js deleted file mode 100644 index 9ebd1f0e82e..00000000000 --- a/tests/baselines/reference/parserAccessors4.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [parserAccessors4.ts] -var v = { set Foo(a) { } }; - -//// [parserAccessors4.js] -var v = { set Foo(a) { -} }; diff --git a/tests/baselines/reference/parserAccessors4.types b/tests/baselines/reference/parserAccessors4.types deleted file mode 100644 index d2db232d796..00000000000 --- a/tests/baselines/reference/parserAccessors4.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors4.ts === -var v = { set Foo(a) { } }; ->v : { Foo: any; } ->{ set Foo(a) { } } : { Foo: any; } ->Foo : any ->a : any - diff --git a/tests/baselines/reference/parserAccessors5.errors.txt b/tests/baselines/reference/parserAccessors5.errors.txt index af7de2497f8..7be1d3c8184 100644 --- a/tests/baselines/reference/parserAccessors5.errors.txt +++ b/tests/baselines/reference/parserAccessors5.errors.txt @@ -2,5 +2,5 @@ declare class C { get foo() { return 0; } ~~~ -!!! An accessor cannot be declared in an ambient context. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors6.errors.txt b/tests/baselines/reference/parserAccessors6.errors.txt index 3b1e8d658ae..81690486f07 100644 --- a/tests/baselines/reference/parserAccessors6.errors.txt +++ b/tests/baselines/reference/parserAccessors6.errors.txt @@ -2,5 +2,5 @@ declare class C { set foo(v) { } ~~~ -!!! An accessor cannot be declared in an ambient context. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors7.errors.txt b/tests/baselines/reference/parserAccessors7.errors.txt index cac6f016814..9fc027e8e39 100644 --- a/tests/baselines/reference/parserAccessors7.errors.txt +++ b/tests/baselines/reference/parserAccessors7.errors.txt @@ -1,6 +1,6 @@ ==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors7.ts (2 errors) ==== var v = { get foo(v: number) { } }; ~~~ -!!! A 'get' accessor cannot have parameters. +!!! Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors8.errors.txt b/tests/baselines/reference/parserAccessors8.errors.txt index 17fbd54bd82..1b5968ac460 100644 --- a/tests/baselines/reference/parserAccessors8.errors.txt +++ b/tests/baselines/reference/parserAccessors8.errors.txt @@ -1,4 +1,4 @@ ==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors8.ts (1 errors) ==== var v = { set foo() { } } ~~~ -!!! A 'set' accessor must have exactly one parameter. \ No newline at end of file +!!! Accessors are only available when targeting ECMAScript 5 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/parserAccessors9.errors.txt b/tests/baselines/reference/parserAccessors9.errors.txt index 5b45fca62a7..6de8ef82f21 100644 --- a/tests/baselines/reference/parserAccessors9.errors.txt +++ b/tests/baselines/reference/parserAccessors9.errors.txt @@ -1,4 +1,4 @@ ==== tests/cases/conformance/parser/ecmascript5/Accessors/parserAccessors9.ts (1 errors) ==== var v = { set foo(a, b) { } } ~~~ -!!! A 'set' accessor must have exactly one parameter. \ No newline at end of file +!!! Accessors are only available when targeting ECMAScript 5 and higher. \ No newline at end of file diff --git a/tests/baselines/reference/parserAssignmentExpression1.errors.txt b/tests/baselines/reference/parserAssignmentExpression1.errors.txt deleted file mode 100644 index 5e2b65cd977..00000000000 --- a/tests/baselines/reference/parserAssignmentExpression1.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/Expressions/parserAssignmentExpression1.ts (3 errors) ==== - (foo()) = bar; - ~~~~~~~ -!!! Invalid left-hand side of assignment expression. - ~~~ -!!! Cannot find name 'foo'. - ~~~ -!!! Cannot find name 'bar'. \ No newline at end of file diff --git a/tests/baselines/reference/parserAssignmentExpression1.js b/tests/baselines/reference/parserAssignmentExpression1.js deleted file mode 100644 index f6dfa5d3956..00000000000 --- a/tests/baselines/reference/parserAssignmentExpression1.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [parserAssignmentExpression1.ts] -(foo()) = bar; - -//// [parserAssignmentExpression1.js] -(foo()) = bar; diff --git a/tests/baselines/reference/parserConstructorDeclaration11.errors.txt b/tests/baselines/reference/parserConstructorDeclaration11.errors.txt deleted file mode 100644 index 1a516bcc668..00000000000 --- a/tests/baselines/reference/parserConstructorDeclaration11.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/ConstructorDeclarations/parserConstructorDeclaration11.ts (2 errors) ==== - class C { - constructor<>() { } - ~~ -!!! Type parameter list cannot be empty. - -!!! Type parameters cannot appear on a constructor declaration. - } \ No newline at end of file diff --git a/tests/baselines/reference/parserDoStatement2.js b/tests/baselines/reference/parserDoStatement2.js deleted file mode 100644 index 9febdc60865..00000000000 --- a/tests/baselines/reference/parserDoStatement2.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [parserDoStatement2.ts] -do{;}while(false)false - -//// [parserDoStatement2.js] -do { - ; -} while (false); -false; diff --git a/tests/baselines/reference/parserDoStatement2.types b/tests/baselines/reference/parserDoStatement2.types deleted file mode 100644 index 62790b49103..00000000000 --- a/tests/baselines/reference/parserDoStatement2.types +++ /dev/null @@ -1,3 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/Statements/parserDoStatement2.ts === -do{;}while(false)false -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserES3Accessors1.errors.txt b/tests/baselines/reference/parserES3Accessors1.errors.txt deleted file mode 100644 index 53bfc5e868e..00000000000 --- a/tests/baselines/reference/parserES3Accessors1.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors1.ts (2 errors) ==== - class C { - get Foo() { } - ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. - ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. - } \ No newline at end of file diff --git a/tests/baselines/reference/parserES3Accessors3.errors.txt b/tests/baselines/reference/parserES3Accessors3.errors.txt deleted file mode 100644 index 74a79ccf6d8..00000000000 --- a/tests/baselines/reference/parserES3Accessors3.errors.txt +++ /dev/null @@ -1,6 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript3/Accessors/parserES3Accessors3.ts (2 errors) ==== - var v = { get Foo() { } }; - ~~~ -!!! Accessors are only available when targeting ECMAScript 5 and higher. - ~~~ -!!! A 'get' accessor must return a value or consist of a single 'throw' statement. \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause6.errors.txt b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause6.errors.txt deleted file mode 100644 index 7efe1e42167..00000000000 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause6.errors.txt +++ /dev/null @@ -1,4 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause6.ts (1 errors) ==== - interface I extends { } - ~~~~~~~ -!!! 'extends' list cannot be empty. \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement4.errors.txt b/tests/baselines/reference/parserForStatement4.errors.txt deleted file mode 100644 index 923b05341b5..00000000000 --- a/tests/baselines/reference/parserForStatement4.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement4.ts (3 errors) ==== - for (a = 1 in b) { - ~ -!!! Cannot find name 'a'. - ~~~~~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. - ~ -!!! Cannot find name 'b'. - } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement4.js b/tests/baselines/reference/parserForStatement4.js deleted file mode 100644 index 9da13b387d0..00000000000 --- a/tests/baselines/reference/parserForStatement4.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserForStatement4.ts] -for (a = 1 in b) { -} - -//// [parserForStatement4.js] -for (a = 1 in b) { -} diff --git a/tests/baselines/reference/parserForStatement5.errors.txt b/tests/baselines/reference/parserForStatement5.errors.txt deleted file mode 100644 index e1d52c58ab6..00000000000 --- a/tests/baselines/reference/parserForStatement5.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement5.ts (2 errors) ==== - for ({} in b) { - ~~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. - ~ -!!! Cannot find name 'b'. - } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement5.js b/tests/baselines/reference/parserForStatement5.js deleted file mode 100644 index 8c6b12b8c18..00000000000 --- a/tests/baselines/reference/parserForStatement5.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserForStatement5.ts] -for ({} in b) { -} - -//// [parserForStatement5.js] -for ({} in b) { -} diff --git a/tests/baselines/reference/parserForStatement6.errors.txt b/tests/baselines/reference/parserForStatement6.errors.txt deleted file mode 100644 index cb758f34359..00000000000 --- a/tests/baselines/reference/parserForStatement6.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement6.ts (3 errors) ==== - for (foo() in b) { - ~~~ -!!! Cannot find name 'foo'. - ~~~~~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. - ~ -!!! Cannot find name 'b'. - } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement6.js b/tests/baselines/reference/parserForStatement6.js deleted file mode 100644 index d05ee600b35..00000000000 --- a/tests/baselines/reference/parserForStatement6.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserForStatement6.ts] -for (foo() in b) { -} - -//// [parserForStatement6.js] -for (foo() in b) { -} diff --git a/tests/baselines/reference/parserForStatement7.errors.txt b/tests/baselines/reference/parserForStatement7.errors.txt deleted file mode 100644 index 0b1eeba1e05..00000000000 --- a/tests/baselines/reference/parserForStatement7.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement7.ts (3 errors) ==== - for (new foo() in b) { - ~~~~~~~~~ -!!! The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. - ~~~ -!!! Cannot find name 'foo'. - ~ -!!! Cannot find name 'b'. - } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement7.js b/tests/baselines/reference/parserForStatement7.js deleted file mode 100644 index a5c149131c8..00000000000 --- a/tests/baselines/reference/parserForStatement7.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserForStatement7.ts] -for (new foo() in b) { -} - -//// [parserForStatement7.js] -for (new foo() in b) { -} diff --git a/tests/baselines/reference/parserForStatement8.errors.txt b/tests/baselines/reference/parserForStatement8.errors.txt deleted file mode 100644 index f374f6935aa..00000000000 --- a/tests/baselines/reference/parserForStatement8.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/Statements/parserForStatement8.ts (2 errors) ==== - for (this in b) { - ~~~~ -!!! Invalid left-hand side in 'for...in' statement. - ~ -!!! Cannot find name 'b'. - } \ No newline at end of file diff --git a/tests/baselines/reference/parserForStatement8.js b/tests/baselines/reference/parserForStatement8.js deleted file mode 100644 index 3f2bd697e58..00000000000 --- a/tests/baselines/reference/parserForStatement8.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [parserForStatement8.ts] -for (this in b) { -} - -//// [parserForStatement8.js] -for (this in b) { -} diff --git a/tests/baselines/reference/parserFunctionDeclaration1.d.types b/tests/baselines/reference/parserFunctionDeclaration1.d.types index cb62ab01c90..732188e3e8b 100644 --- a/tests/baselines/reference/parserFunctionDeclaration1.d.types +++ b/tests/baselines/reference/parserFunctionDeclaration1.d.types @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration1.d.ts === declare function F(); ->F : () => any +>F : typeof F diff --git a/tests/baselines/reference/parserFunctionDeclaration5.types b/tests/baselines/reference/parserFunctionDeclaration5.types index a3cf71336ea..2d48c8f5d1a 100644 --- a/tests/baselines/reference/parserFunctionDeclaration5.types +++ b/tests/baselines/reference/parserFunctionDeclaration5.types @@ -1,7 +1,7 @@ === tests/cases/conformance/parser/ecmascript5/FunctionDeclarations/parserFunctionDeclaration5.ts === function foo(); ->foo : () => any +>foo : typeof foo function foo() { } ->foo : () => any +>foo : typeof foo diff --git a/tests/baselines/reference/parserFunctionDeclaration8.types b/tests/baselines/reference/parserFunctionDeclaration8.types index ebb8ff8d409..15a8721932d 100644 --- a/tests/baselines/reference/parserFunctionDeclaration8.types +++ b/tests/baselines/reference/parserFunctionDeclaration8.types @@ -3,5 +3,5 @@ declare module M { >M : typeof M function foo(); ->foo : () => any +>foo : typeof foo } diff --git a/tests/baselines/reference/parserGetAccessorWithTypeParameters1.errors.txt b/tests/baselines/reference/parserGetAccessorWithTypeParameters1.errors.txt index 0f290dbd8ab..8af4097341b 100644 --- a/tests/baselines/reference/parserGetAccessorWithTypeParameters1.errors.txt +++ b/tests/baselines/reference/parserGetAccessorWithTypeParameters1.errors.txt @@ -2,7 +2,7 @@ class C { get foo() { } ~~~ -!!! An accessor cannot have type parameters. +!!! Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types index 09626481336..f58be05c966 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity10.types @@ -1,9 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity10.ts === 1 ->1 -// before ->>> // after -2 : number +>1 // before>>> // after2 : number // before >>> // after diff --git a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types index e62528a1e1f..770d3fa611f 100644 --- a/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types +++ b/tests/baselines/reference/parserGreaterThanTokenAmbiguity5.types @@ -1,9 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserGreaterThanTokenAmbiguity5.ts === 1 ->1 -// before ->> // after -2 : number +>1 // before>> // after2 : number // before >> // after diff --git a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types index e940f534c1e..e917dc76cf0 100644 --- a/tests/baselines/reference/parserKeywordsAsIdentifierName1.types +++ b/tests/baselines/reference/parserKeywordsAsIdentifierName1.types @@ -1,11 +1,7 @@ === tests/cases/conformance/parser/ecmascript5/parserKeywordsAsIdentifierName1.ts === var big = { >big : { break: number; super: number; const: number; } ->{ - break : 0, - super : 0, - const : 0 -} : { break: number; super: number; const: number; } +>{ break : 0, super : 0, const : 0} : { break: number; super: number; const: number; } break : 0, >break : number diff --git a/tests/baselines/reference/parserKeywordsAsIdentifierName2.errors.txt b/tests/baselines/reference/parserKeywordsAsIdentifierName2.errors.txt index 41b5ab32f89..ca8bde2f068 100644 --- a/tests/baselines/reference/parserKeywordsAsIdentifierName2.errors.txt +++ b/tests/baselines/reference/parserKeywordsAsIdentifierName2.errors.txt @@ -1,5 +1,5 @@ ==== tests/cases/conformance/parser/ecmascript5/parserKeywordsAsIdentifierName2.ts (2 errors) ==== - // 'public' should be marked unusable, should complain on trailing /* + // 'public' shoudl be marked unusable because it has a trailing /* a.public /* !!! '*/' expected. diff --git a/tests/baselines/reference/parserMemberAccessor1.errors.txt b/tests/baselines/reference/parserMemberAccessor1.errors.txt index c768b0ce2fe..59e39b490c8 100644 --- a/tests/baselines/reference/parserMemberAccessor1.errors.txt +++ b/tests/baselines/reference/parserMemberAccessor1.errors.txt @@ -1,7 +1,11 @@ -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessor1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessor1.ts (3 errors) ==== class C { get foo() { } ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. set foo(a) { } + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessor1.js b/tests/baselines/reference/parserMemberAccessor1.js deleted file mode 100644 index 3d4690d58e9..00000000000 --- a/tests/baselines/reference/parserMemberAccessor1.js +++ /dev/null @@ -1,20 +0,0 @@ -//// [parserMemberAccessor1.ts] -class C { - get foo() { } - set foo(a) { } -} - -//// [parserMemberAccessor1.js] -var C = (function () { - function C() { - } - Object.defineProperty(C.prototype, "foo", { - get: function () { - }, - set: function (a) { - }, - enumerable: true, - configurable: true - }); - return C; -})(); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration1.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration1.errors.txt index 403a30a67ae..0cb6526b2ad 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration1.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration1.errors.txt @@ -1,6 +1,8 @@ -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration1.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration1.ts (2 errors) ==== class C { get a() { } ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration1.js b/tests/baselines/reference/parserMemberAccessorDeclaration1.js deleted file mode 100644 index 1f0b5eb3bd9..00000000000 --- a/tests/baselines/reference/parserMemberAccessorDeclaration1.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserMemberAccessorDeclaration1.ts] -class C { - get a() { } -} - -//// [parserMemberAccessorDeclaration1.js] -var C = (function () { - function C() { - } - Object.defineProperty(C.prototype, "a", { - get: function () { - }, - enumerable: true, - configurable: true - }); - return C; -})(); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration10.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration10.errors.txt index a1b29085f5d..b0a0c583d54 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration10.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration10.errors.txt @@ -1,8 +1,10 @@ -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration10.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration10.ts (3 errors) ==== class C { export get Foo() { } ~~~~~~ !!! 'export' modifier cannot appear on a class element. ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration11.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration11.errors.txt index 6d3e1651273..1e8324f4e60 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration11.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration11.errors.txt @@ -1,6 +1,8 @@ -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration11.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration11.ts (2 errors) ==== class C { declare get Foo() { } ~~~~~~~ !!! 'declare' modifier cannot appear on a class element. + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration12.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration12.errors.txt index 7cbf2606274..0c0990b37e5 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration12.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration12.errors.txt @@ -2,7 +2,7 @@ class C { get Foo(a: number) { } ~~~ -!!! A 'get' accessor cannot have parameters. +!!! Accessors are only available when targeting ECMAScript 5 and higher. ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration13.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration13.errors.txt index b891866c684..dd8eb7b4147 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration13.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration13.errors.txt @@ -2,5 +2,5 @@ class C { set Foo() { } ~~~ -!!! A 'set' accessor must have exactly one parameter. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration14.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration14.errors.txt index 6d49231ce08..95ede4f9764 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration14.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration14.errors.txt @@ -2,5 +2,5 @@ class C { set Foo(a: number, b: number) { } ~~~ -!!! A 'set' accessor must have exactly one parameter. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration15.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration15.errors.txt index ae659f7f464..35b762e1e26 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration15.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration15.errors.txt @@ -2,7 +2,7 @@ class C { set Foo(public a: number) { } ~~~ -!!! A parameter property is only allowed in a constructor implementation. +!!! Accessors are only available when targeting ECMAScript 5 and higher. ~~~~~~~~~~~~~~~~ !!! A parameter property is only allowed in a constructor implementation. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration16.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration16.errors.txt index 7505ca7a68b..1f78f88831f 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration16.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration16.errors.txt @@ -2,5 +2,5 @@ class C { set Foo(a = 1) { } ~~~ -!!! A 'set' accessor parameter cannot have an initializer. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration17.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration17.errors.txt index b2f34a5d348..bd2af9040f7 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration17.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration17.errors.txt @@ -2,5 +2,5 @@ class C { set Foo(a?: number) { } ~~~ -!!! A 'set' accessor cannot have an optional parameter. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration18.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration18.errors.txt index d7ea5ac0188..6c798ed48dc 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration18.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration18.errors.txt @@ -2,5 +2,5 @@ class C { set Foo(...a) { } ~~~ -!!! A 'set' accessor cannot have rest parameter. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration2.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration2.errors.txt index 1a32d342f1b..3a54a437ec0 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration2.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration2.errors.txt @@ -1,6 +1,8 @@ -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration2.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration2.ts (2 errors) ==== class C { get "b"() { } ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration2.js b/tests/baselines/reference/parserMemberAccessorDeclaration2.js deleted file mode 100644 index 00cc2812014..00000000000 --- a/tests/baselines/reference/parserMemberAccessorDeclaration2.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserMemberAccessorDeclaration2.ts] -class C { - get "b"() { } -} - -//// [parserMemberAccessorDeclaration2.js] -var C = (function () { - function C() { - } - Object.defineProperty(C.prototype, "b", { - get: function () { - }, - enumerable: true, - configurable: true - }); - return C; -})(); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration3.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration3.errors.txt index dbf94b6420f..bd30a29dc52 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration3.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration3.errors.txt @@ -1,6 +1,8 @@ -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration3.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration3.ts (2 errors) ==== class C { get 0() { } ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration3.js b/tests/baselines/reference/parserMemberAccessorDeclaration3.js deleted file mode 100644 index 86fc2c3e532..00000000000 --- a/tests/baselines/reference/parserMemberAccessorDeclaration3.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserMemberAccessorDeclaration3.ts] -class C { - get 0() { } -} - -//// [parserMemberAccessorDeclaration3.js] -var C = (function () { - function C() { - } - Object.defineProperty(C.prototype, "0", { - get: function () { - }, - enumerable: true, - configurable: true - }); - return C; -})(); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration4.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration4.errors.txt new file mode 100644 index 00000000000..30d2b4e437b --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration4.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration4.ts (1 errors) ==== + class C { + set a(i) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration4.js b/tests/baselines/reference/parserMemberAccessorDeclaration4.js deleted file mode 100644 index 552c2c1d27a..00000000000 --- a/tests/baselines/reference/parserMemberAccessorDeclaration4.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserMemberAccessorDeclaration4.ts] -class C { - set a(i) { } -} - -//// [parserMemberAccessorDeclaration4.js] -var C = (function () { - function C() { - } - Object.defineProperty(C.prototype, "a", { - set: function (i) { - }, - enumerable: true, - configurable: true - }); - return C; -})(); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration4.types b/tests/baselines/reference/parserMemberAccessorDeclaration4.types deleted file mode 100644 index de4bc245d2e..00000000000 --- a/tests/baselines/reference/parserMemberAccessorDeclaration4.types +++ /dev/null @@ -1,8 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration4.ts === -class C { ->C : C - - set a(i) { } ->a : any ->i : any -} diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration5.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration5.errors.txt new file mode 100644 index 00000000000..6fa083c4df8 --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration5.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration5.ts (1 errors) ==== + class C { + set "a"(i) { } + ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration5.js b/tests/baselines/reference/parserMemberAccessorDeclaration5.js deleted file mode 100644 index 309df8b68ec..00000000000 --- a/tests/baselines/reference/parserMemberAccessorDeclaration5.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserMemberAccessorDeclaration5.ts] -class C { - set "a"(i) { } -} - -//// [parserMemberAccessorDeclaration5.js] -var C = (function () { - function C() { - } - Object.defineProperty(C.prototype, "a", { - set: function (i) { - }, - enumerable: true, - configurable: true - }); - return C; -})(); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration5.types b/tests/baselines/reference/parserMemberAccessorDeclaration5.types deleted file mode 100644 index d22ee2d775a..00000000000 --- a/tests/baselines/reference/parserMemberAccessorDeclaration5.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration5.ts === -class C { ->C : C - - set "a"(i) { } ->i : any -} diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration6.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration6.errors.txt new file mode 100644 index 00000000000..18c6675eac1 --- /dev/null +++ b/tests/baselines/reference/parserMemberAccessorDeclaration6.errors.txt @@ -0,0 +1,6 @@ +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration6.ts (1 errors) ==== + class C { + set 0(i) { } + ~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration6.js b/tests/baselines/reference/parserMemberAccessorDeclaration6.js deleted file mode 100644 index 0b44673f146..00000000000 --- a/tests/baselines/reference/parserMemberAccessorDeclaration6.js +++ /dev/null @@ -1,17 +0,0 @@ -//// [parserMemberAccessorDeclaration6.ts] -class C { - set 0(i) { } -} - -//// [parserMemberAccessorDeclaration6.js] -var C = (function () { - function C() { - } - Object.defineProperty(C.prototype, "0", { - set: function (i) { - }, - enumerable: true, - configurable: true - }); - return C; -})(); diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration6.types b/tests/baselines/reference/parserMemberAccessorDeclaration6.types deleted file mode 100644 index a06b6ddfa0c..00000000000 --- a/tests/baselines/reference/parserMemberAccessorDeclaration6.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration6.ts === -class C { ->C : C - - set 0(i) { } ->i : any -} diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration7.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration7.errors.txt index 20ebd2f3583..61c9115a17a 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration7.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration7.errors.txt @@ -1,8 +1,10 @@ -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration7.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration7.ts (3 errors) ==== class C { public public get Foo() { } ~~~~~~ !!! Accessibility modifier already seen. ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration8.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration8.errors.txt index f6d151bfb7f..b8e304aed8c 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration8.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration8.errors.txt @@ -1,8 +1,10 @@ -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration8.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration8.ts (3 errors) ==== class C { static static get Foo() { } ~~~~~~ !!! 'static' modifier already seen. ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessorDeclaration9.errors.txt b/tests/baselines/reference/parserMemberAccessorDeclaration9.errors.txt index e4c88dfd57d..18d9653c8e0 100644 --- a/tests/baselines/reference/parserMemberAccessorDeclaration9.errors.txt +++ b/tests/baselines/reference/parserMemberAccessorDeclaration9.errors.txt @@ -1,8 +1,10 @@ -==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration9.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/MemberAccessorDeclarations/parserMemberAccessorDeclaration9.ts (3 errors) ==== class C { static public get Foo() { } ~~~~~~ !!! 'public' modifier must precede 'static' modifier. ~~~ +!!! Accessors are only available when targeting ECMAScript 5 and higher. + ~~~ !!! A 'get' accessor must return a value or consist of a single 'throw' statement. } \ No newline at end of file diff --git a/tests/baselines/reference/parserModuleDeclaration11.types b/tests/baselines/reference/parserModuleDeclaration11.types index 23c74ae1538..5a0d48f4e6c 100644 --- a/tests/baselines/reference/parserModuleDeclaration11.types +++ b/tests/baselines/reference/parserModuleDeclaration11.types @@ -6,14 +6,14 @@ declare module string { >X : X export function foo(s: string); ->foo : (s: string) => any +>foo : typeof foo >s : string } string.foo("abc"); >string.foo("abc") : any ->string.foo : (s: string) => any +>string.foo : typeof foo >string : typeof string ->foo : (s: string) => any +>foo : typeof foo var x: string.X; >x : X diff --git a/tests/baselines/reference/parserObjectCreation2.errors.txt b/tests/baselines/reference/parserObjectCreation2.errors.txt deleted file mode 100644 index c20922d1784..00000000000 --- a/tests/baselines/reference/parserObjectCreation2.errors.txt +++ /dev/null @@ -1,4 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/Expressions/parserObjectCreation2.ts (1 errors) ==== - new new Foo()() - ~~~ -!!! Cannot find name 'Foo'. \ No newline at end of file diff --git a/tests/baselines/reference/parserObjectCreation2.js b/tests/baselines/reference/parserObjectCreation2.js deleted file mode 100644 index ce05a2af96a..00000000000 --- a/tests/baselines/reference/parserObjectCreation2.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [parserObjectCreation2.ts] -new new Foo()() - -//// [parserObjectCreation2.js] -new new Foo()(); diff --git a/tests/baselines/reference/parserObjectLiterals1.js b/tests/baselines/reference/parserObjectLiterals1.js deleted file mode 100644 index 426b8107d3b..00000000000 --- a/tests/baselines/reference/parserObjectLiterals1.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [parserObjectLiterals1.ts] -var v = { a: 1, b: 2 }; - -//// [parserObjectLiterals1.js] -var v = { a: 1, b: 2 }; diff --git a/tests/baselines/reference/parserObjectLiterals1.types b/tests/baselines/reference/parserObjectLiterals1.types deleted file mode 100644 index c38adbf55b6..00000000000 --- a/tests/baselines/reference/parserObjectLiterals1.types +++ /dev/null @@ -1,7 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/ObjectLiterals/parserObjectLiterals1.ts === -var v = { a: 1, b: 2 }; ->v : { a: number; b: number; } ->{ a: 1, b: 2 } : { a: number; b: number; } ->a : number ->b : number - diff --git a/tests/baselines/reference/parserObjectType5.errors.txt b/tests/baselines/reference/parserObjectType5.errors.txt deleted file mode 100644 index f8ca853af63..00000000000 --- a/tests/baselines/reference/parserObjectType5.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType5.ts (2 errors) ==== - var v: { - A: B - ~ -!!! Cannot find name 'B'. - ; - ~ -!!! '(' expected. - }; \ No newline at end of file diff --git a/tests/baselines/reference/parserObjectType6.errors.txt b/tests/baselines/reference/parserObjectType6.errors.txt deleted file mode 100644 index 4e3d0f206b9..00000000000 --- a/tests/baselines/reference/parserObjectType6.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/ObjectTypes/parserObjectType6.ts (2 errors) ==== - var v: { - a: B - ~ -!!! Cannot find name 'B'. - []; - ~~ -!!! An index signature must have exactly one parameter. - }; \ No newline at end of file diff --git a/tests/baselines/reference/parserPostfixUnaryExpression1.errors.txt b/tests/baselines/reference/parserPostfixUnaryExpression1.errors.txt deleted file mode 100644 index 29b5e697abd..00000000000 --- a/tests/baselines/reference/parserPostfixUnaryExpression1.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -==== tests/cases/conformance/parser/ecmascript5/Expressions/parserPostfixUnaryExpression1.ts (4 errors) ==== - foo ++ ++; - ~~ -!!! ';' expected. - ~ -!!! Expression expected. - ~~~ -!!! Cannot find name 'foo'. - -!!! The operand of an increment or decrement operator must be a variable, property or indexer. \ No newline at end of file diff --git a/tests/baselines/reference/parserReturnStatement3.types b/tests/baselines/reference/parserReturnStatement3.types index 6484050efee..28b06c922ab 100644 --- a/tests/baselines/reference/parserReturnStatement3.types +++ b/tests/baselines/reference/parserReturnStatement3.types @@ -1,6 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/Statements/ReturnStatements/parserReturnStatement3.ts === function f() { ->f : () => void +>f : typeof f return; } diff --git a/tests/baselines/reference/parserS7.6.1.1_A1.10.errors.txt b/tests/baselines/reference/parserS7.6.1.1_A1.10.errors.txt new file mode 100644 index 00000000000..c5a53560920 --- /dev/null +++ b/tests/baselines/reference/parserS7.6.1.1_A1.10.errors.txt @@ -0,0 +1,21 @@ +==== tests/cases/conformance/parser/ecmascript5/parserS7.6.1.1_A1.10.ts (3 errors) ==== + // Copyright 2009 the Sputnik authors. All rights reserved. + // This code is governed by the BSD license found in the LICENSE file. + + /** + * The "for" token can not be used as identifier + * + * @path ch07/7.6/7.6.1/7.6.1.1/S7.6.1.1_A1.10.js + * @description Checking if execution of "for=1" fails + * @negative + */ + + for = 1; + ~ +!!! '(' expected. + +!!! Invalid left-hand side of assignment expression. + + + +!!! Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserS7.6.1.1_A1.10.types b/tests/baselines/reference/parserS7.6.1.1_A1.10.types deleted file mode 100644 index 28441e36fe6..00000000000 --- a/tests/baselines/reference/parserS7.6.1.1_A1.10.types +++ /dev/null @@ -1,16 +0,0 @@ -=== tests/cases/conformance/parser/ecmascript5/parserS7.6.1.1_A1.10.ts === -// Copyright 2009 the Sputnik authors. All rights reserved. -No type information for this code.// This code is governed by the BSD license found in the LICENSE file. -No type information for this code. -No type information for this code./** -No type information for this code. * The "for" token can not be used as identifier -No type information for this code. * -No type information for this code. * @path ch07/7.6/7.6.1/7.6.1.1/S7.6.1.1_A1.10.js -No type information for this code. * @description Checking if execution of "for=1" fails -No type information for this code. * @negative -No type information for this code. */ -No type information for this code. -No type information for this code.//for = 1; -No type information for this code. -No type information for this code. -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.errors.txt b/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.errors.txt index 135f06cf304..b1f3fd145eb 100644 --- a/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.errors.txt +++ b/tests/baselines/reference/parserSetAccessorWithTypeAnnotation1.errors.txt @@ -2,6 +2,6 @@ class C { set foo(v): number { ~~~ -!!! A 'set' accessor cannot have a return type annotation. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } } \ No newline at end of file diff --git a/tests/baselines/reference/parserSetAccessorWithTypeParameters1.errors.txt b/tests/baselines/reference/parserSetAccessorWithTypeParameters1.errors.txt index 6d5ab6f30af..a9ec344d8c5 100644 --- a/tests/baselines/reference/parserSetAccessorWithTypeParameters1.errors.txt +++ b/tests/baselines/reference/parserSetAccessorWithTypeParameters1.errors.txt @@ -2,5 +2,5 @@ class C { set foo(v) { } ~~~ -!!! An accessor cannot have type parameters. +!!! Accessors are only available when targeting ECMAScript 5 and higher. } \ No newline at end of file diff --git a/tests/baselines/reference/parserSyntaxWalker.generated.errors.txt b/tests/baselines/reference/parserSyntaxWalker.generated.errors.txt new file mode 100644 index 00000000000..b304fe6f388 --- /dev/null +++ b/tests/baselines/reference/parserSyntaxWalker.generated.errors.txt @@ -0,0 +1,334 @@ +==== tests/cases/conformance/parser/ecmascript5/parserSyntaxWalker.generated.ts (27 errors) ==== + declare module "fs" { + export class File { + constructor(filename: string); + public ReadAllText(): string; + } + export interface IFile { + [index: number]: string; + } + } + + import fs = module("fs"); + ~ +!!! ';' expected. + ~~~~~~~~~~~~~~~~~~ +!!! Cannot find name 'module'. + + + module TypeScriptAllInOne { + export class Program { + static Main(...args: string[]) { + try { + var bfs = new BasicFeatures(); + var retValue: number = 0; + + retValue = bfs.VARIABLES(); + if (retValue != 0) { + + return 1; + } + + retValue = bfs.STATEMENTS(4); + if (retValue != 0) { + + return 1; + } + + + retValue = bfs.TYPES(); + if (retValue != 0) { + + return 1; + } + + retValue = bfs.OPERATOR(); + if (retValue != 0) { + + return 1; + } + } + catch (e) { + console.log(e); + ~~~~~~~ +!!! Cannot find name 'console'. + } + finally { + + } + + console.log('Done'); + ~~~~~~~ +!!! Cannot find name 'console'. + + return 0; + + } + } + + class BasicFeatures { + /// + /// Test various of variables. Including nullable,key world as variable,special format + /// + /// + public VARIABLES(): number { + var local = Number.MAX_VALUE; + var min = Number.MIN_VALUE; + var inf = Number.NEGATIVE_INFINITY; + var nan = Number.NaN; + var undef = undefined; + + var п = local; + var м = local; + + var local5 = null; + var local6 = local5 instanceof fs.File; + ~~~~~~ +!!! The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter. + ~~~~~~~ +!!! The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type. + + var hex = 0xBADC0DE, Hex = 0XDEADBEEF; + var float = 6.02e23, float2 = 6.02E-23 + var char = 'c', \u0066 = '\u0066', hexchar = '\x42'; + var quoted = '"', quoted2 = "'"; + var reg = /\w*/; + var objLit = { "var": number = 42, equals: function (x) { return x["var"] === 42; }, toString: () => 'objLit{42}' }; + var weekday = Weekdays.Monday; + + var con = char + f + hexchar + float.toString() + float2.toString() + reg.toString() + objLit + weekday; + + // + var any = 0; + var boolean = 0; + var declare = 0; + var constructor = 0; + var get = 0; + var implements = 0; + var interface = 0; + var let = 0; + var module = 0; + var number = 0; + var package = 0; + var private = 0; + var protected = 0; + var public = 0; + var set = 0; + var static = 0; + var string = 0; + var yield = 0; + + var sum3 = any + boolean + declare + constructor + get + implements + interface + let + module + number + package + private + protected + public + set + static + string + yield; + + return 0; + } + + /// + /// Test different statements. Including if-else,swith,foreach,(un)checked,lock,using,try-catch-finally + /// + /// + /// + STATEMENTS(i: number): number { + var retVal = 0; + if (i == 1) + retVal = 1; + else + retVal = 0; + switch (i) { + case 2: + retVal = 1; + break; + case 3: + retVal = 1; + break; + default: + break; + } + + for (var x in { x: 0, y: 1 }) { + } + + try { + throw null; + } + catch (Exception) { + } + finally { + try { } + catch (Exception) { } + } + + return retVal; + } + + /// + /// Test types in ts language. Including class,struct,interface,delegate,anonymous type + /// + /// + public TYPES(): number { + var retVal = 0; + var c = new CLASS(); + var xx: IF = c; + retVal += c.Property; + retVal += c.Member(); + retVal += xx ^= Foo() ? 0 : 1; + ~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~ +!!! Cannot find name 'Foo'. + + //anonymous type + var anony = { a: new CLASS() }; + + retVal += anony.a.d(); + ~~~~~~ +!!! Type 'string' is not assignable to type 'number'. + + return retVal; + } + + + ///// + ///// Test different operators + ///// + ///// + public OPERATOR(): number { + var a: number[] = [1, 2, 3, 4, implements , ];/*[] bug*/ // YES [] + ~~~~~~~~~~ +!!! Cannot find name 'implements'. + var i = a[1];/*[]*/ + i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/ + var b = true && false || true ^ false;/*& | ^*/ + ~~~~ +!!! The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + ~~~~~ +!!! The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. + b = !b;/*!*/ + i = ~i;/*~i*/ + b = i < (i - continue ) && (i + 1) > i;/*< && >*/ + ~~~~~~~~ +!!! Expression expected. + ~ +!!! Identifier expected. + ~~ +!!! Statement expected. + var f = true ? 1 : 0;/*? :*/ // YES : + i++;/*++*/ + i--;/*--*/ + b = true && false || true;/*&& ||*/ + i = i << 5;/*<<*/ + i = i >> 5;/*>>*/ + var j = i; + b = i == j && i != j && i <= j && i >= j;/*= == && != <= >=*/ + i += 5.0;/*+=*/ + i -= i;/*-=*/ + i *= i;/**=*/ + if (i == 0) + i++; + i /= i;/*/=*/ + i %= i;/*%=*/ + i &= i;/*&=*/ + i |= i;/*|=*/ + i ^= i;/*^=*/ + i <<= i;/*<<=*/ + i >>= i;/*>>=*/ + + if (i == 0 && !b && f == 1) + return 0; + else return 1; + } + + } + + interface IF { + Foo