From eda291d640f19e31299fbef12ac82ead6b2b6ff2 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 8 Dec 2020 12:36:38 -1000 Subject: [PATCH 01/11] Infer template literal types for template literal expressions --- src/compiler/checker.ts | 40 ++++++++++++++++++++++------------------ src/compiler/types.ts | 7 ++++++- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index bebda41082c3b..ab7f0a0b0b882 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13137,7 +13137,7 @@ namespace ts { i--; const t = types[i]; const remove = - t.flags & TypeFlags.StringLiteral && includes & TypeFlags.String || + t.flags & TypeFlags.StringLikeLiteral && includes & TypeFlags.String || t.flags & TypeFlags.NumberLiteral && includes & TypeFlags.Number || t.flags & TypeFlags.BigIntLiteral && includes & TypeFlags.BigInt || t.flags & TypeFlags.UniqueESSymbol && includes & TypeFlags.ESSymbol || @@ -13184,7 +13184,7 @@ namespace ts { } switch (unionReduction) { case UnionReduction.Literal: - if (includes & (TypeFlags.Literal | TypeFlags.UniqueESSymbol)) { + if (includes & (TypeFlags.FreshableLiteral | TypeFlags.UniqueESSymbol)) { removeRedundantLiteralTypes(typeSet, includes); } if (includes & TypeFlags.StringLiteral && includes & TypeFlags.TemplateLiteral) { @@ -13715,6 +13715,7 @@ namespace ts { let type = templateLiteralTypes.get(id); if (!type) { templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes)); + type.regularType = type; } return type; @@ -14753,26 +14754,28 @@ namespace ts { } function getFreshTypeOfLiteralType(type: Type): Type { - if (type.flags & TypeFlags.Literal) { - if (!(type).freshType) { - const freshType = createLiteralType(type.flags, (type).value, (type).symbol); - freshType.regularType = type; + if (type.flags & TypeFlags.FreshableLiteral) { + if (!(type).freshType) { + const freshType = type.flags & TypeFlags.TemplateLiteral ? + createTemplateLiteralType((type).texts, (type).types) : + createLiteralType(type.flags, (type).value, (type).symbol); + freshType.regularType = type; freshType.freshType = freshType; - (type).freshType = freshType; + (type).freshType = freshType; } - return (type).freshType; + return (type).freshType; } return type; } function getRegularTypeOfLiteralType(type: Type): Type { - return type.flags & TypeFlags.Literal ? (type).regularType : + return type.flags & TypeFlags.FreshableLiteral ? (type).regularType : type.flags & TypeFlags.Union ? ((type).regularType || ((type).regularType = getUnionType(sameMap((type).types, getRegularTypeOfLiteralType)) as UnionType)) : type; } function isFreshLiteralType(type: Type) { - return !!(type.flags & TypeFlags.Literal) && (type).freshType === type; + return !!(type.flags & TypeFlags.FreshableLiteral) && (type).freshType === type; } function getLiteralType(value: string): StringLiteralType; @@ -19100,7 +19103,7 @@ namespace ts { function getBaseTypeOfLiteralType(type: Type): Type { return type.flags & TypeFlags.EnumLiteral ? getBaseTypeOfEnumLiteralType(type) : - type.flags & TypeFlags.StringLiteral ? stringType : + type.flags & TypeFlags.StringLikeLiteral ? stringType : type.flags & TypeFlags.NumberLiteral ? numberType : type.flags & TypeFlags.BigIntLiteral ? bigintType : type.flags & TypeFlags.BooleanLiteral ? booleanType : @@ -19110,7 +19113,7 @@ namespace ts { function getWidenedLiteralType(type: Type): Type { return type.flags & TypeFlags.EnumLiteral && isFreshLiteralType(type) ? getBaseTypeOfEnumLiteralType(type) : - type.flags & TypeFlags.StringLiteral && isFreshLiteralType(type) ? stringType : + type.flags & TypeFlags.StringLikeLiteral && isFreshLiteralType(type) ? stringType : type.flags & TypeFlags.NumberLiteral && isFreshLiteralType(type) ? numberType : type.flags & TypeFlags.BigIntLiteral && isFreshLiteralType(type) ? bigintType : type.flags & TypeFlags.BooleanLiteral && isFreshLiteralType(type) ? booleanType : @@ -20611,7 +20614,7 @@ namespace ts { } function isTypeOrBaseIdenticalTo(s: Type, t: Type) { - return isTypeIdenticalTo(s, t) || !!(t.flags & TypeFlags.String && s.flags & TypeFlags.StringLiteral || t.flags & TypeFlags.Number && s.flags & TypeFlags.NumberLiteral); + return isTypeIdenticalTo(s, t) || !!(t.flags & TypeFlags.String && s.flags & TypeFlags.StringLikeLiteral || t.flags & TypeFlags.Number && s.flags & TypeFlags.NumberLiteral); } function isTypeCloselyMatchedBy(s: Type, t: Type) { @@ -30753,7 +30756,7 @@ namespace ts { texts.push(span.literal.text); types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); } - return isConstContext(node) ? getTemplateLiteralType(texts, types) : stringType; + return getFreshTypeOfLiteralType(getTemplateLiteralType(texts, types)); } function getContextNode(node: Expression): Node { @@ -30774,7 +30777,7 @@ namespace ts { // We strip literal freshness when an appropriate contextual type is present such that contextually typed // literals always preserve their literal types (otherwise they might widen during type inference). An alternative // here would be to not mark contextually typed literals as fresh in the first place. - const result = maybeTypeOfKind(type, TypeFlags.Literal) && isLiteralOfContextualType(type, instantiateContextualType(contextualType, node)) ? + const result = maybeTypeOfKind(type, TypeFlags.FreshableLiteral) && isLiteralOfContextualType(type, instantiateContextualType(contextualType, node)) ? getRegularTypeOfLiteralType(type) : type; return result; } @@ -30864,7 +30867,7 @@ namespace ts { // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. const constraint = getBaseConstraintOfType(contextualType) || unknownType; - return maybeTypeOfKind(constraint, TypeFlags.String) && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral) || + return maybeTypeOfKind(constraint, TypeFlags.String) && maybeTypeOfKind(candidateType, TypeFlags.StringLikeLiteral) || maybeTypeOfKind(constraint, TypeFlags.Number) && maybeTypeOfKind(candidateType, TypeFlags.NumberLiteral) || maybeTypeOfKind(constraint, TypeFlags.BigInt) && maybeTypeOfKind(candidateType, TypeFlags.BigIntLiteral) || maybeTypeOfKind(constraint, TypeFlags.ESSymbol) && maybeTypeOfKind(candidateType, TypeFlags.UniqueESSymbol) || @@ -30872,7 +30875,7 @@ namespace ts { } // If the contextual type is a literal of a particular primitive type, we consider this a // literal context for all literals of that primitive type. - return !!(contextualType.flags & (TypeFlags.StringLiteral | TypeFlags.Index | TypeFlags.TemplateLiteral | TypeFlags.StringMapping) && maybeTypeOfKind(candidateType, TypeFlags.StringLiteral) || + return !!(contextualType.flags & (TypeFlags.StringLikeLiteral | TypeFlags.Index | TypeFlags.StringMapping) && maybeTypeOfKind(candidateType, TypeFlags.StringLikeLiteral) || contextualType.flags & TypeFlags.NumberLiteral && maybeTypeOfKind(candidateType, TypeFlags.NumberLiteral) || contextualType.flags & TypeFlags.BigIntLiteral && maybeTypeOfKind(candidateType, TypeFlags.BigIntLiteral) || contextualType.flags & TypeFlags.BooleanLiteral && maybeTypeOfKind(candidateType, TypeFlags.BooleanLiteral) || @@ -38398,7 +38401,8 @@ namespace ts { function isLiteralConstDeclaration(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration): boolean { if (isDeclarationReadonly(node) || isVariableDeclaration(node) && isVarConst(node)) { - return isFreshLiteralType(getTypeOfSymbol(getSymbolOfNode(node))); + const type = getTypeOfSymbol(getSymbolOfNode(node)); + return !!(type.flags & TypeFlags.Literal) && isFreshLiteralType(type); } return false; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 34245a5e404a7..54a5d236b6e99 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4894,6 +4894,8 @@ namespace ts { Literal = StringLiteral | NumberLiteral | BigIntLiteral | BooleanLiteral, Unit = Literal | UniqueESSymbol | Nullable, StringOrNumberLiteral = StringLiteral | NumberLiteral, + StringLikeLiteral = StringLiteral | TemplateLiteral, + FreshableLiteral = Literal | TemplateLiteral, /* @internal */ StringOrNumberLiteralOrUnique = StringLiteral | NumberLiteral | UniqueESSymbol, /* @internal */ @@ -4988,7 +4990,8 @@ namespace ts { } /* @internal */ - export type FreshableType = LiteralType | FreshableIntrinsicType; + export type FreshableLiteralType = LiteralType | TemplateLiteralType; + export type FreshableType = FreshableLiteralType | FreshableIntrinsicType; // String literal types (TypeFlags.StringLiteral) // Numeric literal types (TypeFlags.NumberLiteral) @@ -5386,6 +5389,8 @@ namespace ts { export interface TemplateLiteralType extends InstantiableType { texts: readonly string[]; // Always one element longer than types types: readonly Type[]; // Always at least one element + freshType: TemplateLiteralType; // Fresh version of type + regularType: TemplateLiteralType; // Regular version of type } export interface StringMappingType extends InstantiableType { From 4acf495322a251272cb459a1c1c22365092c495a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 8 Dec 2020 12:36:50 -1000 Subject: [PATCH 02/11] Update test --- .../dynamicImport/importCallExpressionDeclarationEmit1.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionDeclarationEmit1.ts b/tests/cases/conformance/dynamicImport/importCallExpressionDeclarationEmit1.ts index fb29995114862..33d6e1fdb87b3 100644 --- a/tests/cases/conformance/dynamicImport/importCallExpressionDeclarationEmit1.ts +++ b/tests/cases/conformance/dynamicImport/importCallExpressionDeclarationEmit1.ts @@ -10,7 +10,7 @@ declare const moduleFile: number; import(getSpecifier()); -var p0 = import(`${directory}\${moduleFile}`); +var p0 = import(`${directory}\\${moduleFile}`); var p1 = import(getSpecifier()); const p2 = import(whatToLoad ? getSpecifier() : "defaulPath") From 537fd3722b30218a8b11c311d5fe5311e871d9c8 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 8 Dec 2020 14:31:20 -1000 Subject: [PATCH 03/11] Update another test --- .../dynamicImport/importCallExpressionReturnPromiseOfAny.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionReturnPromiseOfAny.ts b/tests/cases/conformance/dynamicImport/importCallExpressionReturnPromiseOfAny.ts index 34f0b63be6f10..b397075659365 100644 --- a/tests/cases/conformance/dynamicImport/importCallExpressionReturnPromiseOfAny.ts +++ b/tests/cases/conformance/dynamicImport/importCallExpressionReturnPromiseOfAny.ts @@ -12,7 +12,7 @@ declare var whatToLoad: boolean; declare const directory: string; declare const moduleFile: number; -import(`${directory}\${moduleFile}`); +import(`${directory}\\${moduleFile}`); import(getSpecifier()); var p1 = import(ValidSomeCondition() ? "./0" : "externalModule"); @@ -28,7 +28,7 @@ var p3: Promise = import(j=getSpecifier()); function * loadModule(directories: string[]) { for (const directory of directories) { - const path = `${directory}\moduleFile`; + const path = `${directory}\\moduleFile`; import(yield path); } } From e88ceca03f4717253fd6b099aeddc292a89558c5 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 8 Dec 2020 14:36:09 -1000 Subject: [PATCH 04/11] Accept new baselines --- .../reference/TemplateExpression1.types | 2 +- .../accessorsOverrideProperty2.types | 2 +- .../reference/api/tsserverlibrary.d.ts | 5 + tests/baselines/reference/api/typescript.d.ts | 5 + tests/baselines/reference/asOperator3.types | 12 +- .../checkJsObjectLiteralIndexSignatures.types | 2 +- .../computedPropertyNames10_ES5.types | 2 +- .../computedPropertyNames10_ES6.types | 2 +- .../computedPropertyNames11_ES5.types | 2 +- .../computedPropertyNames11_ES6.types | 2 +- .../computedPropertyNames12_ES5.types | 2 +- .../computedPropertyNames12_ES6.types | 2 +- .../computedPropertyNames13_ES5.types | 2 +- .../computedPropertyNames13_ES6.types | 2 +- .../computedPropertyNames16_ES5.types | 2 +- .../computedPropertyNames16_ES6.types | 2 +- .../computedPropertyNames4_ES5.types | 2 +- .../computedPropertyNames4_ES6.types | 2 +- .../declFileEmitDeclarationOnly.types | 2 +- .../declarationNoDanglingGenerics.types | 2 +- ...InitializerContextualTypeFromContext.types | 4 +- .../destructuringParameterProperties4.types | 4 +- ...onentiationOperatorInTempalteString4.types | 34 ++-- ...ntiationOperatorInTempalteString4ES6.types | 34 ++-- ...onentiationOperatorInTemplateString1.types | 36 ++-- ...ntiationOperatorInTemplateString1ES6.types | 36 ++-- ...onentiationOperatorInTemplateString2.types | 38 ++-- ...ntiationOperatorInTemplateString2ES6.types | 38 ++-- ...onentiationOperatorInTemplateString3.types | 38 ++-- ...ntiationOperatorInTemplateString3ES6.types | 38 ++-- ...umConstantMemberWithTemplateLiterals.types | 2 +- .../esModuleInteropImportTSLibHasImport.types | 4 +- ...atorInTemplateStringWithSyntaxError1.types | 36 ++-- ...atorInTemplateStringWithSyntaxError2.types | 36 ++-- ...atorInTemplateStringWithSyntaxError3.types | 36 ++-- ...ionOperatorWithTemplateStringInvalid.types | 24 +-- ...OperatorWithTemplateStringInvalidES6.types | 24 +-- .../importCallExpressionDeclarationEmit1.js | 4 +- ...portCallExpressionDeclarationEmit1.symbols | 3 +- ...importCallExpressionDeclarationEmit1.types | 7 +- .../importCallExpressionReturnPromiseOfAny.js | 8 +- ...rtCallExpressionReturnPromiseOfAny.symbols | 5 +- ...portCallExpressionReturnPromiseOfAny.types | 17 +- ...mportCallExpressionShouldNotGetParen.types | 2 +- .../reference/inferenceErasedSignatures.types | 2 +- ...mplateEscapeSequences(target=es2015).types | 36 ++-- ...dTemplateEscapeSequences(target=es5).types | 36 ++-- ...mplateEscapeSequences(target=esnext).types | 36 ++-- .../jsDeclarationsExportedClassAliases.types | 2 +- .../jsdocTypeFromChainedAssignment2.types | 30 +-- .../reference/noImplicitSymbolToString.types | 8 +- .../parenthesizedContexualTyping3.types | 16 +- .../privateNameFieldCallExpression.types | 4 +- .../propertyOverridesAccessors2.types | 2 +- .../reference/recursiveTypeReferences1.types | 2 +- ...teralTypesWithTemplateStrings02.errors.txt | 7 +- ...ingLiteralTypesWithTemplateStrings02.types | 2 +- .../reference/taggedTemplateChain.types | 2 +- .../taggedTemplateContextualTyping1.types | 8 +- .../taggedTemplateContextualTyping2.types | 6 +- ...gedTemplateStringsHexadecimalEscapes.types | 2 +- ...TemplateStringsHexadecimalEscapesES6.types | 2 +- ...ainCharactersThatArePartsOfEscapes02.types | 2 +- ...haractersThatArePartsOfEscapes02_ES6.types | 2 +- ...TemplateStringsTypeArgumentInference.types | 22 +- ...plateStringsTypeArgumentInferenceES6.types | 22 +- ...edTemplateStringsWithCurriedFunction.types | 2 +- ...lateStringsWithIncompatibleTypedTags.types | 18 +- ...eStringsWithIncompatibleTypedTagsES6.types | 18 +- ...ingsWithManyCallAndMemberExpressions.types | 2 +- ...sWithManyCallAndMemberExpressionsES6.types | 2 +- ...mplateStringsWithOverloadResolution1.types | 10 +- ...teStringsWithOverloadResolution1_ES6.types | 10 +- ...mplateStringsWithOverloadResolution2.types | 4 +- ...teStringsWithOverloadResolution2_ES6.types | 4 +- ...mplateStringsWithOverloadResolution3.types | 36 ++-- ...teStringsWithOverloadResolution3_ES6.types | 36 ++-- ...edTemplateStringsWithTagNamedDeclare.types | 2 +- ...emplateStringsWithTagNamedDeclareES6.types | 2 +- ...gedTemplateStringsWithTagsTypedAsAny.types | 16 +- ...TemplateStringsWithTagsTypedAsAnyES6.types | 16 +- .../taggedTemplateStringsWithTypedTags.types | 14 +- ...aggedTemplateStringsWithTypedTagsES6.types | 14 +- ...gedTemplateStringsWithUnicodeEscapes.types | 2 +- ...TemplateStringsWithUnicodeEscapesES6.types | 2 +- ...esWithIncompleteTemplateExpressions1.types | 2 +- ...esWithIncompleteTemplateExpressions2.types | 2 +- ...esWithIncompleteTemplateExpressions3.types | 2 +- ...esWithIncompleteTemplateExpressions4.types | 2 +- ...esWithIncompleteTemplateExpressions5.types | 2 +- ...esWithIncompleteTemplateExpressions6.types | 2 +- .../taggedTemplatesWithTypeArguments1.types | 18 +- .../taggedTemplatesWithTypeArguments2.types | 8 +- .../reference/templateLiteralTypes1.types | 2 +- .../templateStringBinaryOperations.types | 96 ++++----- .../templateStringBinaryOperationsES6.types | 96 ++++----- ...lateStringBinaryOperationsES6Invalid.types | 192 +++++++++--------- ...emplateStringBinaryOperationsInvalid.types | 192 +++++++++--------- .../reference/templateStringInArray.types | 2 +- .../templateStringInArrowFunction.types | 6 +- .../templateStringInArrowFunctionES6.types | 6 +- .../templateStringInCallExpression.types | 6 +- .../templateStringInCallExpressionES6.types | 6 +- .../templateStringInConditional.types | 8 +- .../templateStringInConditionalES6.types | 8 +- .../templateStringInDeleteExpression.types | 2 +- .../templateStringInDeleteExpressionES6.types | 2 +- .../reference/templateStringInDivision.types | 2 +- .../templateStringInEqualityChecks.errors.txt | 13 ++ .../templateStringInEqualityChecks.types | 8 +- ...mplateStringInEqualityChecksES6.errors.txt | 13 ++ .../templateStringInEqualityChecksES6.types | 8 +- .../templateStringInFunctionExpression.types | 4 +- ...emplateStringInFunctionExpressionES6.types | 4 +- .../templateStringInInOperator.types | 2 +- .../templateStringInInOperatorES6.types | 2 +- .../templateStringInIndexExpression.types | 2 +- .../templateStringInIndexExpressionES6.types | 2 +- .../templateStringInInstanceOf.types | 2 +- .../templateStringInInstanceOfES6.types | 2 +- .../templateStringInModuleName.types | 2 +- .../templateStringInModuleNameES6.types | 2 +- .../reference/templateStringInModulo.types | 2 +- .../reference/templateStringInModuloES6.types | 2 +- .../templateStringInMultiplication.types | 2 +- .../templateStringInMultiplicationES6.types | 2 +- .../templateStringInNewExpression.types | 6 +- .../templateStringInNewExpressionES6.types | 6 +- .../templateStringInNewOperator.types | 2 +- .../templateStringInNewOperatorES6.types | 2 +- .../templateStringInObjectLiteral.types | 2 +- .../templateStringInObjectLiteralES6.types | 2 +- .../templateStringInParentheses.types | 4 +- .../templateStringInParenthesesES6.types | 4 +- .../templateStringInPropertyAssignment.types | 2 +- ...emplateStringInPropertyAssignmentES6.types | 2 +- .../templateStringInPropertyName2.types | 2 +- .../templateStringInPropertyNameES6_2.types | 2 +- .../templateStringInSwitchAndCase.errors.txt | 15 ++ .../templateStringInSwitchAndCase.types | 6 +- ...emplateStringInSwitchAndCaseES6.errors.txt | 15 ++ .../templateStringInSwitchAndCaseES6.types | 6 +- .../templateStringInTaggedTemplate.types | 6 +- .../templateStringInTaggedTemplateES6.types | 6 +- .../templateStringInTypeAssertion.types | 2 +- .../templateStringInTypeAssertionES6.types | 2 +- .../reference/templateStringInTypeOf.types | 2 +- .../reference/templateStringInTypeOfES6.types | 2 +- .../reference/templateStringInUnaryPlus.types | 2 +- .../templateStringInUnaryPlusES6.types | 2 +- .../reference/templateStringInWhile.types | 4 +- .../reference/templateStringInWhileES6.types | 4 +- .../templateStringInYieldKeyword.types | 4 +- ...ainCharactersThatArePartsOfEscapes02.types | 2 +- ...haractersThatArePartsOfEscapes02_ES6.types | 2 +- .../templateStringWithEmbeddedAddition.types | 2 +- ...emplateStringWithEmbeddedAdditionES6.types | 2 +- .../templateStringWithEmbeddedArray.types | 2 +- .../templateStringWithEmbeddedArrayES6.types | 2 +- ...plateStringWithEmbeddedArrowFunction.types | 2 +- ...teStringWithEmbeddedArrowFunctionES6.types | 2 +- .../templateStringWithEmbeddedComments.types | 2 +- ...emplateStringWithEmbeddedCommentsES6.types | 2 +- ...emplateStringWithEmbeddedConditional.types | 4 +- ...lateStringWithEmbeddedConditionalES6.types | 4 +- .../templateStringWithEmbeddedDivision.types | 2 +- ...emplateStringWithEmbeddedDivisionES6.types | 2 +- ...StringWithEmbeddedFunctionExpression.types | 2 +- ...ingWithEmbeddedFunctionExpressionES6.types | 2 +- ...templateStringWithEmbeddedInOperator.types | 4 +- ...plateStringWithEmbeddedInOperatorES6.types | 4 +- ...templateStringWithEmbeddedInstanceOf.types | 4 +- ...plateStringWithEmbeddedInstanceOfES6.types | 4 +- .../templateStringWithEmbeddedModulo.types | 2 +- .../templateStringWithEmbeddedModuloES6.types | 2 +- ...lateStringWithEmbeddedMultiplication.types | 2 +- ...eStringWithEmbeddedMultiplicationES6.types | 2 +- ...emplateStringWithEmbeddedNewOperator.types | 2 +- ...lateStringWithEmbeddedNewOperatorES6.types | 2 +- ...plateStringWithEmbeddedObjectLiteral.types | 2 +- ...teStringWithEmbeddedObjectLiteralES6.types | 2 +- ...lateStringWithEmbeddedTemplateString.types | 6 +- ...eStringWithEmbeddedTemplateStringES6.types | 6 +- ...gWithEmbeddedTypeAssertionOnAddition.types | 2 +- ...thEmbeddedTypeAssertionOnAdditionES6.types | 2 +- ...lateStringWithEmbeddedTypeOfOperator.types | 4 +- ...eStringWithEmbeddedTypeOfOperatorES6.types | 4 +- .../templateStringWithEmbeddedUnaryPlus.types | 2 +- ...mplateStringWithEmbeddedUnaryPlusES6.types | 2 +- ...mplateStringWithEmbeddedYieldKeyword.types | 2 +- ...ateStringWithEmbeddedYieldKeywordES6.types | 2 +- ...mplateStringWithEmptyLiteralPortions.types | 24 +-- ...ateStringWithEmptyLiteralPortionsES6.types | 24 +-- ...StringWithOpenCommentInStringPortion.types | 2 +- ...ingWithOpenCommentInStringPortionES6.types | 2 +- .../templateStringWithPropertyAccess.types | 2 +- .../templateStringWithPropertyAccessES6.types | 2 +- ...lateStringsArrayTypeDefinedInES5Mode.types | 2 +- ...ateStringsArrayTypeNotDefinedES5Mode.types | 2 +- ...teStringsArrayTypeRedefinedInES6Mode.types | 2 +- .../truthinessCallExpressionCoercion.types | 2 +- .../typeGuardIntersectionTypes.types | 4 +- ...codeExtendedEscapesInTemplates20_ES5.types | 2 +- ...codeExtendedEscapesInTemplates20_ES6.types | 2 +- 204 files changed, 1065 insertions(+), 984 deletions(-) create mode 100644 tests/baselines/reference/templateStringInEqualityChecks.errors.txt create mode 100644 tests/baselines/reference/templateStringInEqualityChecksES6.errors.txt create mode 100644 tests/baselines/reference/templateStringInSwitchAndCase.errors.txt create mode 100644 tests/baselines/reference/templateStringInSwitchAndCaseES6.errors.txt diff --git a/tests/baselines/reference/TemplateExpression1.types b/tests/baselines/reference/TemplateExpression1.types index e23083d83ec5e..a293dc672ee61 100644 --- a/tests/baselines/reference/TemplateExpression1.types +++ b/tests/baselines/reference/TemplateExpression1.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/TemplateExpression1.ts === var v = `foo ${ a >v : string ->`foo ${ a : string +>`foo ${ a : `foo ${any}` >a : any diff --git a/tests/baselines/reference/accessorsOverrideProperty2.types b/tests/baselines/reference/accessorsOverrideProperty2.types index 860b6f4f021cf..228dc06299b92 100644 --- a/tests/baselines/reference/accessorsOverrideProperty2.types +++ b/tests/baselines/reference/accessorsOverrideProperty2.types @@ -22,7 +22,7 @@ class Derived extends Base { >console.log : (...data: any[]) => void >console : Console >log : (...data: any[]) => void ->`x was set to ${value}` : string +>`x was set to ${value}` : `x was set to ${number}` >value : number } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index ccc5d1fa1fc44..b8ccd0e73d1cf 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2484,6 +2484,8 @@ declare namespace ts { Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, + StringLikeLiteral = 134217856, + FreshableLiteral = 134220672, PossiblyFalsy = 117724, StringLike = 402653316, NumberLike = 296, @@ -2509,6 +2511,7 @@ declare namespace ts { aliasSymbol?: Symbol; aliasTypeArguments?: readonly Type[]; } + export type FreshableType = FreshableLiteralType | FreshableIntrinsicType; export interface LiteralType extends Type { value: string | number | PseudoBigInt; freshType: LiteralType; @@ -2653,6 +2656,8 @@ declare namespace ts { export interface TemplateLiteralType extends InstantiableType { texts: readonly string[]; types: readonly Type[]; + freshType: TemplateLiteralType; + regularType: TemplateLiteralType; } export interface StringMappingType extends InstantiableType { symbol: Symbol; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 440cebf6b0de6..a3dea2016e000 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2484,6 +2484,8 @@ declare namespace ts { Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, + StringLikeLiteral = 134217856, + FreshableLiteral = 134220672, PossiblyFalsy = 117724, StringLike = 402653316, NumberLike = 296, @@ -2509,6 +2511,7 @@ declare namespace ts { aliasSymbol?: Symbol; aliasTypeArguments?: readonly Type[]; } + export type FreshableType = FreshableLiteralType | FreshableIntrinsicType; export interface LiteralType extends Type { value: string | number | PseudoBigInt; freshType: LiteralType; @@ -2653,6 +2656,8 @@ declare namespace ts { export interface TemplateLiteralType extends InstantiableType { texts: readonly string[]; types: readonly Type[]; + freshType: TemplateLiteralType; + regularType: TemplateLiteralType; } export interface StringMappingType extends InstantiableType { symbol: Symbol; diff --git a/tests/baselines/reference/asOperator3.types b/tests/baselines/reference/asOperator3.types index e5e319d3caf3a..1e40a6e218d1a 100644 --- a/tests/baselines/reference/asOperator3.types +++ b/tests/baselines/reference/asOperator3.types @@ -5,7 +5,7 @@ declare function tag(...x: any[]): any; var a = `${123 + 456 as number}`; >a : string ->`${123 + 456 as number}` : string +>`${123 + 456 as number}` : `${number}` >123 + 456 as number : number >123 + 456 : number >123 : 123 @@ -13,7 +13,7 @@ var a = `${123 + 456 as number}`; var b = `leading ${123 + 456 as number}`; >b : string ->`leading ${123 + 456 as number}` : string +>`leading ${123 + 456 as number}` : `leading ${number}` >123 + 456 as number : number >123 + 456 : number >123 : 123 @@ -21,7 +21,7 @@ var b = `leading ${123 + 456 as number}`; var c = `${123 + 456 as number} trailing`; >c : string ->`${123 + 456 as number} trailing` : string +>`${123 + 456 as number} trailing` : `${number} trailing` >123 + 456 as number : number >123 + 456 : number >123 : 123 @@ -30,7 +30,7 @@ var c = `${123 + 456 as number} trailing`; var d = `Hello ${123} World` as string; >d : string >`Hello ${123} World` as string : string ->`Hello ${123} World` : string +>`Hello ${123} World` : "Hello 123 World" >123 : 123 var e = `Hello` as string; @@ -43,7 +43,7 @@ var f = 1 + `${1} end of string` as string; >1 + `${1} end of string` as string : string >1 + `${1} end of string` : string >1 : 1 ->`${1} end of string` : string +>`${1} end of string` : "1 end of string" >1 : 1 var g = tag `Hello ${123} World` as string; @@ -51,7 +51,7 @@ var g = tag `Hello ${123} World` as string; >tag `Hello ${123} World` as string : string >tag `Hello ${123} World` : any >tag : (...x: any[]) => any ->`Hello ${123} World` : string +>`Hello ${123} World` : "Hello 123 World" >123 : 123 var h = tag `Hello` as string; diff --git a/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.types b/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.types index 21653432b5acb..465cbf72e815f 100644 --- a/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.types +++ b/tests/baselines/reference/checkJsObjectLiteralIndexSignatures.types @@ -10,7 +10,7 @@ let n = Math.random(); let s = `${n}`; >s : string ->`${n}` : string +>`${n}` : `${number}` >n : number const numericIndex = { [n]: 1 }; diff --git a/tests/baselines/reference/computedPropertyNames10_ES5.types b/tests/baselines/reference/computedPropertyNames10_ES5.types index 82d82bcc638fd..7c89309b32e02 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES5.types +++ b/tests/baselines/reference/computedPropertyNames10_ES5.types @@ -60,6 +60,6 @@ var v = { [`hello ${a} bye`]() { } >[`hello ${a} bye`] : () => void ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any } diff --git a/tests/baselines/reference/computedPropertyNames10_ES6.types b/tests/baselines/reference/computedPropertyNames10_ES6.types index c9ad6eeebb6c4..355fc7c58208d 100644 --- a/tests/baselines/reference/computedPropertyNames10_ES6.types +++ b/tests/baselines/reference/computedPropertyNames10_ES6.types @@ -60,6 +60,6 @@ var v = { [`hello ${a} bye`]() { } >[`hello ${a} bye`] : () => void ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any } diff --git a/tests/baselines/reference/computedPropertyNames11_ES5.types b/tests/baselines/reference/computedPropertyNames11_ES5.types index 944f4a4cfcc3b..b66b419310d83 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES5.types +++ b/tests/baselines/reference/computedPropertyNames11_ES5.types @@ -70,7 +70,7 @@ var v = { get [`hello ${a} bye`]() { return 0; } >[`hello ${a} bye`] : number ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any >0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames11_ES6.types b/tests/baselines/reference/computedPropertyNames11_ES6.types index 1d9551ea082be..40e0c98488eb1 100644 --- a/tests/baselines/reference/computedPropertyNames11_ES6.types +++ b/tests/baselines/reference/computedPropertyNames11_ES6.types @@ -70,7 +70,7 @@ var v = { get [`hello ${a} bye`]() { return 0; } >[`hello ${a} bye`] : number ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any >0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames12_ES5.types b/tests/baselines/reference/computedPropertyNames12_ES5.types index 63afc3bd4da0b..cc7d1a29755dd 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES5.types +++ b/tests/baselines/reference/computedPropertyNames12_ES5.types @@ -63,7 +63,7 @@ class C { static [`hello ${a} bye`] = 0 >[`hello ${a} bye`] : number ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any >0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames12_ES6.types b/tests/baselines/reference/computedPropertyNames12_ES6.types index f846d159eec08..d1da7d7aab9dd 100644 --- a/tests/baselines/reference/computedPropertyNames12_ES6.types +++ b/tests/baselines/reference/computedPropertyNames12_ES6.types @@ -63,7 +63,7 @@ class C { static [`hello ${a} bye`] = 0 >[`hello ${a} bye`] : number ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any >0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames13_ES5.types b/tests/baselines/reference/computedPropertyNames13_ES5.types index 07c5cee22cd0e..33c89a82c94c6 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES5.types +++ b/tests/baselines/reference/computedPropertyNames13_ES5.types @@ -59,6 +59,6 @@ class C { static [`hello ${a} bye`]() { } >[`hello ${a} bye`] : () => void ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any } diff --git a/tests/baselines/reference/computedPropertyNames13_ES6.types b/tests/baselines/reference/computedPropertyNames13_ES6.types index 8e0111d760022..57a4bb9b46548 100644 --- a/tests/baselines/reference/computedPropertyNames13_ES6.types +++ b/tests/baselines/reference/computedPropertyNames13_ES6.types @@ -59,6 +59,6 @@ class C { static [`hello ${a} bye`]() { } >[`hello ${a} bye`] : () => void ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any } diff --git a/tests/baselines/reference/computedPropertyNames16_ES5.types b/tests/baselines/reference/computedPropertyNames16_ES5.types index 7e6d5054098ec..468f77b322975 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES5.types +++ b/tests/baselines/reference/computedPropertyNames16_ES5.types @@ -69,7 +69,7 @@ class C { get [`hello ${a} bye`]() { return 0; } >[`hello ${a} bye`] : number ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any >0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames16_ES6.types b/tests/baselines/reference/computedPropertyNames16_ES6.types index 9898cbc00d4dc..558af27cea7bd 100644 --- a/tests/baselines/reference/computedPropertyNames16_ES6.types +++ b/tests/baselines/reference/computedPropertyNames16_ES6.types @@ -69,7 +69,7 @@ class C { get [`hello ${a} bye`]() { return 0; } >[`hello ${a} bye`] : number ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any >0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames4_ES5.types b/tests/baselines/reference/computedPropertyNames4_ES5.types index b9181140ed56c..ba6d3c6d9e828 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES5.types +++ b/tests/baselines/reference/computedPropertyNames4_ES5.types @@ -70,7 +70,7 @@ var v = { [`hello ${a} bye`]: 0 >[`hello ${a} bye`] : number ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any >0 : 0 } diff --git a/tests/baselines/reference/computedPropertyNames4_ES6.types b/tests/baselines/reference/computedPropertyNames4_ES6.types index 669af26ebdf12..a25ca0f7bc153 100644 --- a/tests/baselines/reference/computedPropertyNames4_ES6.types +++ b/tests/baselines/reference/computedPropertyNames4_ES6.types @@ -70,7 +70,7 @@ var v = { [`hello ${a} bye`]: 0 >[`hello ${a} bye`] : number ->`hello ${a} bye` : string +>`hello ${a} bye` : `hello ${any} bye` >a : any >0 : 0 } diff --git a/tests/baselines/reference/declFileEmitDeclarationOnly.types b/tests/baselines/reference/declFileEmitDeclarationOnly.types index 9a3cf8cfc70b0..f508a00cc71fa 100644 --- a/tests/baselines/reference/declFileEmitDeclarationOnly.types +++ b/tests/baselines/reference/declFileEmitDeclarationOnly.types @@ -23,7 +23,7 @@ class HelloWorld { >Log.info : (msg: string) => void >Log : { info(msg: string): void; } >info : (msg: string) => void ->`Hello ${this.name}` : string +>`Hello ${this.name}` : `Hello ${string}` >this.name : string >this : this >name : string diff --git a/tests/baselines/reference/declarationNoDanglingGenerics.types b/tests/baselines/reference/declarationNoDanglingGenerics.types index 9fd057e32f3d9..65c381a2e4673 100644 --- a/tests/baselines/reference/declarationNoDanglingGenerics.types +++ b/tests/baselines/reference/declarationNoDanglingGenerics.types @@ -16,7 +16,7 @@ function register(kind: string): void | never { throw new Error(`Class with kind "${kind}" is already registered.`); >new Error(`Class with kind "${kind}" is already registered.`) : Error >Error : ErrorConstructor ->`Class with kind "${kind}" is already registered.` : string +>`Class with kind "${kind}" is already registered.` : `Class with kind "${string}" is already registered.` >kind : string } kindCache[kind] = true; diff --git a/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.types b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.types index d0ddb4918a034..551e2e99339a7 100644 --- a/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.types +++ b/tests/baselines/reference/destructuringInitializerContextualTypeFromContext.types @@ -34,7 +34,7 @@ const Parent: SFC = ({ const Child: SFC = ({ >Child : SFC ->({ children, name = "Artemis", ...props}) => `name: ${name} props: ${JSON.stringify(props)}` : ({ children, name, ...props }: Props & { children?: any; }) => string +>({ children, name = "Artemis", ...props}) => `name: ${name} props: ${JSON.stringify(props)}` : ({ children, name, ...props }: Props & { children?: any; }) => `name: Apollo props: ${string}` | `name: Artemis props: ${string}` | `name: Dionysus props: ${string}` | `name: Persephone props: ${string}` children, >children : any @@ -47,7 +47,7 @@ const Child: SFC = ({ >props : {} }) => `name: ${name} props: ${JSON.stringify(props)}`; ->`name: ${name} props: ${JSON.stringify(props)}` : string +>`name: ${name} props: ${JSON.stringify(props)}` : `name: Apollo props: ${string}` | `name: Artemis props: ${string}` | `name: Dionysus props: ${string}` | `name: Persephone props: ${string}` >name : "Apollo" | "Artemis" | "Dionysus" | "Persephone" >JSON.stringify(props) : string >JSON.stringify : { (value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string; (value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string; } diff --git a/tests/baselines/reference/destructuringParameterProperties4.types b/tests/baselines/reference/destructuringParameterProperties4.types index 8f49dc9ba9110..0f6e7d88ad59e 100644 --- a/tests/baselines/reference/destructuringParameterProperties4.types +++ b/tests/baselines/reference/destructuringParameterProperties4.types @@ -75,10 +75,10 @@ class C2 extends C1 { >C1 : C1 public doSomethingWithSuperProperties() { ->doSomethingWithSuperProperties : () => string +>doSomethingWithSuperProperties : () => `${any} ${any} ${any}` return `${this.a} ${this.b} ${this.c}`; ->`${this.a} ${this.b} ${this.c}` : string +>`${this.a} ${this.b} ${this.c}` : `${any} ${any} ${any}` >this.a : any >this : this >a : any diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types index 912a26f746ff7..0ed777f4e3c00 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4.types @@ -12,14 +12,14 @@ var s; // With TemplateTail `${t1 ** -t2} world`; ->`${t1 ** -t2} world` : string +>`${t1 ** -t2} world` : `${number} world` >t1 ** -t2 : number >t1 : number >-t2 : number >t2 : number `${(-t1) ** t2 - t1} world`; ->`${(-t1) ** t2 - t1} world` : string +>`${(-t1) ** t2 - t1} world` : `${number} world` >(-t1) ** t2 - t1 : number >(-t1) ** t2 : number >(-t1) : number @@ -29,7 +29,7 @@ var s; >t1 : number `${(-++t1) ** t2 - t1} world`; ->`${(-++t1) ** t2 - t1} world` : string +>`${(-++t1) ** t2 - t1} world` : `${number} world` >(-++t1) ** t2 - t1 : number >(-++t1) ** t2 : number >(-++t1) : number @@ -40,7 +40,7 @@ var s; >t1 : number `${(-t1++) ** t2 - t1} world`; ->`${(-t1++) ** t2 - t1} world` : string +>`${(-t1++) ** t2 - t1} world` : `${number} world` >(-t1++) ** t2 - t1 : number >(-t1++) ** t2 : number >(-t1++) : number @@ -51,7 +51,7 @@ var s; >t1 : number `${(~t1) ** t2 ** --t1 } world`; ->`${(~t1) ** t2 ** --t1 } world` : string +>`${(~t1) ** t2 ** --t1 } world` : `${number} world` >(~t1) ** t2 ** --t1 : number >(~t1) : number >~t1 : number @@ -62,7 +62,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) } world`; ->`${typeof (t1 ** t2 ** t1) } world` : string +>`${typeof (t1 ** t2 ** t1) } world` : "string world" | "number world" | "bigint world" | "boolean world" | "symbol world" | "undefined world" | "object world" | "function world" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -73,7 +73,7 @@ var s; // TempateHead & TemplateTail are empt `${t1 ** -t2} hello world ${t1 ** -t2}`; ->`${t1 ** -t2} hello world ${t1 ** -t2}` : string +>`${t1 ** -t2} hello world ${t1 ** -t2}` : `${number} hello world ${number}` >t1 ** -t2 : number >t1 : number >-t2 : number @@ -84,7 +84,7 @@ var s; >t2 : number `${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; ->`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}` : string +>`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}` : `${number} hello world ${number}` >(-t1) ** t2 - t1 : number >(-t1) ** t2 : number >(-t1) : number @@ -101,7 +101,7 @@ var s; >t1 : number `${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; ->`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}` : string +>`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}` : `${number} hello world ${number}` >(-++t1) ** t2 - t1 : number >(-++t1) ** t2 : number >(-++t1) : number @@ -121,7 +121,7 @@ var s; >t1 : number `${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; ->`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}` : string +>`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}` : `${number} hello world ${number}` >(-t1++) ** t2 - t1 : number >(-t1++) ** t2 : number >(-t1++) : number @@ -141,7 +141,7 @@ var s; >t1 : number `${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; ->`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }` : string +>`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }` : `${number} hello world ${number}` >(~t1) ** t2 ** --t1 : number >(~t1) : number >~t1 : number @@ -160,7 +160,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; ->`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}` : string +>`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}` : "string hello world string" | "string hello world number" | "string hello world bigint" | "string hello world boolean" | "string hello world symbol" | "string hello world undefined" | "string hello world object" | "string hello world function" | "number hello world string" | "number hello world number" | "number hello world bigint" | "number hello world boolean" | "number hello world symbol" | "number hello world undefined" | "number hello world object" | "number hello world function" | "bigint hello world string" | "bigint hello world number" | "bigint hello world bigint" | "bigint hello world boolean" | "bigint hello world symbol" | "bigint hello world undefined" | "bigint hello world object" | "bigint hello world function" | "boolean hello world string" | "boolean hello world number" | "boolean hello world bigint" | "boolean hello world boolean" | "boolean hello world symbol" | "boolean hello world undefined" | "boolean hello world object" | "boolean hello world function" | "symbol hello world string" | "symbol hello world number" | "symbol hello world bigint" | "symbol hello world boolean" | "symbol hello world symbol" | "symbol hello world undefined" | "symbol hello world object" | "symbol hello world function" | "undefined hello world string" | "undefined hello world number" | "undefined hello world bigint" | "undefined hello world boolean" | "undefined hello world symbol" | "undefined hello world undefined" | "undefined hello world object" | "undefined hello world function" | "object hello world string" | "object hello world number" | "object hello world bigint" | "object hello world boolean" | "object hello world symbol" | "object hello world undefined" | "object hello world object" | "object hello world function" | "function hello world string" | "function hello world number" | "function hello world bigint" | "function hello world boolean" | "function hello world symbol" | "function hello world undefined" | "function hello world object" | "function hello world function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -178,7 +178,7 @@ var s; // With templateHead `hello ${(-t1) ** t2 - t1}`; ->`hello ${(-t1) ** t2 - t1}` : string +>`hello ${(-t1) ** t2 - t1}` : `hello ${number}` >(-t1) ** t2 - t1 : number >(-t1) ** t2 : number >(-t1) : number @@ -188,7 +188,7 @@ var s; >t1 : number `hello ${(-++t1) ** t2 - t1}`; ->`hello ${(-++t1) ** t2 - t1}` : string +>`hello ${(-++t1) ** t2 - t1}` : `hello ${number}` >(-++t1) ** t2 - t1 : number >(-++t1) ** t2 : number >(-++t1) : number @@ -199,7 +199,7 @@ var s; >t1 : number `hello ${(-t1++) ** t2 - t1}`; ->`hello ${(-t1++) ** t2 - t1}` : string +>`hello ${(-t1++) ** t2 - t1}` : `hello ${number}` >(-t1++) ** t2 - t1 : number >(-t1++) ** t2 : number >(-t1++) : number @@ -210,7 +210,7 @@ var s; >t1 : number `hello ${(~t1) ** t2 ** --t1 }`; ->`hello ${(~t1) ** t2 ** --t1 }` : string +>`hello ${(~t1) ** t2 ** --t1 }` : `hello ${number}` >(~t1) ** t2 ** --t1 : number >(~t1) : number >~t1 : number @@ -221,7 +221,7 @@ var s; >t1 : number `hello ${typeof (t1 ** t2 ** t1)}`; ->`hello ${typeof (t1 ** t2 ** t1)}` : string +>`hello ${typeof (t1 ** t2 ** t1)}` : "hello string" | "hello number" | "hello bigint" | "hello boolean" | "hello symbol" | "hello undefined" | "hello object" | "hello function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types index 08d0d591dfb1b..e984817fd5a8a 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTempalteString4ES6.types @@ -12,14 +12,14 @@ var s; // With TemplateTail `${t1 ** -t2} world`; ->`${t1 ** -t2} world` : string +>`${t1 ** -t2} world` : `${number} world` >t1 ** -t2 : number >t1 : number >-t2 : number >t2 : number `${(-t1) ** t2 - t1} world`; ->`${(-t1) ** t2 - t1} world` : string +>`${(-t1) ** t2 - t1} world` : `${number} world` >(-t1) ** t2 - t1 : number >(-t1) ** t2 : number >(-t1) : number @@ -29,7 +29,7 @@ var s; >t1 : number `${(-++t1) ** t2 - t1} world`; ->`${(-++t1) ** t2 - t1} world` : string +>`${(-++t1) ** t2 - t1} world` : `${number} world` >(-++t1) ** t2 - t1 : number >(-++t1) ** t2 : number >(-++t1) : number @@ -40,7 +40,7 @@ var s; >t1 : number `${(-t1++) ** t2 - t1} world`; ->`${(-t1++) ** t2 - t1} world` : string +>`${(-t1++) ** t2 - t1} world` : `${number} world` >(-t1++) ** t2 - t1 : number >(-t1++) ** t2 : number >(-t1++) : number @@ -51,7 +51,7 @@ var s; >t1 : number `${(~t1) ** t2 ** --t1 } world`; ->`${(~t1) ** t2 ** --t1 } world` : string +>`${(~t1) ** t2 ** --t1 } world` : `${number} world` >(~t1) ** t2 ** --t1 : number >(~t1) : number >~t1 : number @@ -62,7 +62,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) } world`; ->`${typeof (t1 ** t2 ** t1) } world` : string +>`${typeof (t1 ** t2 ** t1) } world` : "string world" | "number world" | "bigint world" | "boolean world" | "symbol world" | "undefined world" | "object world" | "function world" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -73,7 +73,7 @@ var s; // TempateHead & TemplateTail are empt `${t1 ** -t2} hello world ${t1 ** -t2}`; ->`${t1 ** -t2} hello world ${t1 ** -t2}` : string +>`${t1 ** -t2} hello world ${t1 ** -t2}` : `${number} hello world ${number}` >t1 ** -t2 : number >t1 : number >-t2 : number @@ -84,7 +84,7 @@ var s; >t2 : number `${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}`; ->`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}` : string +>`${(-t1) ** t2 - t1} hello world ${(-t1) ** t2 - t1}` : `${number} hello world ${number}` >(-t1) ** t2 - t1 : number >(-t1) ** t2 : number >(-t1) : number @@ -101,7 +101,7 @@ var s; >t1 : number `${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}`; ->`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}` : string +>`${(-++t1) ** t2 - t1} hello world ${t1 ** (-++t1) **- t1}` : `${number} hello world ${number}` >(-++t1) ** t2 - t1 : number >(-++t1) ** t2 : number >(-++t1) : number @@ -121,7 +121,7 @@ var s; >t1 : number `${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}`; ->`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}` : string +>`${(-t1++) ** t2 - t1} hello world ${t2 ** (-t1++) ** - t1}` : `${number} hello world ${number}` >(-t1++) ** t2 - t1 : number >(-t1++) ** t2 : number >(-t1++) : number @@ -141,7 +141,7 @@ var s; >t1 : number `${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }`; ->`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }` : string +>`${(~t1) ** t2 ** --t1 } hello world ${(~t1) ** t2 ** --t1 }` : `${number} hello world ${number}` >(~t1) ** t2 ** --t1 : number >(~t1) : number >~t1 : number @@ -160,7 +160,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}`; ->`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}` : string +>`${typeof (t1 ** t2 ** t1)} hello world ${typeof (t1 ** t2 ** t1)}` : "string hello world string" | "string hello world number" | "string hello world bigint" | "string hello world boolean" | "string hello world symbol" | "string hello world undefined" | "string hello world object" | "string hello world function" | "number hello world string" | "number hello world number" | "number hello world bigint" | "number hello world boolean" | "number hello world symbol" | "number hello world undefined" | "number hello world object" | "number hello world function" | "bigint hello world string" | "bigint hello world number" | "bigint hello world bigint" | "bigint hello world boolean" | "bigint hello world symbol" | "bigint hello world undefined" | "bigint hello world object" | "bigint hello world function" | "boolean hello world string" | "boolean hello world number" | "boolean hello world bigint" | "boolean hello world boolean" | "boolean hello world symbol" | "boolean hello world undefined" | "boolean hello world object" | "boolean hello world function" | "symbol hello world string" | "symbol hello world number" | "symbol hello world bigint" | "symbol hello world boolean" | "symbol hello world symbol" | "symbol hello world undefined" | "symbol hello world object" | "symbol hello world function" | "undefined hello world string" | "undefined hello world number" | "undefined hello world bigint" | "undefined hello world boolean" | "undefined hello world symbol" | "undefined hello world undefined" | "undefined hello world object" | "undefined hello world function" | "object hello world string" | "object hello world number" | "object hello world bigint" | "object hello world boolean" | "object hello world symbol" | "object hello world undefined" | "object hello world object" | "object hello world function" | "function hello world string" | "function hello world number" | "function hello world bigint" | "function hello world boolean" | "function hello world symbol" | "function hello world undefined" | "function hello world object" | "function hello world function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -178,7 +178,7 @@ var s; // With templateHead `hello ${(-t1) ** t2 - t1}`; ->`hello ${(-t1) ** t2 - t1}` : string +>`hello ${(-t1) ** t2 - t1}` : `hello ${number}` >(-t1) ** t2 - t1 : number >(-t1) ** t2 : number >(-t1) : number @@ -188,7 +188,7 @@ var s; >t1 : number `hello ${(-++t1) ** t2 - t1}`; ->`hello ${(-++t1) ** t2 - t1}` : string +>`hello ${(-++t1) ** t2 - t1}` : `hello ${number}` >(-++t1) ** t2 - t1 : number >(-++t1) ** t2 : number >(-++t1) : number @@ -199,7 +199,7 @@ var s; >t1 : number `hello ${(-t1++) ** t2 - t1}`; ->`hello ${(-t1++) ** t2 - t1}` : string +>`hello ${(-t1++) ** t2 - t1}` : `hello ${number}` >(-t1++) ** t2 - t1 : number >(-t1++) ** t2 : number >(-t1++) : number @@ -210,7 +210,7 @@ var s; >t1 : number `hello ${(~t1) ** t2 ** --t1 }`; ->`hello ${(~t1) ** t2 ** --t1 }` : string +>`hello ${(~t1) ** t2 ** --t1 }` : `hello ${number}` >(~t1) ** t2 ** --t1 : number >(~t1) : number >~t1 : number @@ -221,7 +221,7 @@ var s; >t1 : number `hello ${typeof (t1 ** t2 ** t1)}`; ->`hello ${typeof (t1 ** t2 ** t1)}` : string +>`hello ${typeof (t1 ** t2 ** t1)}` : "hello string" | "hello number" | "hello bigint" | "hello boolean" | "hello symbol" | "hello undefined" | "hello object" | "hello function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types index 0a40fc6f766e9..91e19730aff47 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1.types @@ -12,13 +12,13 @@ var s; // TempateHead & TemplateTail are empty `${t1 ** t2}`; ->`${t1 ** t2}` : string +>`${t1 ** t2}` : `${number}` >t1 ** t2 : number >t1 : number >t2 : number `${t1 ** t2 ** t1}`; ->`${t1 ** t2 ** t1}` : string +>`${t1 ** t2 ** t1}` : `${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -26,7 +26,7 @@ var s; >t1 : number `${t1 + t2 ** t1}`; ->`${t1 + t2 ** t1}` : string +>`${t1 + t2 ** t1}` : `${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -34,7 +34,7 @@ var s; >t1 : number `${t1 ** t2 + t1}`; ->`${t1 ** t2 + t1}` : string +>`${t1 ** t2 + t1}` : `${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -42,7 +42,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1 }`; ->`${t1 + t2 ** t2 + t1 }` : string +>`${t1 + t2 ** t2 + t1 }` : `${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -52,7 +52,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) }`; ->`${typeof (t1 ** t2 ** t1) }` : string +>`${typeof (t1 ** t2 ** t1) }` : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -74,7 +74,7 @@ var s; >t1 : number `${t1 ** t2}${t1 ** t2}`; ->`${t1 ** t2}${t1 ** t2}` : string +>`${t1 ** t2}${t1 ** t2}` : `${number}${number}` >t1 ** t2 : number >t1 : number >t2 : number @@ -83,7 +83,7 @@ var s; >t2 : number `${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; ->`${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : string +>`${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : `${number}${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -96,7 +96,7 @@ var s; >t1 : number `${t1 + t2 ** t1}${t1 + t2 ** t1}`; ->`${t1 + t2 ** t1}${t1 + t2 ** t1}` : string +>`${t1 + t2 ** t1}${t1 + t2 ** t1}` : `${number}${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -109,7 +109,7 @@ var s; >t1 : number `${t1 ** t2 + t1}${t1 ** t2 + t1}`; ->`${t1 ** t2 + t1}${t1 ** t2 + t1}` : string +>`${t1 ** t2 + t1}${t1 ** t2 + t1}` : `${number}${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -122,7 +122,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; ->`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : string +>`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : `${number}${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -139,7 +139,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; ->`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}` : string +>`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}` : "stringstring" | "stringnumber" | "stringbigint" | "stringboolean" | "stringsymbol" | "stringundefined" | "stringobject" | "stringfunction" | "numberstring" | "numbernumber" | "numberbigint" | "numberboolean" | "numbersymbol" | "numberundefined" | "numberobject" | "numberfunction" | "bigintstring" | "bigintnumber" | "bigintbigint" | "bigintboolean" | "bigintsymbol" | "bigintundefined" | "bigintobject" | "bigintfunction" | "booleanstring" | "booleannumber" | "booleanbigint" | "booleanboolean" | "booleansymbol" | "booleanundefined" | "booleanobject" | "booleanfunction" | "symbolstring" | "symbolnumber" | "symbolbigint" | "symbolboolean" | "symbolsymbol" | "symbolundefined" | "symbolobject" | "symbolfunction" | "undefinedstring" | "undefinednumber" | "undefinedbigint" | "undefinedboolean" | "undefinedsymbol" | "undefinedundefined" | "undefinedobject" | "undefinedfunction" | "objectstring" | "objectnumber" | "objectbigint" | "objectboolean" | "objectsymbol" | "objectundefined" | "objectobject" | "objectfunction" | "functionstring" | "functionnumber" | "functionbigint" | "functionboolean" | "functionsymbol" | "functionundefined" | "functionobject" | "functionfunction" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -156,7 +156,7 @@ var s; >t1 : number `${t1 ** t2} hello world ${t1 ** t2}`; ->`${t1 ** t2} hello world ${t1 ** t2}` : string +>`${t1 ** t2} hello world ${t1 ** t2}` : `${number} hello world ${number}` >t1 ** t2 : number >t1 : number >t2 : number @@ -165,7 +165,7 @@ var s; >t2 : number `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; ->`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : string +>`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : `${number} hello world ${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -178,7 +178,7 @@ var s; >t1 : number `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; ->`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : string +>`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : `${number} hello world ${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -191,7 +191,7 @@ var s; >t1 : number `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; ->`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : string +>`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : `${number} hello world ${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -204,7 +204,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; ->`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : string +>`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : `${number} hello world ${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -221,7 +221,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; ->`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : string +>`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : "string hello world string" | "string hello world number" | "string hello world bigint" | "string hello world boolean" | "string hello world symbol" | "string hello world undefined" | "string hello world object" | "string hello world function" | "number hello world string" | "number hello world number" | "number hello world bigint" | "number hello world boolean" | "number hello world symbol" | "number hello world undefined" | "number hello world object" | "number hello world function" | "bigint hello world string" | "bigint hello world number" | "bigint hello world bigint" | "bigint hello world boolean" | "bigint hello world symbol" | "bigint hello world undefined" | "bigint hello world object" | "bigint hello world function" | "boolean hello world string" | "boolean hello world number" | "boolean hello world bigint" | "boolean hello world boolean" | "boolean hello world symbol" | "boolean hello world undefined" | "boolean hello world object" | "boolean hello world function" | "symbol hello world string" | "symbol hello world number" | "symbol hello world bigint" | "symbol hello world boolean" | "symbol hello world symbol" | "symbol hello world undefined" | "symbol hello world object" | "symbol hello world function" | "undefined hello world string" | "undefined hello world number" | "undefined hello world bigint" | "undefined hello world boolean" | "undefined hello world symbol" | "undefined hello world undefined" | "undefined hello world object" | "undefined hello world function" | "object hello world string" | "object hello world number" | "object hello world bigint" | "object hello world boolean" | "object hello world symbol" | "object hello world undefined" | "object hello world object" | "object hello world function" | "function hello world string" | "function hello world number" | "function hello world bigint" | "function hello world boolean" | "function hello world symbol" | "function hello world undefined" | "function hello world object" | "function hello world function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types index 9d712e6e366c4..8f58a022c2b0a 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString1ES6.types @@ -12,13 +12,13 @@ var s; // TempateHead & TemplateTail are empty `${t1 ** t2}`; ->`${t1 ** t2}` : string +>`${t1 ** t2}` : `${number}` >t1 ** t2 : number >t1 : number >t2 : number `${t1 ** t2 ** t1}`; ->`${t1 ** t2 ** t1}` : string +>`${t1 ** t2 ** t1}` : `${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -26,7 +26,7 @@ var s; >t1 : number `${t1 + t2 ** t1}`; ->`${t1 + t2 ** t1}` : string +>`${t1 + t2 ** t1}` : `${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -34,7 +34,7 @@ var s; >t1 : number `${t1 ** t2 + t1}`; ->`${t1 ** t2 + t1}` : string +>`${t1 ** t2 + t1}` : `${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -42,7 +42,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1 }`; ->`${t1 + t2 ** t2 + t1 }` : string +>`${t1 + t2 ** t2 + t1 }` : `${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -52,7 +52,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) }`; ->`${typeof (t1 ** t2 ** t1) }` : string +>`${typeof (t1 ** t2 ** t1) }` : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -74,7 +74,7 @@ var s; >t1 : number `${t1 ** t2}${t1 ** t2}`; ->`${t1 ** t2}${t1 ** t2}` : string +>`${t1 ** t2}${t1 ** t2}` : `${number}${number}` >t1 ** t2 : number >t1 : number >t2 : number @@ -83,7 +83,7 @@ var s; >t2 : number `${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; ->`${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : string +>`${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : `${number}${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -96,7 +96,7 @@ var s; >t1 : number `${t1 + t2 ** t1}${t1 + t2 ** t1}`; ->`${t1 + t2 ** t1}${t1 + t2 ** t1}` : string +>`${t1 + t2 ** t1}${t1 + t2 ** t1}` : `${number}${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -109,7 +109,7 @@ var s; >t1 : number `${t1 ** t2 + t1}${t1 ** t2 + t1}`; ->`${t1 ** t2 + t1}${t1 ** t2 + t1}` : string +>`${t1 ** t2 + t1}${t1 ** t2 + t1}` : `${number}${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -122,7 +122,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; ->`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : string +>`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : `${number}${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -139,7 +139,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}`; ->`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}` : string +>`${typeof (t1 ** t2 ** t1)}${typeof (t1 ** t2 ** t1)}` : "stringstring" | "stringnumber" | "stringbigint" | "stringboolean" | "stringsymbol" | "stringundefined" | "stringobject" | "stringfunction" | "numberstring" | "numbernumber" | "numberbigint" | "numberboolean" | "numbersymbol" | "numberundefined" | "numberobject" | "numberfunction" | "bigintstring" | "bigintnumber" | "bigintbigint" | "bigintboolean" | "bigintsymbol" | "bigintundefined" | "bigintobject" | "bigintfunction" | "booleanstring" | "booleannumber" | "booleanbigint" | "booleanboolean" | "booleansymbol" | "booleanundefined" | "booleanobject" | "booleanfunction" | "symbolstring" | "symbolnumber" | "symbolbigint" | "symbolboolean" | "symbolsymbol" | "symbolundefined" | "symbolobject" | "symbolfunction" | "undefinedstring" | "undefinednumber" | "undefinedbigint" | "undefinedboolean" | "undefinedsymbol" | "undefinedundefined" | "undefinedobject" | "undefinedfunction" | "objectstring" | "objectnumber" | "objectbigint" | "objectboolean" | "objectsymbol" | "objectundefined" | "objectobject" | "objectfunction" | "functionstring" | "functionnumber" | "functionbigint" | "functionboolean" | "functionsymbol" | "functionundefined" | "functionobject" | "functionfunction" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -156,7 +156,7 @@ var s; >t1 : number `${t1 ** t2} hello world ${t1 ** t2}`; ->`${t1 ** t2} hello world ${t1 ** t2}` : string +>`${t1 ** t2} hello world ${t1 ** t2}` : `${number} hello world ${number}` >t1 ** t2 : number >t1 : number >t2 : number @@ -165,7 +165,7 @@ var s; >t2 : number `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; ->`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : string +>`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : `${number} hello world ${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -178,7 +178,7 @@ var s; >t1 : number `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; ->`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : string +>`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : `${number} hello world ${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -191,7 +191,7 @@ var s; >t1 : number `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; ->`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : string +>`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : `${number} hello world ${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -204,7 +204,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; ->`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : string +>`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : `${number} hello world ${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -221,7 +221,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; ->`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : string +>`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : "string hello world string" | "string hello world number" | "string hello world bigint" | "string hello world boolean" | "string hello world symbol" | "string hello world undefined" | "string hello world object" | "string hello world function" | "number hello world string" | "number hello world number" | "number hello world bigint" | "number hello world boolean" | "number hello world symbol" | "number hello world undefined" | "number hello world object" | "number hello world function" | "bigint hello world string" | "bigint hello world number" | "bigint hello world bigint" | "bigint hello world boolean" | "bigint hello world symbol" | "bigint hello world undefined" | "bigint hello world object" | "bigint hello world function" | "boolean hello world string" | "boolean hello world number" | "boolean hello world bigint" | "boolean hello world boolean" | "boolean hello world symbol" | "boolean hello world undefined" | "boolean hello world object" | "boolean hello world function" | "symbol hello world string" | "symbol hello world number" | "symbol hello world bigint" | "symbol hello world boolean" | "symbol hello world symbol" | "symbol hello world undefined" | "symbol hello world object" | "symbol hello world function" | "undefined hello world string" | "undefined hello world number" | "undefined hello world bigint" | "undefined hello world boolean" | "undefined hello world symbol" | "undefined hello world undefined" | "undefined hello world object" | "undefined hello world function" | "object hello world string" | "object hello world number" | "object hello world bigint" | "object hello world boolean" | "object hello world symbol" | "object hello world undefined" | "object hello world object" | "object hello world function" | "function hello world string" | "function hello world number" | "function hello world bigint" | "function hello world boolean" | "function hello world symbol" | "function hello world undefined" | "function hello world object" | "function hello world function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types index 9b583b03d2836..b2d570b2d3650 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2.types @@ -12,13 +12,13 @@ var s; // With templateHead `hello ${t1 ** t2}`; ->`hello ${t1 ** t2}` : string +>`hello ${t1 ** t2}` : `hello ${number}` >t1 ** t2 : number >t1 : number >t2 : number `hello ${t1 ** t2 ** t1}`; ->`hello ${t1 ** t2 ** t1}` : string +>`hello ${t1 ** t2 ** t1}` : `hello ${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -26,7 +26,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t1}`; ->`hello ${t1 + t2 ** t1}` : string +>`hello ${t1 + t2 ** t1}` : `hello ${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -34,7 +34,7 @@ var s; >t1 : number `hello ${t1 ** t2 + t1}`; ->`hello ${t1 ** t2 + t1}` : string +>`hello ${t1 ** t2 + t1}` : `hello ${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -42,7 +42,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t2 + t1 }`; ->`hello ${t1 + t2 ** t2 + t1 }` : string +>`hello ${t1 + t2 ** t2 + t1 }` : `hello ${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -52,7 +52,7 @@ var s; >t1 : number `hello ${typeof (t1 ** t2 ** t1) }`; ->`hello ${typeof (t1 ** t2 ** t1) }` : string +>`hello ${typeof (t1 ** t2 ** t1) }` : "hello string" | "hello number" | "hello bigint" | "hello boolean" | "hello symbol" | "hello undefined" | "hello object" | "hello function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -62,7 +62,7 @@ var s; >t1 : number `hello ${1 + typeof (t1 ** t2 ** t1) }`; ->`hello ${1 + typeof (t1 ** t2 ** t1) }` : string +>`hello ${1 + typeof (t1 ** t2 ** t1) }` : `hello ${string}` >1 + typeof (t1 ** t2 ** t1) : string >1 : 1 >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" @@ -74,7 +74,7 @@ var s; >t1 : number `hello ${t1 ** t2}${t1 ** t2}`; ->`hello ${t1 ** t2}${t1 ** t2}` : string +>`hello ${t1 ** t2}${t1 ** t2}` : `hello ${number}${number}` >t1 ** t2 : number >t1 : number >t2 : number @@ -83,7 +83,7 @@ var s; >t2 : number `hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; ->`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : string +>`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : `hello ${number}${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -96,7 +96,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; ->`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}` : string +>`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}` : `hello ${number}${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -109,7 +109,7 @@ var s; >t1 : number `hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; ->`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}` : string +>`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}` : `hello ${number}${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -122,7 +122,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; ->`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : string +>`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : `hello ${number}${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -139,7 +139,7 @@ var s; >t1 : number `hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; ->`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }` : string +>`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }` : "hello stringstring" | "hello stringnumber" | "hello stringbigint" | "hello stringboolean" | "hello stringsymbol" | "hello stringundefined" | "hello stringobject" | "hello stringfunction" | "hello numberstring" | "hello numbernumber" | "hello numberbigint" | "hello numberboolean" | "hello numbersymbol" | "hello numberundefined" | "hello numberobject" | "hello numberfunction" | "hello bigintstring" | "hello bigintnumber" | "hello bigintbigint" | "hello bigintboolean" | "hello bigintsymbol" | "hello bigintundefined" | "hello bigintobject" | "hello bigintfunction" | "hello booleanstring" | "hello booleannumber" | "hello booleanbigint" | "hello booleanboolean" | "hello booleansymbol" | "hello booleanundefined" | "hello booleanobject" | "hello booleanfunction" | "hello symbolstring" | "hello symbolnumber" | "hello symbolbigint" | "hello symbolboolean" | "hello symbolsymbol" | "hello symbolundefined" | "hello symbolobject" | "hello symbolfunction" | "hello undefinedstring" | "hello undefinednumber" | "hello undefinedbigint" | "hello undefinedboolean" | "hello undefinedsymbol" | "hello undefinedundefined" | "hello undefinedobject" | "hello undefinedfunction" | "hello objectstring" | "hello objectnumber" | "hello objectbigint" | "hello objectboolean" | "hello objectsymbol" | "hello objectundefined" | "hello objectobject" | "hello objectfunction" | "hello functionstring" | "hello functionnumber" | "hello functionbigint" | "hello functionboolean" | "hello functionsymbol" | "hello functionundefined" | "hello functionobject" | "hello functionfunction" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -156,7 +156,7 @@ var s; >t1 : number `hello ${t1 ** t2} hello world ${t1 ** t2}`; ->`hello ${t1 ** t2} hello world ${t1 ** t2}` : string +>`hello ${t1 ** t2} hello world ${t1 ** t2}` : `hello ${number} hello world ${number}` >t1 ** t2 : number >t1 : number >t2 : number @@ -165,7 +165,7 @@ var s; >t2 : number `hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; ->`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : string +>`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : `hello ${number} hello world ${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -178,7 +178,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; ->`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : string +>`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : `hello ${number} hello world ${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -191,7 +191,7 @@ var s; >t1 : number `hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; ->`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : string +>`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : `hello ${number} hello world ${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -204,7 +204,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; ->`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : string +>`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : `hello ${number} hello world ${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -221,7 +221,7 @@ var s; >t1 : number `hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; ->`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : string +>`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : "hello string hello world string" | "hello string hello world number" | "hello string hello world bigint" | "hello string hello world boolean" | "hello string hello world symbol" | "hello string hello world undefined" | "hello string hello world object" | "hello string hello world function" | "hello number hello world string" | "hello number hello world number" | "hello number hello world bigint" | "hello number hello world boolean" | "hello number hello world symbol" | "hello number hello world undefined" | "hello number hello world object" | "hello number hello world function" | "hello bigint hello world string" | "hello bigint hello world number" | "hello bigint hello world bigint" | "hello bigint hello world boolean" | "hello bigint hello world symbol" | "hello bigint hello world undefined" | "hello bigint hello world object" | "hello bigint hello world function" | "hello boolean hello world string" | "hello boolean hello world number" | "hello boolean hello world bigint" | "hello boolean hello world boolean" | "hello boolean hello world symbol" | "hello boolean hello world undefined" | "hello boolean hello world object" | "hello boolean hello world function" | "hello symbol hello world string" | "hello symbol hello world number" | "hello symbol hello world bigint" | "hello symbol hello world boolean" | "hello symbol hello world symbol" | "hello symbol hello world undefined" | "hello symbol hello world object" | "hello symbol hello world function" | "hello undefined hello world string" | "hello undefined hello world number" | "hello undefined hello world bigint" | "hello undefined hello world boolean" | "hello undefined hello world symbol" | "hello undefined hello world undefined" | "hello undefined hello world object" | "hello undefined hello world function" | "hello object hello world string" | "hello object hello world number" | "hello object hello world bigint" | "hello object hello world boolean" | "hello object hello world symbol" | "hello object hello world undefined" | "hello object hello world object" | "hello object hello world function" | "hello function hello world string" | "hello function hello world number" | "hello function hello world bigint" | "hello function hello world boolean" | "hello function hello world symbol" | "hello function hello world undefined" | "hello function hello world object" | "hello function hello world function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types index c1c6394c63e1f..66a49fb6bd097 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString2ES6.types @@ -12,13 +12,13 @@ var s; // With templateHead `hello ${t1 ** t2}`; ->`hello ${t1 ** t2}` : string +>`hello ${t1 ** t2}` : `hello ${number}` >t1 ** t2 : number >t1 : number >t2 : number `hello ${t1 ** t2 ** t1}`; ->`hello ${t1 ** t2 ** t1}` : string +>`hello ${t1 ** t2 ** t1}` : `hello ${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -26,7 +26,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t1}`; ->`hello ${t1 + t2 ** t1}` : string +>`hello ${t1 + t2 ** t1}` : `hello ${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -34,7 +34,7 @@ var s; >t1 : number `hello ${t1 ** t2 + t1}`; ->`hello ${t1 ** t2 + t1}` : string +>`hello ${t1 ** t2 + t1}` : `hello ${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -42,7 +42,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t2 + t1 }`; ->`hello ${t1 + t2 ** t2 + t1 }` : string +>`hello ${t1 + t2 ** t2 + t1 }` : `hello ${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -52,7 +52,7 @@ var s; >t1 : number `hello ${typeof (t1 ** t2 ** t1) }`; ->`hello ${typeof (t1 ** t2 ** t1) }` : string +>`hello ${typeof (t1 ** t2 ** t1) }` : "hello string" | "hello number" | "hello bigint" | "hello boolean" | "hello symbol" | "hello undefined" | "hello object" | "hello function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -62,7 +62,7 @@ var s; >t1 : number `hello ${1 + typeof (t1 ** t2 ** t1) }`; ->`hello ${1 + typeof (t1 ** t2 ** t1) }` : string +>`hello ${1 + typeof (t1 ** t2 ** t1) }` : `hello ${string}` >1 + typeof (t1 ** t2 ** t1) : string >1 : 1 >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" @@ -74,7 +74,7 @@ var s; >t1 : number `hello ${t1 ** t2}${t1 ** t2}`; ->`hello ${t1 ** t2}${t1 ** t2}` : string +>`hello ${t1 ** t2}${t1 ** t2}` : `hello ${number}${number}` >t1 ** t2 : number >t1 : number >t2 : number @@ -83,7 +83,7 @@ var s; >t2 : number `hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}`; ->`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : string +>`hello ${t1 ** t2 ** t1}${t1 ** t2 ** t1}` : `hello ${number}${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -96,7 +96,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t1}${t1 + t2 ** t1}`; ->`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}` : string +>`hello ${t1 + t2 ** t1}${t1 + t2 ** t1}` : `hello ${number}${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -109,7 +109,7 @@ var s; >t1 : number `hello ${t1 ** t2 + t1}${t1 ** t2 + t1}`; ->`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}` : string +>`hello ${t1 ** t2 + t1}${t1 ** t2 + t1}` : `hello ${number}${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -122,7 +122,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}`; ->`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : string +>`hello ${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1}` : `hello ${number}${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -139,7 +139,7 @@ var s; >t1 : number `hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }`; ->`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }` : string +>`hello ${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) }` : "hello stringstring" | "hello stringnumber" | "hello stringbigint" | "hello stringboolean" | "hello stringsymbol" | "hello stringundefined" | "hello stringobject" | "hello stringfunction" | "hello numberstring" | "hello numbernumber" | "hello numberbigint" | "hello numberboolean" | "hello numbersymbol" | "hello numberundefined" | "hello numberobject" | "hello numberfunction" | "hello bigintstring" | "hello bigintnumber" | "hello bigintbigint" | "hello bigintboolean" | "hello bigintsymbol" | "hello bigintundefined" | "hello bigintobject" | "hello bigintfunction" | "hello booleanstring" | "hello booleannumber" | "hello booleanbigint" | "hello booleanboolean" | "hello booleansymbol" | "hello booleanundefined" | "hello booleanobject" | "hello booleanfunction" | "hello symbolstring" | "hello symbolnumber" | "hello symbolbigint" | "hello symbolboolean" | "hello symbolsymbol" | "hello symbolundefined" | "hello symbolobject" | "hello symbolfunction" | "hello undefinedstring" | "hello undefinednumber" | "hello undefinedbigint" | "hello undefinedboolean" | "hello undefinedsymbol" | "hello undefinedundefined" | "hello undefinedobject" | "hello undefinedfunction" | "hello objectstring" | "hello objectnumber" | "hello objectbigint" | "hello objectboolean" | "hello objectsymbol" | "hello objectundefined" | "hello objectobject" | "hello objectfunction" | "hello functionstring" | "hello functionnumber" | "hello functionbigint" | "hello functionboolean" | "hello functionsymbol" | "hello functionundefined" | "hello functionobject" | "hello functionfunction" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -156,7 +156,7 @@ var s; >t1 : number `hello ${t1 ** t2} hello world ${t1 ** t2}`; ->`hello ${t1 ** t2} hello world ${t1 ** t2}` : string +>`hello ${t1 ** t2} hello world ${t1 ** t2}` : `hello ${number} hello world ${number}` >t1 ** t2 : number >t1 : number >t2 : number @@ -165,7 +165,7 @@ var s; >t2 : number `hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}`; ->`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : string +>`hello ${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1}` : `hello ${number} hello world ${number}` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -178,7 +178,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}`; ->`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : string +>`hello ${t1 + t2 ** t1} hello world ${t1 + t2 ** t1}` : `hello ${number} hello world ${number}` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -191,7 +191,7 @@ var s; >t1 : number `hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}`; ->`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : string +>`hello ${t1 ** t2 + t1} hello world ${t1 ** t2 + t1}` : `hello ${number} hello world ${number}` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -204,7 +204,7 @@ var s; >t1 : number `hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}`; ->`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : string +>`hello ${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1}` : `hello ${number} hello world ${number}` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -221,7 +221,7 @@ var s; >t1 : number `hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }`; ->`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : string +>`hello ${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1) }` : "hello string hello world string" | "hello string hello world number" | "hello string hello world bigint" | "hello string hello world boolean" | "hello string hello world symbol" | "hello string hello world undefined" | "hello string hello world object" | "hello string hello world function" | "hello number hello world string" | "hello number hello world number" | "hello number hello world bigint" | "hello number hello world boolean" | "hello number hello world symbol" | "hello number hello world undefined" | "hello number hello world object" | "hello number hello world function" | "hello bigint hello world string" | "hello bigint hello world number" | "hello bigint hello world bigint" | "hello bigint hello world boolean" | "hello bigint hello world symbol" | "hello bigint hello world undefined" | "hello bigint hello world object" | "hello bigint hello world function" | "hello boolean hello world string" | "hello boolean hello world number" | "hello boolean hello world bigint" | "hello boolean hello world boolean" | "hello boolean hello world symbol" | "hello boolean hello world undefined" | "hello boolean hello world object" | "hello boolean hello world function" | "hello symbol hello world string" | "hello symbol hello world number" | "hello symbol hello world bigint" | "hello symbol hello world boolean" | "hello symbol hello world symbol" | "hello symbol hello world undefined" | "hello symbol hello world object" | "hello symbol hello world function" | "hello undefined hello world string" | "hello undefined hello world number" | "hello undefined hello world bigint" | "hello undefined hello world boolean" | "hello undefined hello world symbol" | "hello undefined hello world undefined" | "hello undefined hello world object" | "hello undefined hello world function" | "hello object hello world string" | "hello object hello world number" | "hello object hello world bigint" | "hello object hello world boolean" | "hello object hello world symbol" | "hello object hello world undefined" | "hello object hello world object" | "hello object hello world function" | "hello function hello world string" | "hello function hello world number" | "hello function hello world bigint" | "hello function hello world boolean" | "hello function hello world symbol" | "hello function hello world undefined" | "hello function hello world object" | "hello function hello world function" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types index 431d688f3b478..f49a0220b7495 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3.types @@ -12,13 +12,13 @@ var s; // With TemplateTail `${t1 ** t2} world`; ->`${t1 ** t2} world` : string +>`${t1 ** t2} world` : `${number} world` >t1 ** t2 : number >t1 : number >t2 : number `${t1 ** t2 ** t1} world`; ->`${t1 ** t2 ** t1} world` : string +>`${t1 ** t2 ** t1} world` : `${number} world` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -26,7 +26,7 @@ var s; >t1 : number `${t1 + t2 ** t1} world`; ->`${t1 + t2 ** t1} world` : string +>`${t1 + t2 ** t1} world` : `${number} world` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -34,7 +34,7 @@ var s; >t1 : number `${t1 ** t2 + t1} world`; ->`${t1 ** t2 + t1} world` : string +>`${t1 ** t2 + t1} world` : `${number} world` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -42,7 +42,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1 } world`; ->`${t1 + t2 ** t2 + t1 } world` : string +>`${t1 + t2 ** t2 + t1 } world` : `${number} world` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -52,7 +52,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) } world`; ->`${typeof (t1 ** t2 ** t1) } world` : string +>`${typeof (t1 ** t2 ** t1) } world` : "string world" | "number world" | "bigint world" | "boolean world" | "symbol world" | "undefined world" | "object world" | "function world" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -62,7 +62,7 @@ var s; >t1 : number `${1 + typeof (t1 ** t2 ** t1) } world`; ->`${1 + typeof (t1 ** t2 ** t1) } world` : string +>`${1 + typeof (t1 ** t2 ** t1) } world` : `${string} world` >1 + typeof (t1 ** t2 ** t1) : string >1 : 1 >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" @@ -74,7 +74,7 @@ var s; >t1 : number `${t1 ** t2}${t1 ** t2} world`; ->`${t1 ** t2}${t1 ** t2} world` : string +>`${t1 ** t2}${t1 ** t2} world` : `${number}${number} world` >t1 ** t2 : number >t1 : number >t2 : number @@ -83,7 +83,7 @@ var s; >t2 : number `${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; ->`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world` : string +>`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world` : `${number}${number} world` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -96,7 +96,7 @@ var s; >t1 : number `${t1 + t2 ** t1}${t1 + t2 ** t1} world`; ->`${t1 + t2 ** t1}${t1 + t2 ** t1} world` : string +>`${t1 + t2 ** t1}${t1 + t2 ** t1} world` : `${number}${number} world` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -109,7 +109,7 @@ var s; >t1 : number `${t1 ** t2 + t1}${t1 ** t2 + t1} world`; ->`${t1 ** t2 + t1}${t1 ** t2 + t1} world` : string +>`${t1 ** t2 + t1}${t1 ** t2 + t1} world` : `${number}${number} world` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -122,7 +122,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; ->`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world` : string +>`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world` : `${number}${number} world` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -139,7 +139,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; ->`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world` : string +>`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world` : "stringstring world" | "stringnumber world" | "stringbigint world" | "stringboolean world" | "stringsymbol world" | "stringundefined world" | "stringobject world" | "stringfunction world" | "numberstring world" | "numbernumber world" | "numberbigint world" | "numberboolean world" | "numbersymbol world" | "numberundefined world" | "numberobject world" | "numberfunction world" | "bigintstring world" | "bigintnumber world" | "bigintbigint world" | "bigintboolean world" | "bigintsymbol world" | "bigintundefined world" | "bigintobject world" | "bigintfunction world" | "booleanstring world" | "booleannumber world" | "booleanbigint world" | "booleanboolean world" | "booleansymbol world" | "booleanundefined world" | "booleanobject world" | "booleanfunction world" | "symbolstring world" | "symbolnumber world" | "symbolbigint world" | "symbolboolean world" | "symbolsymbol world" | "symbolundefined world" | "symbolobject world" | "symbolfunction world" | "undefinedstring world" | "undefinednumber world" | "undefinedbigint world" | "undefinedboolean world" | "undefinedsymbol world" | "undefinedundefined world" | "undefinedobject world" | "undefinedfunction world" | "objectstring world" | "objectnumber world" | "objectbigint world" | "objectboolean world" | "objectsymbol world" | "objectundefined world" | "objectobject world" | "objectfunction world" | "functionstring world" | "functionnumber world" | "functionbigint world" | "functionboolean world" | "functionsymbol world" | "functionundefined world" | "functionobject world" | "functionfunction world" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -156,7 +156,7 @@ var s; >t1 : number `${t1 ** t2} hello world ${t1 ** t2} !!`; ->`${t1 ** t2} hello world ${t1 ** t2} !!` : string +>`${t1 ** t2} hello world ${t1 ** t2} !!` : `${number} hello world ${number} !!` >t1 ** t2 : number >t1 : number >t2 : number @@ -165,7 +165,7 @@ var s; >t2 : number `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; ->`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!` : string +>`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!` : `${number} hello world ${number} !!` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -178,7 +178,7 @@ var s; >t1 : number `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; ->`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!` : string +>`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!` : `${number} hello world ${number} !!` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -191,7 +191,7 @@ var s; >t1 : number `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; ->`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!` : string +>`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!` : `${number} hello world ${number} !!` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -204,7 +204,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; ->`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!` : string +>`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!` : `${number} hello world ${number} !!` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -221,7 +221,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; ->`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!` : string +>`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!` : "string hello world string !!" | "string hello world number !!" | "string hello world bigint !!" | "string hello world boolean !!" | "string hello world symbol !!" | "string hello world undefined !!" | "string hello world object !!" | "string hello world function !!" | "number hello world string !!" | "number hello world number !!" | "number hello world bigint !!" | "number hello world boolean !!" | "number hello world symbol !!" | "number hello world undefined !!" | "number hello world object !!" | "number hello world function !!" | "bigint hello world string !!" | "bigint hello world number !!" | "bigint hello world bigint !!" | "bigint hello world boolean !!" | "bigint hello world symbol !!" | "bigint hello world undefined !!" | "bigint hello world object !!" | "bigint hello world function !!" | "boolean hello world string !!" | "boolean hello world number !!" | "boolean hello world bigint !!" | "boolean hello world boolean !!" | "boolean hello world symbol !!" | "boolean hello world undefined !!" | "boolean hello world object !!" | "boolean hello world function !!" | "symbol hello world string !!" | "symbol hello world number !!" | "symbol hello world bigint !!" | "symbol hello world boolean !!" | "symbol hello world symbol !!" | "symbol hello world undefined !!" | "symbol hello world object !!" | "symbol hello world function !!" | "undefined hello world string !!" | "undefined hello world number !!" | "undefined hello world bigint !!" | "undefined hello world boolean !!" | "undefined hello world symbol !!" | "undefined hello world undefined !!" | "undefined hello world object !!" | "undefined hello world function !!" | "object hello world string !!" | "object hello world number !!" | "object hello world bigint !!" | "object hello world boolean !!" | "object hello world symbol !!" | "object hello world undefined !!" | "object hello world object !!" | "object hello world function !!" | "function hello world string !!" | "function hello world number !!" | "function hello world bigint !!" | "function hello world boolean !!" | "function hello world symbol !!" | "function hello world undefined !!" | "function hello world object !!" | "function hello world function !!" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types index ccbacd4c7196c..583c51c3804df 100644 --- a/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types +++ b/tests/baselines/reference/emitExponentiationOperatorInTemplateString3ES6.types @@ -12,13 +12,13 @@ var s; // With TemplateTail `${t1 ** t2} world`; ->`${t1 ** t2} world` : string +>`${t1 ** t2} world` : `${number} world` >t1 ** t2 : number >t1 : number >t2 : number `${t1 ** t2 ** t1} world`; ->`${t1 ** t2 ** t1} world` : string +>`${t1 ** t2 ** t1} world` : `${number} world` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -26,7 +26,7 @@ var s; >t1 : number `${t1 + t2 ** t1} world`; ->`${t1 + t2 ** t1} world` : string +>`${t1 + t2 ** t1} world` : `${number} world` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -34,7 +34,7 @@ var s; >t1 : number `${t1 ** t2 + t1} world`; ->`${t1 ** t2 + t1} world` : string +>`${t1 ** t2 + t1} world` : `${number} world` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -42,7 +42,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1 } world`; ->`${t1 + t2 ** t2 + t1 } world` : string +>`${t1 + t2 ** t2 + t1 } world` : `${number} world` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -52,7 +52,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) } world`; ->`${typeof (t1 ** t2 ** t1) } world` : string +>`${typeof (t1 ** t2 ** t1) } world` : "string world" | "number world" | "bigint world" | "boolean world" | "symbol world" | "undefined world" | "object world" | "function world" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -62,7 +62,7 @@ var s; >t1 : number `${1 + typeof (t1 ** t2 ** t1) } world`; ->`${1 + typeof (t1 ** t2 ** t1) } world` : string +>`${1 + typeof (t1 ** t2 ** t1) } world` : `${string} world` >1 + typeof (t1 ** t2 ** t1) : string >1 : 1 >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" @@ -74,7 +74,7 @@ var s; >t1 : number `${t1 ** t2}${t1 ** t2} world`; ->`${t1 ** t2}${t1 ** t2} world` : string +>`${t1 ** t2}${t1 ** t2} world` : `${number}${number} world` >t1 ** t2 : number >t1 : number >t2 : number @@ -83,7 +83,7 @@ var s; >t2 : number `${t1 ** t2 ** t1}${t1 ** t2 ** t1} world`; ->`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world` : string +>`${t1 ** t2 ** t1}${t1 ** t2 ** t1} world` : `${number}${number} world` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -96,7 +96,7 @@ var s; >t1 : number `${t1 + t2 ** t1}${t1 + t2 ** t1} world`; ->`${t1 + t2 ** t1}${t1 + t2 ** t1} world` : string +>`${t1 + t2 ** t1}${t1 + t2 ** t1} world` : `${number}${number} world` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -109,7 +109,7 @@ var s; >t1 : number `${t1 ** t2 + t1}${t1 ** t2 + t1} world`; ->`${t1 ** t2 + t1}${t1 ** t2 + t1} world` : string +>`${t1 ** t2 + t1}${t1 ** t2 + t1} world` : `${number}${number} world` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -122,7 +122,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world`; ->`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world` : string +>`${t1 + t2 ** t2 + t1}${t1 + t2 ** t2 + t1} world` : `${number}${number} world` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -139,7 +139,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world`; ->`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world` : string +>`${typeof (t1 ** t2 ** t1) }${typeof (t1 ** t2 ** t1) } world` : "stringstring world" | "stringnumber world" | "stringbigint world" | "stringboolean world" | "stringsymbol world" | "stringundefined world" | "stringobject world" | "stringfunction world" | "numberstring world" | "numbernumber world" | "numberbigint world" | "numberboolean world" | "numbersymbol world" | "numberundefined world" | "numberobject world" | "numberfunction world" | "bigintstring world" | "bigintnumber world" | "bigintbigint world" | "bigintboolean world" | "bigintsymbol world" | "bigintundefined world" | "bigintobject world" | "bigintfunction world" | "booleanstring world" | "booleannumber world" | "booleanbigint world" | "booleanboolean world" | "booleansymbol world" | "booleanundefined world" | "booleanobject world" | "booleanfunction world" | "symbolstring world" | "symbolnumber world" | "symbolbigint world" | "symbolboolean world" | "symbolsymbol world" | "symbolundefined world" | "symbolobject world" | "symbolfunction world" | "undefinedstring world" | "undefinednumber world" | "undefinedbigint world" | "undefinedboolean world" | "undefinedsymbol world" | "undefinedundefined world" | "undefinedobject world" | "undefinedfunction world" | "objectstring world" | "objectnumber world" | "objectbigint world" | "objectboolean world" | "objectsymbol world" | "objectundefined world" | "objectobject world" | "objectfunction world" | "functionstring world" | "functionnumber world" | "functionbigint world" | "functionboolean world" | "functionsymbol world" | "functionundefined world" | "functionobject world" | "functionfunction world" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number @@ -156,7 +156,7 @@ var s; >t1 : number `${t1 ** t2} hello world ${t1 ** t2} !!`; ->`${t1 ** t2} hello world ${t1 ** t2} !!` : string +>`${t1 ** t2} hello world ${t1 ** t2} !!` : `${number} hello world ${number} !!` >t1 ** t2 : number >t1 : number >t2 : number @@ -165,7 +165,7 @@ var s; >t2 : number `${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!`; ->`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!` : string +>`${t1 ** t2 ** t1} hello world ${t1 ** t2 ** t1} !!` : `${number} hello world ${number} !!` >t1 ** t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -178,7 +178,7 @@ var s; >t1 : number `${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!`; ->`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!` : string +>`${t1 + t2 ** t1} hello world ${t1 + t2 ** t1} !!` : `${number} hello world ${number} !!` >t1 + t2 ** t1 : number >t1 : number >t2 ** t1 : number @@ -191,7 +191,7 @@ var s; >t1 : number `${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!`; ->`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!` : string +>`${t1 ** t2 + t1} hello world ${t1 ** t2 + t1} !!` : `${number} hello world ${number} !!` >t1 ** t2 + t1 : number >t1 ** t2 : number >t1 : number @@ -204,7 +204,7 @@ var s; >t1 : number `${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!`; ->`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!` : string +>`${t1 + t2 ** t2 + t1} hello world ${t1 + t2 ** t2 + t1} !!` : `${number} hello world ${number} !!` >t1 + t2 ** t2 + t1 : number >t1 + t2 ** t2 : number >t1 : number @@ -221,7 +221,7 @@ var s; >t1 : number `${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!`; ->`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!` : string +>`${typeof (t1 ** t2 ** t1) } hello world ${typeof (t1 ** t2 ** t1)} !!` : "string hello world string !!" | "string hello world number !!" | "string hello world bigint !!" | "string hello world boolean !!" | "string hello world symbol !!" | "string hello world undefined !!" | "string hello world object !!" | "string hello world function !!" | "number hello world string !!" | "number hello world number !!" | "number hello world bigint !!" | "number hello world boolean !!" | "number hello world symbol !!" | "number hello world undefined !!" | "number hello world object !!" | "number hello world function !!" | "bigint hello world string !!" | "bigint hello world number !!" | "bigint hello world bigint !!" | "bigint hello world boolean !!" | "bigint hello world symbol !!" | "bigint hello world undefined !!" | "bigint hello world object !!" | "bigint hello world function !!" | "boolean hello world string !!" | "boolean hello world number !!" | "boolean hello world bigint !!" | "boolean hello world boolean !!" | "boolean hello world symbol !!" | "boolean hello world undefined !!" | "boolean hello world object !!" | "boolean hello world function !!" | "symbol hello world string !!" | "symbol hello world number !!" | "symbol hello world bigint !!" | "symbol hello world boolean !!" | "symbol hello world symbol !!" | "symbol hello world undefined !!" | "symbol hello world object !!" | "symbol hello world function !!" | "undefined hello world string !!" | "undefined hello world number !!" | "undefined hello world bigint !!" | "undefined hello world boolean !!" | "undefined hello world symbol !!" | "undefined hello world undefined !!" | "undefined hello world object !!" | "undefined hello world function !!" | "object hello world string !!" | "object hello world number !!" | "object hello world bigint !!" | "object hello world boolean !!" | "object hello world symbol !!" | "object hello world undefined !!" | "object hello world object !!" | "object hello world function !!" | "function hello world string !!" | "function hello world number !!" | "function hello world bigint !!" | "function hello world boolean !!" | "function hello world symbol !!" | "function hello world undefined !!" | "function hello world object !!" | "function hello world function !!" >typeof (t1 ** t2 ** t1) : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >(t1 ** t2 ** t1) : number >t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/enumConstantMemberWithTemplateLiterals.types b/tests/baselines/reference/enumConstantMemberWithTemplateLiterals.types index b750b8e8ab444..256c73fd03363 100644 --- a/tests/baselines/reference/enumConstantMemberWithTemplateLiterals.types +++ b/tests/baselines/reference/enumConstantMemberWithTemplateLiterals.types @@ -106,7 +106,7 @@ enum T5 { g = `1${"2"}3`, >g : T5.e ->`1${"2"}3` : string +>`1${"2"}3` : "123" >"2" : "2" h = `1`.length diff --git a/tests/baselines/reference/esModuleInteropImportTSLibHasImport.types b/tests/baselines/reference/esModuleInteropImportTSLibHasImport.types index 5851ad03565bf..ed97cc86cb738 100644 --- a/tests/baselines/reference/esModuleInteropImportTSLibHasImport.types +++ b/tests/baselines/reference/esModuleInteropImportTSLibHasImport.types @@ -19,8 +19,8 @@ const sayHello = (name?: string) => void (`Hello, ${name}!`); >(name?: string) => void (`Hello, ${name}!`) : (name?: string) => any >name : string >void (`Hello, ${name}!`) : undefined ->(`Hello, ${name}!`) : string ->`Hello, ${name}!` : string +>(`Hello, ${name}!`) : `Hello, ${string}!` +>`Hello, ${name}!` : `Hello, ${string}!` >name : string export default sayHello; diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.types b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.types index 8c7e7d27aa847..9a7fc68838710 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.types +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError1.types @@ -13,7 +13,7 @@ var s; // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () // TempateHead & TemplateTail are empty `${1 + typeof t1 ** t2 ** t1}`; ->`${1 + typeof t1 ** t2 ** t1}` : string +>`${1 + typeof t1 ** t2 ** t1}` : `${number}` >1 + typeof t1 ** t2 ** t1 : number >1 : 1 >typeof t1 ** t2 ** t1 : number @@ -24,7 +24,7 @@ var s; >t1 : number `${-t1 ** t2 - t1}`; ->`${-t1 ** t2 - t1}` : string +>`${-t1 ** t2 - t1}` : `${number}` >-t1 ** t2 - t1 : number >-t1 ** t2 : number >-t1 : number @@ -33,7 +33,7 @@ var s; >t1 : number `${-++t1 ** t2 - t1}`; ->`${-++t1 ** t2 - t1}` : string +>`${-++t1 ** t2 - t1}` : `${number}` >-++t1 ** t2 - t1 : number >-++t1 ** t2 : number >-++t1 : number @@ -43,7 +43,7 @@ var s; >t1 : number `${-t1++ ** t2 - t1}`; ->`${-t1++ ** t2 - t1}` : string +>`${-t1++ ** t2 - t1}` : `${number}` >-t1++ ** t2 - t1 : number >-t1++ ** t2 : number >-t1++ : number @@ -53,7 +53,7 @@ var s; >t1 : number `${!t1 ** t2 ** --t1 }`; ->`${!t1 ** t2 ** --t1 }` : string +>`${!t1 ** t2 ** --t1 }` : `${number}` >!t1 ** t2 ** --t1 : number >!t1 : boolean >t1 : number @@ -63,7 +63,7 @@ var s; >t1 : number `${typeof t1 ** t2 ** t1}`; ->`${typeof t1 ** t2 ** t1}` : string +>`${typeof t1 ** t2 ** t1}` : `${number}` >typeof t1 ** t2 ** t1 : number >typeof t1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >t1 : number @@ -72,7 +72,7 @@ var s; >t1 : number `${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; ->`${-t1 ** t2 - t1}${-t1 ** t2 - t1}` : string +>`${-t1 ** t2 - t1}${-t1 ** t2 - t1}` : `${number}${number}` >-t1 ** t2 - t1 : number >-t1 ** t2 : number >-t1 : number @@ -87,7 +87,7 @@ var s; >t1 : number `${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; ->`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}` : string +>`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}` : `${number}${number}` >-++t1 ** t2 - t1 : number >-++t1 ** t2 : number >-++t1 : number @@ -104,7 +104,7 @@ var s; >t1 : number `${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; ->`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}` : string +>`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}` : `${number}${number}` >-t1++ ** t2 - t1 : number >-t1++ ** t2 : number >-t1++ : number @@ -121,7 +121,7 @@ var s; >t1 : number `${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; ->`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }` : string +>`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }` : `${number}${number}` >!t1 ** t2 ** --t1 : number >!t1 : boolean >t1 : number @@ -138,7 +138,7 @@ var s; >t1 : number `${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; ->`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}` : string +>`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}` : `${number}${number}` >typeof t1 ** t2 ** t1 : number >typeof t1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >t1 : number @@ -153,7 +153,7 @@ var s; >t1 : number `${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; ->`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}` : string +>`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}` : `${number}${number}` >1 + typeof t1 ** t2 ** t1 : number >1 : 1 >typeof t1 ** t2 ** t1 : number @@ -172,7 +172,7 @@ var s; >t1 : number `${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; ->`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}` : string +>`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}` : `${number} hello world ${number}` >-t1 ** t2 - t1 : number >-t1 ** t2 : number >-t1 : number @@ -187,7 +187,7 @@ var s; >t1 : number `${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; ->`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}` : string +>`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}` : `${number} hello world ${number}` >-++t1 ** t2 - t1 : number >-++t1 ** t2 : number >-++t1 : number @@ -204,7 +204,7 @@ var s; >t1 : number `${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; ->`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}` : string +>`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}` : `${number} hello world ${number}` >-t1++ ** t2 - t1 : number >-t1++ ** t2 : number >-t1++ : number @@ -221,7 +221,7 @@ var s; >t1 : number `${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; ->`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }` : string +>`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }` : `${number} hello world ${number}` >!t1 ** t2 ** --t1 : number >!t1 : boolean >t1 : number @@ -238,7 +238,7 @@ var s; >t1 : number `${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; ->`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}` : string +>`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}` : `${number} hello world ${number}` >typeof t1 ** t2 ** t1 : number >typeof t1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >t1 : number @@ -253,7 +253,7 @@ var s; >t1 : number `${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; ->`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}` : string +>`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}` : `${number} hello world ${number}` >1 + typeof t1 ** t2 ** t1 : number >1 : 1 >typeof t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.types b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.types index 9cacc633c6243..e1b1e9942a1c9 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.types +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError2.types @@ -13,7 +13,7 @@ var s; // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () // With templateHead `hello ${-t1 ** t2 - t1}`; ->`hello ${-t1 ** t2 - t1}` : string +>`hello ${-t1 ** t2 - t1}` : `hello ${number}` >-t1 ** t2 - t1 : number >-t1 ** t2 : number >-t1 : number @@ -22,7 +22,7 @@ var s; >t1 : number `hello ${-++t1 ** t2 - t1}`; ->`hello ${-++t1 ** t2 - t1}` : string +>`hello ${-++t1 ** t2 - t1}` : `hello ${number}` >-++t1 ** t2 - t1 : number >-++t1 ** t2 : number >-++t1 : number @@ -32,7 +32,7 @@ var s; >t1 : number `hello ${-t1++ ** t2 - t1}`; ->`hello ${-t1++ ** t2 - t1}` : string +>`hello ${-t1++ ** t2 - t1}` : `hello ${number}` >-t1++ ** t2 - t1 : number >-t1++ ** t2 : number >-t1++ : number @@ -42,7 +42,7 @@ var s; >t1 : number `hello ${!t1 ** t2 ** --t1 }`; ->`hello ${!t1 ** t2 ** --t1 }` : string +>`hello ${!t1 ** t2 ** --t1 }` : `hello ${number}` >!t1 ** t2 ** --t1 : number >!t1 : boolean >t1 : number @@ -52,7 +52,7 @@ var s; >t1 : number `hello ${typeof t1 ** t2 ** t1}`; ->`hello ${typeof t1 ** t2 ** t1}` : string +>`hello ${typeof t1 ** t2 ** t1}` : `hello ${number}` >typeof t1 ** t2 ** t1 : number >typeof t1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >t1 : number @@ -61,7 +61,7 @@ var s; >t1 : number `hello ${1 + typeof t1 ** t2 ** t1}`; ->`hello ${1 + typeof t1 ** t2 ** t1}` : string +>`hello ${1 + typeof t1 ** t2 ** t1}` : `hello ${number}` >1 + typeof t1 ** t2 ** t1 : number >1 : 1 >typeof t1 ** t2 ** t1 : number @@ -72,7 +72,7 @@ var s; >t1 : number `hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}`; ->`hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}` : string +>`hello ${-t1 ** t2 - t1}${-t1 ** t2 - t1}` : `hello ${number}${number}` >-t1 ** t2 - t1 : number >-t1 ** t2 : number >-t1 : number @@ -87,7 +87,7 @@ var s; >t1 : number `hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}`; ->`hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}` : string +>`hello ${-++t1 ** t2 - t1}${-++t1 ** t2 - t1}` : `hello ${number}${number}` >-++t1 ** t2 - t1 : number >-++t1 ** t2 : number >-++t1 : number @@ -104,7 +104,7 @@ var s; >t1 : number `hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}`; ->`hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}` : string +>`hello ${-t1++ ** t2 - t1}${-t1++ ** t2 - t1}` : `hello ${number}${number}` >-t1++ ** t2 - t1 : number >-t1++ ** t2 : number >-t1++ : number @@ -121,7 +121,7 @@ var s; >t1 : number `hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }`; ->`hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }` : string +>`hello ${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 }` : `hello ${number}${number}` >!t1 ** t2 ** --t1 : number >!t1 : boolean >t1 : number @@ -138,7 +138,7 @@ var s; >t1 : number `hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}`; ->`hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}` : string +>`hello ${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1}` : `hello ${number}${number}` >typeof t1 ** t2 ** t1 : number >typeof t1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >t1 : number @@ -153,7 +153,7 @@ var s; >t1 : number `hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}`; ->`hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}` : string +>`hello ${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1}` : `hello ${number}${number}` >1 + typeof t1 ** t2 ** t1 : number >1 : 1 >typeof t1 ** t2 ** t1 : number @@ -172,7 +172,7 @@ var s; >t1 : number `hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}`; ->`hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}` : string +>`hello ${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1}` : `hello ${number} hello world ${number}` >-t1 ** t2 - t1 : number >-t1 ** t2 : number >-t1 : number @@ -187,7 +187,7 @@ var s; >t1 : number `hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}`; ->`hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}` : string +>`hello ${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1}` : `hello ${number} hello world ${number}` >-++t1 ** t2 - t1 : number >-++t1 ** t2 : number >-++t1 : number @@ -204,7 +204,7 @@ var s; >t1 : number `hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}`; ->`hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}` : string +>`hello ${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1}` : `hello ${number} hello world ${number}` >-t1++ ** t2 - t1 : number >-t1++ ** t2 : number >-t1++ : number @@ -221,7 +221,7 @@ var s; >t1 : number `hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }`; ->`hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }` : string +>`hello ${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 }` : `hello ${number} hello world ${number}` >!t1 ** t2 ** --t1 : number >!t1 : boolean >t1 : number @@ -238,7 +238,7 @@ var s; >t1 : number `hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}`; ->`hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}` : string +>`hello ${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1}` : `hello ${number} hello world ${number}` >typeof t1 ** t2 ** t1 : number >typeof t1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >t1 : number @@ -253,7 +253,7 @@ var s; >t1 : number `hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}`; ->`hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}` : string +>`hello ${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1}` : `hello ${number} hello world ${number}` >1 + typeof t1 ** t2 ** t1 : number >1 : 1 >typeof t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.types b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.types index 36d594f3821d2..527eaad4eaedc 100644 --- a/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.types +++ b/tests/baselines/reference/exponentiationOperatorInTemplateStringWithSyntaxError3.types @@ -13,7 +13,7 @@ var s; // Error: early syntax error using ES7 SimpleUnaryExpression on left-hand side without () // With TemplateTail `${-t1 ** t2 - t1} world`; ->`${-t1 ** t2 - t1} world` : string +>`${-t1 ** t2 - t1} world` : `${number} world` >-t1 ** t2 - t1 : number >-t1 ** t2 : number >-t1 : number @@ -22,7 +22,7 @@ var s; >t1 : number `${-++t1 ** t2 - t1} world`; ->`${-++t1 ** t2 - t1} world` : string +>`${-++t1 ** t2 - t1} world` : `${number} world` >-++t1 ** t2 - t1 : number >-++t1 ** t2 : number >-++t1 : number @@ -32,7 +32,7 @@ var s; >t1 : number `${-t1++ ** t2 - t1} world`; ->`${-t1++ ** t2 - t1} world` : string +>`${-t1++ ** t2 - t1} world` : `${number} world` >-t1++ ** t2 - t1 : number >-t1++ ** t2 : number >-t1++ : number @@ -42,7 +42,7 @@ var s; >t1 : number `${!t1 ** t2 ** --t1 } world`; ->`${!t1 ** t2 ** --t1 } world` : string +>`${!t1 ** t2 ** --t1 } world` : `${number} world` >!t1 ** t2 ** --t1 : number >!t1 : boolean >t1 : number @@ -52,7 +52,7 @@ var s; >t1 : number `${typeof t1 ** t2 ** t1} world`; ->`${typeof t1 ** t2 ** t1} world` : string +>`${typeof t1 ** t2 ** t1} world` : `${number} world` >typeof t1 ** t2 ** t1 : number >typeof t1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >t1 : number @@ -61,7 +61,7 @@ var s; >t1 : number `${1 + typeof t1 ** t2 ** t1} world`; ->`${1 + typeof t1 ** t2 ** t1} world` : string +>`${1 + typeof t1 ** t2 ** t1} world` : `${number} world` >1 + typeof t1 ** t2 ** t1 : number >1 : 1 >typeof t1 ** t2 ** t1 : number @@ -72,7 +72,7 @@ var s; >t1 : number `${-t1 ** t2 - t1}${-t1 ** t2 - t1} world`; ->`${-t1 ** t2 - t1}${-t1 ** t2 - t1} world` : string +>`${-t1 ** t2 - t1}${-t1 ** t2 - t1} world` : `${number}${number} world` >-t1 ** t2 - t1 : number >-t1 ** t2 : number >-t1 : number @@ -87,7 +87,7 @@ var s; >t1 : number `${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world`; ->`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world` : string +>`${-++t1 ** t2 - t1}${-++t1 ** t2 - t1} world` : `${number}${number} world` >-++t1 ** t2 - t1 : number >-++t1 ** t2 : number >-++t1 : number @@ -104,7 +104,7 @@ var s; >t1 : number `${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world`; ->`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world` : string +>`${-t1++ ** t2 - t1}${-t1++ ** t2 - t1} world` : `${number}${number} world` >-t1++ ** t2 - t1 : number >-t1++ ** t2 : number >-t1++ : number @@ -121,7 +121,7 @@ var s; >t1 : number `${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world`; ->`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world` : string +>`${!t1 ** t2 ** --t1 }${!t1 ** t2 ** --t1 } world` : `${number}${number} world` >!t1 ** t2 ** --t1 : number >!t1 : boolean >t1 : number @@ -138,7 +138,7 @@ var s; >t1 : number `${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world`; ->`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world` : string +>`${typeof t1 ** t2 ** t1}${typeof t1 ** t2 ** t1} world` : `${number}${number} world` >typeof t1 ** t2 ** t1 : number >typeof t1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >t1 : number @@ -153,7 +153,7 @@ var s; >t1 : number `${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world`; ->`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world` : string +>`${1 + typeof t1 ** t2 ** t1}${1 + typeof t1 ** t2 ** t1} world` : `${number}${number} world` >1 + typeof t1 ** t2 ** t1 : number >1 : 1 >typeof t1 ** t2 ** t1 : number @@ -172,7 +172,7 @@ var s; >t1 : number `${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!`; ->`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!` : string +>`${-t1 ** t2 - t1} hello world ${-t1 ** t2 - t1} !!` : `${number} hello world ${number} !!` >-t1 ** t2 - t1 : number >-t1 ** t2 : number >-t1 : number @@ -187,7 +187,7 @@ var s; >t1 : number `${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!`; ->`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!` : string +>`${-++t1 ** t2 - t1} hello world ${-++t1 ** t2 - t1} !!` : `${number} hello world ${number} !!` >-++t1 ** t2 - t1 : number >-++t1 ** t2 : number >-++t1 : number @@ -204,7 +204,7 @@ var s; >t1 : number `${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!`; ->`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!` : string +>`${-t1++ ** t2 - t1} hello world ${-t1++ ** t2 - t1} !!` : `${number} hello world ${number} !!` >-t1++ ** t2 - t1 : number >-t1++ ** t2 : number >-t1++ : number @@ -221,7 +221,7 @@ var s; >t1 : number `${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!`; ->`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!` : string +>`${!t1 ** t2 ** --t1 } hello world ${!t1 ** t2 ** --t1 } !!` : `${number} hello world ${number} !!` >!t1 ** t2 ** --t1 : number >!t1 : boolean >t1 : number @@ -238,7 +238,7 @@ var s; >t1 : number `${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!`; ->`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!` : string +>`${typeof t1 ** t2 ** t1} hello world ${typeof t1 ** t2 ** t1} !!` : `${number} hello world ${number} !!` >typeof t1 ** t2 ** t1 : number >typeof t1 : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >t1 : number @@ -253,7 +253,7 @@ var s; >t1 : number `${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!`; ->`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!` : string +>`${1 + typeof t1 ** t2 ** t1} hello world ${1 + typeof t1 ** t2 ** t1} !!` : `${number} hello world ${number} !!` >1 + typeof t1 ** t2 ** t1 : number >1 : 1 >typeof t1 ** t2 ** t1 : number diff --git a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.types b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.types index 1958e478d734b..de61a9beb2bcd 100644 --- a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.types +++ b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalid.types @@ -3,55 +3,55 @@ var a = 1 ** `${ 3 }`; >a : number >1 ** `${ 3 }` : number >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b = 1 ** `2${ 3 }`; >b : number >1 ** `2${ 3 }` : number >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c = 1 ** `${ 3 }4`; >c : number >1 ** `${ 3 }4` : number >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d = 1 ** `2${ 3 }4`; >d : number >1 ** `2${ 3 }4` : number >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e = `${ 3 }` ** 5; >e : number >`${ 3 }` ** 5 : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f = `2${ 3 }` ** 5; >f : number >`2${ 3 }` ** 5 : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g = `${ 3 }4` ** 5; >g : number >`${ 3 }4` ** 5 : number ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h = `2${ 3 }4` ** 5; >h : number >`2${ 3 }4` ** 5 : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -62,25 +62,25 @@ var k = 10; k **= `${ 3 }`; >k **= `${ 3 }` : number >k : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 k **= `2${ 3 }`; >k **= `2${ 3 }` : number >k : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 k **= `2${ 3 }4`; >k **= `2${ 3 }4` : number >k : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 k **= `2${ 3 }4`; >k **= `2${ 3 }4` : number >k : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 diff --git a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.types b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.types index 6db21a24ce38c..eaca3660157fc 100644 --- a/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.types +++ b/tests/baselines/reference/exponentiationOperatorWithTemplateStringInvalidES6.types @@ -3,55 +3,55 @@ var a = 1 ** `${ 3 }`; >a : number >1 ** `${ 3 }` : number >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b = 1 ** `2${ 3 }`; >b : number >1 ** `2${ 3 }` : number >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c = 1 ** `${ 3 }4`; >c : number >1 ** `${ 3 }4` : number >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d = 1 ** `2${ 3 }4`; >d : number >1 ** `2${ 3 }4` : number >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e = `${ 3 }` ** 5; >e : number >`${ 3 }` ** 5 : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f = `2${ 3 }` ** 5; >f : number >`2${ 3 }` ** 5 : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g = `${ 3 }4` ** 5; >g : number >`${ 3 }4` ** 5 : number ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h = `2${ 3 }4` ** 5; >h : number >`2${ 3 }4` ** 5 : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -62,24 +62,24 @@ var k = 10; k **= `${ 3 }`; >k **= `${ 3 }` : number >k : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 k **= `2${ 3 }`; >k **= `2${ 3 }` : number >k : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 k **= `2${ 3 }4`; >k **= `2${ 3 }4` : number >k : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 kj **= `2${ 3 }4`; >kj **= `2${ 3 }4` : number >kj : any ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 diff --git a/tests/baselines/reference/importCallExpressionDeclarationEmit1.js b/tests/baselines/reference/importCallExpressionDeclarationEmit1.js index 721d85abe717a..154e2f0a5e9f4 100644 --- a/tests/baselines/reference/importCallExpressionDeclarationEmit1.js +++ b/tests/baselines/reference/importCallExpressionDeclarationEmit1.js @@ -6,7 +6,7 @@ declare const moduleFile: number; import(getSpecifier()); -var p0 = import(`${directory}\${moduleFile}`); +var p0 = import(`${directory}\\${moduleFile}`); var p1 = import(getSpecifier()); const p2 = import(whatToLoad ? getSpecifier() : "defaulPath") @@ -16,7 +16,7 @@ function returnDynamicLoad(path: string) { //// [importCallExpressionDeclarationEmit1.js] Promise.resolve().then(() => require(getSpecifier())); -var p0 = Promise.resolve().then(() => require(`${directory}\${moduleFile}`)); +var p0 = Promise.resolve().then(() => require(`${directory}\\${moduleFile}`)); var p1 = Promise.resolve().then(() => require(getSpecifier())); const p2 = Promise.resolve().then(() => require(whatToLoad ? getSpecifier() : "defaulPath")); function returnDynamicLoad(path) { diff --git a/tests/baselines/reference/importCallExpressionDeclarationEmit1.symbols b/tests/baselines/reference/importCallExpressionDeclarationEmit1.symbols index d2266cc768b62..53391741b4367 100644 --- a/tests/baselines/reference/importCallExpressionDeclarationEmit1.symbols +++ b/tests/baselines/reference/importCallExpressionDeclarationEmit1.symbols @@ -14,9 +14,10 @@ declare const moduleFile: number; import(getSpecifier()); >getSpecifier : Symbol(getSpecifier, Decl(importCallExpressionDeclarationEmit1.ts, 0, 0)) -var p0 = import(`${directory}\${moduleFile}`); +var p0 = import(`${directory}\\${moduleFile}`); >p0 : Symbol(p0, Decl(importCallExpressionDeclarationEmit1.ts, 7, 3)) >directory : Symbol(directory, Decl(importCallExpressionDeclarationEmit1.ts, 2, 13)) +>moduleFile : Symbol(moduleFile, Decl(importCallExpressionDeclarationEmit1.ts, 3, 13)) var p1 = import(getSpecifier()); >p1 : Symbol(p1, Decl(importCallExpressionDeclarationEmit1.ts, 8, 3)) diff --git a/tests/baselines/reference/importCallExpressionDeclarationEmit1.types b/tests/baselines/reference/importCallExpressionDeclarationEmit1.types index db5400818c874..2683bb3cc85ab 100644 --- a/tests/baselines/reference/importCallExpressionDeclarationEmit1.types +++ b/tests/baselines/reference/importCallExpressionDeclarationEmit1.types @@ -16,11 +16,12 @@ import(getSpecifier()); >getSpecifier() : string >getSpecifier : () => string -var p0 = import(`${directory}\${moduleFile}`); +var p0 = import(`${directory}\\${moduleFile}`); >p0 : Promise ->import(`${directory}\${moduleFile}`) : Promise ->`${directory}\${moduleFile}` : string +>import(`${directory}\\${moduleFile}`) : Promise +>`${directory}\\${moduleFile}` : `${string}\\${number}` >directory : string +>moduleFile : number var p1 = import(getSpecifier()); >p1 : Promise diff --git a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.js b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.js index fe4aaf9cdc77b..b7db3e18d22d4 100644 --- a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.js +++ b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.js @@ -11,7 +11,7 @@ declare var whatToLoad: boolean; declare const directory: string; declare const moduleFile: number; -import(`${directory}\${moduleFile}`); +import(`${directory}\\${moduleFile}`); import(getSpecifier()); var p1 = import(ValidSomeCondition() ? "./0" : "externalModule"); @@ -27,7 +27,7 @@ var p3: Promise = import(j=getSpecifier()); function * loadModule(directories: string[]) { for (const directory of directories) { - const path = `${directory}\moduleFile`; + const path = `${directory}\\moduleFile`; import(yield path); } } @@ -43,7 +43,7 @@ exports.C = C; //// [1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -Promise.resolve().then(() => require(`${directory}\${moduleFile}`)); +Promise.resolve().then(() => require(`${directory}\\${moduleFile}`)); Promise.resolve().then(() => require(getSpecifier())); var p1 = Promise.resolve().then(() => require(ValidSomeCondition() ? "./0" : "externalModule")); var p1 = Promise.resolve().then(() => require(getSpecifier())); @@ -56,7 +56,7 @@ let j; var p3 = Promise.resolve().then(() => require(j = getSpecifier())); function* loadModule(directories) { for (const directory of directories) { - const path = `${directory}\moduleFile`; + const path = `${directory}\\moduleFile`; Promise.resolve().then(() => require(yield path)); } } diff --git a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.symbols b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.symbols index d2cdfd31e4a68..0fc5a7185b5d4 100644 --- a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.symbols +++ b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.symbols @@ -21,8 +21,9 @@ declare const directory: string; declare const moduleFile: number; >moduleFile : Symbol(moduleFile, Decl(1.ts, 5, 13)) -import(`${directory}\${moduleFile}`); +import(`${directory}\\${moduleFile}`); >directory : Symbol(directory, Decl(1.ts, 4, 13)) +>moduleFile : Symbol(moduleFile, Decl(1.ts, 5, 13)) import(getSpecifier()); >getSpecifier : Symbol(getSpecifier, Decl(1.ts, 0, 47)) @@ -78,7 +79,7 @@ function * loadModule(directories: string[]) { >directory : Symbol(directory, Decl(1.ts, 22, 14)) >directories : Symbol(directories, Decl(1.ts, 21, 22)) - const path = `${directory}\moduleFile`; + const path = `${directory}\\moduleFile`; >path : Symbol(path, Decl(1.ts, 23, 13)) >directory : Symbol(directory, Decl(1.ts, 22, 14)) diff --git a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types index b5f526adc8e89..9592dc870d318 100644 --- a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types +++ b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.types @@ -21,10 +21,11 @@ declare const directory: string; declare const moduleFile: number; >moduleFile : number -import(`${directory}\${moduleFile}`); ->import(`${directory}\${moduleFile}`) : Promise ->`${directory}\${moduleFile}` : string +import(`${directory}\\${moduleFile}`); +>import(`${directory}\\${moduleFile}`) : Promise +>`${directory}\\${moduleFile}` : `${string}\\${number}` >directory : string +>moduleFile : number import(getSpecifier()); >import(getSpecifier()) : Promise @@ -93,22 +94,22 @@ var p3: Promise = import(j=getSpecifier()); >getSpecifier : () => string function * loadModule(directories: string[]) { ->loadModule : (directories: string[]) => Generator +>loadModule : (directories: string[]) => Generator<`${string}\\moduleFile`, void, string> >directories : string[] for (const directory of directories) { >directory : string >directories : string[] - const path = `${directory}\moduleFile`; ->path : string ->`${directory}\moduleFile` : string + const path = `${directory}\\moduleFile`; +>path : `${string}\\moduleFile` +>`${directory}\\moduleFile` : `${string}\\moduleFile` >directory : string import(yield path); >import(yield path) : Promise >yield path : any ->path : string +>path : `${string}\\moduleFile` } } diff --git a/tests/baselines/reference/importCallExpressionShouldNotGetParen.types b/tests/baselines/reference/importCallExpressionShouldNotGetParen.types index 6c45228344687..b9c3cde9b89b9 100644 --- a/tests/baselines/reference/importCallExpressionShouldNotGetParen.types +++ b/tests/baselines/reference/importCallExpressionShouldNotGetParen.types @@ -7,7 +7,7 @@ import(`./locales/${localeName}.js`).then(bar => { >import(`./locales/${localeName}.js`).then(bar => { let x = bar;}) : Promise >import(`./locales/${localeName}.js`).then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >import(`./locales/${localeName}.js`) : Promise ->`./locales/${localeName}.js` : string +>`./locales/${localeName}.js` : "./locales/zh-CN.js" >localeName : "zh-CN" >then : (onfulfilled?: (value: any) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise >bar => { let x = bar;} : (bar: any) => void diff --git a/tests/baselines/reference/inferenceErasedSignatures.types b/tests/baselines/reference/inferenceErasedSignatures.types index 84f64ffda5682..018a06971100a 100644 --- a/tests/baselines/reference/inferenceErasedSignatures.types +++ b/tests/baselines/reference/inferenceErasedSignatures.types @@ -36,7 +36,7 @@ class SomeClass extends SomeAbstractClass { >context : number return `${context}`; ->`${context}` : string +>`${context}` : `${number}` >context : number } } diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).types b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).types index 08b1ed6844442..8acfa55570242 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).types +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).types @@ -18,21 +18,21 @@ const b = tag`123 ${100}` >b : any >tag`123 ${100}` : any >tag : (str: any, ...args: any[]) => any ->`123 ${100}` : string +>`123 ${100}` : "123 100" >100 : 100 const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; >x : any >tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : any >tag : (str: any, ...args: any[]) => any ->`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : string +>`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : "\\u{hello} 100 \\xtraordinary 200 wonderful 300 \\uworld" >100 : 100 >200 : 200 >300 : 300 const y = `\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; // should error with NoSubstitutionTemplate ->y : string ->`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : string +>y : "hello} 100 traordinary 200 wonderful 300 world" +>`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : "hello} 100 traordinary 200 wonderful 300 world" >100 : 100 >200 : 200 >300 : 300 @@ -47,97 +47,97 @@ const a1 = tag`${ 100 }\0` // \0 >a1 : any >tag`${ 100 }\0` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\0` : string +>`${ 100 }\0` : "100\0" >100 : 100 const a2 = tag`${ 100 }\00` // \\00 >a2 : any >tag`${ 100 }\00` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\00` : string +>`${ 100 }\00` : "100\\00" >100 : 100 const a3 = tag`${ 100 }\u` // \\u >a3 : any >tag`${ 100 }\u` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u` : string +>`${ 100 }\u` : "100\\u" >100 : 100 const a4 = tag`${ 100 }\u0` // \\u0 >a4 : any >tag`${ 100 }\u0` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u0` : string +>`${ 100 }\u0` : "100\\u0" >100 : 100 const a5 = tag`${ 100 }\u00` // \\u00 >a5 : any >tag`${ 100 }\u00` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u00` : string +>`${ 100 }\u00` : "100\\u00" >100 : 100 const a6 = tag`${ 100 }\u000` // \\u000 >a6 : any >tag`${ 100 }\u000` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u000` : string +>`${ 100 }\u000` : "100\\u000" >100 : 100 const a7 = tag`${ 100 }\u0000` // \u0000 >a7 : any >tag`${ 100 }\u0000` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u0000` : string +>`${ 100 }\u0000` : "100\0" >100 : 100 const a8 = tag`${ 100 }\u{` // \\u{ >a8 : any >tag`${ 100 }\u{` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{` : string +>`${ 100 }\u{` : "100\\u{" >100 : 100 const a9 = tag`${ 100 }\u{10FFFF}` // \\u{10FFFF >a9 : any >tag`${ 100 }\u{10FFFF}` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{10FFFF}` : string +>`${ 100 }\u{10FFFF}` : "100􏿿" >100 : 100 const a10 = tag`${ 100 }\u{1f622` // \\u{1f622 >a10 : any >tag`${ 100 }\u{1f622` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{1f622` : string +>`${ 100 }\u{1f622` : "100\\u{1f622" >100 : 100 const a11 = tag`${ 100 }\u{1f622}` // \u{1f622} >a11 : any >tag`${ 100 }\u{1f622}` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{1f622}` : string +>`${ 100 }\u{1f622}` : "100😢" >100 : 100 const a12 = tag`${ 100 }\x` // \\x >a12 : any >tag`${ 100 }\x` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\x` : string +>`${ 100 }\x` : "100\\x" >100 : 100 const a13 = tag`${ 100 }\x0` // \\x0 >a13 : any >tag`${ 100 }\x0` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\x0` : string +>`${ 100 }\x0` : "100\\x0" >100 : 100 const a14 = tag`${ 100 }\x00` // \x00 >a14 : any >tag`${ 100 }\x00` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\x00` : string +>`${ 100 }\x00` : "100\0" >100 : 100 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).types b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).types index 08b1ed6844442..8acfa55570242 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).types +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).types @@ -18,21 +18,21 @@ const b = tag`123 ${100}` >b : any >tag`123 ${100}` : any >tag : (str: any, ...args: any[]) => any ->`123 ${100}` : string +>`123 ${100}` : "123 100" >100 : 100 const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; >x : any >tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : any >tag : (str: any, ...args: any[]) => any ->`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : string +>`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : "\\u{hello} 100 \\xtraordinary 200 wonderful 300 \\uworld" >100 : 100 >200 : 200 >300 : 300 const y = `\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; // should error with NoSubstitutionTemplate ->y : string ->`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : string +>y : "hello} 100 traordinary 200 wonderful 300 world" +>`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : "hello} 100 traordinary 200 wonderful 300 world" >100 : 100 >200 : 200 >300 : 300 @@ -47,97 +47,97 @@ const a1 = tag`${ 100 }\0` // \0 >a1 : any >tag`${ 100 }\0` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\0` : string +>`${ 100 }\0` : "100\0" >100 : 100 const a2 = tag`${ 100 }\00` // \\00 >a2 : any >tag`${ 100 }\00` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\00` : string +>`${ 100 }\00` : "100\\00" >100 : 100 const a3 = tag`${ 100 }\u` // \\u >a3 : any >tag`${ 100 }\u` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u` : string +>`${ 100 }\u` : "100\\u" >100 : 100 const a4 = tag`${ 100 }\u0` // \\u0 >a4 : any >tag`${ 100 }\u0` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u0` : string +>`${ 100 }\u0` : "100\\u0" >100 : 100 const a5 = tag`${ 100 }\u00` // \\u00 >a5 : any >tag`${ 100 }\u00` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u00` : string +>`${ 100 }\u00` : "100\\u00" >100 : 100 const a6 = tag`${ 100 }\u000` // \\u000 >a6 : any >tag`${ 100 }\u000` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u000` : string +>`${ 100 }\u000` : "100\\u000" >100 : 100 const a7 = tag`${ 100 }\u0000` // \u0000 >a7 : any >tag`${ 100 }\u0000` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u0000` : string +>`${ 100 }\u0000` : "100\0" >100 : 100 const a8 = tag`${ 100 }\u{` // \\u{ >a8 : any >tag`${ 100 }\u{` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{` : string +>`${ 100 }\u{` : "100\\u{" >100 : 100 const a9 = tag`${ 100 }\u{10FFFF}` // \\u{10FFFF >a9 : any >tag`${ 100 }\u{10FFFF}` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{10FFFF}` : string +>`${ 100 }\u{10FFFF}` : "100􏿿" >100 : 100 const a10 = tag`${ 100 }\u{1f622` // \\u{1f622 >a10 : any >tag`${ 100 }\u{1f622` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{1f622` : string +>`${ 100 }\u{1f622` : "100\\u{1f622" >100 : 100 const a11 = tag`${ 100 }\u{1f622}` // \u{1f622} >a11 : any >tag`${ 100 }\u{1f622}` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{1f622}` : string +>`${ 100 }\u{1f622}` : "100😢" >100 : 100 const a12 = tag`${ 100 }\x` // \\x >a12 : any >tag`${ 100 }\x` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\x` : string +>`${ 100 }\x` : "100\\x" >100 : 100 const a13 = tag`${ 100 }\x0` // \\x0 >a13 : any >tag`${ 100 }\x0` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\x0` : string +>`${ 100 }\x0` : "100\\x0" >100 : 100 const a14 = tag`${ 100 }\x00` // \x00 >a14 : any >tag`${ 100 }\x00` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\x00` : string +>`${ 100 }\x00` : "100\0" >100 : 100 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).types b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).types index 08b1ed6844442..8acfa55570242 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).types +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).types @@ -18,21 +18,21 @@ const b = tag`123 ${100}` >b : any >tag`123 ${100}` : any >tag : (str: any, ...args: any[]) => any ->`123 ${100}` : string +>`123 ${100}` : "123 100" >100 : 100 const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; >x : any >tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : any >tag : (str: any, ...args: any[]) => any ->`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : string +>`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : "\\u{hello} 100 \\xtraordinary 200 wonderful 300 \\uworld" >100 : 100 >200 : 200 >300 : 300 const y = `\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; // should error with NoSubstitutionTemplate ->y : string ->`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : string +>y : "hello} 100 traordinary 200 wonderful 300 world" +>`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : "hello} 100 traordinary 200 wonderful 300 world" >100 : 100 >200 : 200 >300 : 300 @@ -47,97 +47,97 @@ const a1 = tag`${ 100 }\0` // \0 >a1 : any >tag`${ 100 }\0` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\0` : string +>`${ 100 }\0` : "100\0" >100 : 100 const a2 = tag`${ 100 }\00` // \\00 >a2 : any >tag`${ 100 }\00` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\00` : string +>`${ 100 }\00` : "100\\00" >100 : 100 const a3 = tag`${ 100 }\u` // \\u >a3 : any >tag`${ 100 }\u` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u` : string +>`${ 100 }\u` : "100\\u" >100 : 100 const a4 = tag`${ 100 }\u0` // \\u0 >a4 : any >tag`${ 100 }\u0` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u0` : string +>`${ 100 }\u0` : "100\\u0" >100 : 100 const a5 = tag`${ 100 }\u00` // \\u00 >a5 : any >tag`${ 100 }\u00` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u00` : string +>`${ 100 }\u00` : "100\\u00" >100 : 100 const a6 = tag`${ 100 }\u000` // \\u000 >a6 : any >tag`${ 100 }\u000` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u000` : string +>`${ 100 }\u000` : "100\\u000" >100 : 100 const a7 = tag`${ 100 }\u0000` // \u0000 >a7 : any >tag`${ 100 }\u0000` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u0000` : string +>`${ 100 }\u0000` : "100\0" >100 : 100 const a8 = tag`${ 100 }\u{` // \\u{ >a8 : any >tag`${ 100 }\u{` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{` : string +>`${ 100 }\u{` : "100\\u{" >100 : 100 const a9 = tag`${ 100 }\u{10FFFF}` // \\u{10FFFF >a9 : any >tag`${ 100 }\u{10FFFF}` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{10FFFF}` : string +>`${ 100 }\u{10FFFF}` : "100􏿿" >100 : 100 const a10 = tag`${ 100 }\u{1f622` // \\u{1f622 >a10 : any >tag`${ 100 }\u{1f622` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{1f622` : string +>`${ 100 }\u{1f622` : "100\\u{1f622" >100 : 100 const a11 = tag`${ 100 }\u{1f622}` // \u{1f622} >a11 : any >tag`${ 100 }\u{1f622}` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\u{1f622}` : string +>`${ 100 }\u{1f622}` : "100😢" >100 : 100 const a12 = tag`${ 100 }\x` // \\x >a12 : any >tag`${ 100 }\x` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\x` : string +>`${ 100 }\x` : "100\\x" >100 : 100 const a13 = tag`${ 100 }\x0` // \\x0 >a13 : any >tag`${ 100 }\x0` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\x0` : string +>`${ 100 }\x0` : "100\\x0" >100 : 100 const a14 = tag`${ 100 }\x00` // \x00 >a14 : any >tag`${ 100 }\x00` : any >tag : (str: any, ...args: any[]) => any ->`${ 100 }\x00` : string +>`${ 100 }\x00` : "100\0" >100 : 100 diff --git a/tests/baselines/reference/jsDeclarationsExportedClassAliases.types b/tests/baselines/reference/jsDeclarationsExportedClassAliases.types index c9be4e46037d6..9a2369a46c07f 100644 --- a/tests/baselines/reference/jsDeclarationsExportedClassAliases.types +++ b/tests/baselines/reference/jsDeclarationsExportedClassAliases.types @@ -28,7 +28,7 @@ class FancyError extends Error { super(`error with status ${status}`); >super(`error with status ${status}`) : void >super : ErrorConstructor ->`error with status ${status}` : string +>`error with status ${status}` : `error with status ${any}` >status : any } } diff --git a/tests/baselines/reference/jsdocTypeFromChainedAssignment2.types b/tests/baselines/reference/jsdocTypeFromChainedAssignment2.types index 7bbcb5becabcb..9950788aa5743 100644 --- a/tests/baselines/reference/jsdocTypeFromChainedAssignment2.types +++ b/tests/baselines/reference/jsdocTypeFromChainedAssignment2.types @@ -20,17 +20,17 @@ mod.g('also no') >'also no' : "also no" mod.h(0) ->mod.h(0) : string ->mod.h : (mom: string) => string +>mod.h(0) : `hi, ${string}!` +>mod.h : (mom: string) => `hi, ${string}!` >mod : typeof mod ->h : (mom: string) => string +>h : (mom: string) => `hi, ${string}!` >0 : 0 mod.i(1) ->mod.i(1) : string ->mod.i : (mom: string) => string +>mod.i(1) : `hi, ${string}!` +>mod.i : (mom: string) => `hi, ${string}!` >mod : typeof mod ->i : (mom: string) => string +>i : (mom: string) => `hi, ${string}!` >1 : 1 === tests/cases/conformance/jsdoc/mod.js === @@ -55,24 +55,24 @@ exports.f = exports.g = function fg(n) { } /** @param {string} mom */ module.exports.h = module.exports.i = function hi(mom) { ->module.exports.h = module.exports.i = function hi(mom) { return `hi, ${mom}!`;} : (mom: string) => string ->module.exports.h : (mom: string) => string +>module.exports.h = module.exports.i = function hi(mom) { return `hi, ${mom}!`;} : (mom: string) => `hi, ${string}!` +>module.exports.h : (mom: string) => `hi, ${string}!` >module.exports : typeof import("tests/cases/conformance/jsdoc/mod") >module : { "\"tests/cases/conformance/jsdoc/mod\"": typeof import("tests/cases/conformance/jsdoc/mod"); } >exports : typeof import("tests/cases/conformance/jsdoc/mod") ->h : (mom: string) => string ->module.exports.i = function hi(mom) { return `hi, ${mom}!`;} : (mom: string) => string ->module.exports.i : (mom: string) => string +>h : (mom: string) => `hi, ${string}!` +>module.exports.i = function hi(mom) { return `hi, ${mom}!`;} : (mom: string) => `hi, ${string}!` +>module.exports.i : (mom: string) => `hi, ${string}!` >module.exports : typeof import("tests/cases/conformance/jsdoc/mod") >module : { "\"tests/cases/conformance/jsdoc/mod\"": typeof import("tests/cases/conformance/jsdoc/mod"); } >exports : typeof import("tests/cases/conformance/jsdoc/mod") ->i : (mom: string) => string ->function hi(mom) { return `hi, ${mom}!`;} : (mom: string) => string ->hi : (mom: string) => string +>i : (mom: string) => `hi, ${string}!` +>function hi(mom) { return `hi, ${mom}!`;} : (mom: string) => `hi, ${string}!` +>hi : (mom: string) => `hi, ${string}!` >mom : string return `hi, ${mom}!`; ->`hi, ${mom}!` : string +>`hi, ${mom}!` : `hi, ${string}!` >mom : string } diff --git a/tests/baselines/reference/noImplicitSymbolToString.types b/tests/baselines/reference/noImplicitSymbolToString.types index c21c0e07bfded..e4ea9afa516d1 100644 --- a/tests/baselines/reference/noImplicitSymbolToString.types +++ b/tests/baselines/reference/noImplicitSymbolToString.types @@ -9,8 +9,8 @@ let str = "hello "; >"hello " : "hello " const templateStr = `hello ${symbol}`; ->templateStr : string ->`hello ${symbol}` : string +>templateStr : `hello ${string}` +>`hello ${symbol}` : `hello ${string}` >symbol : symbol const appendStr = "hello " + symbol; @@ -31,8 +31,8 @@ let symbolUnionString!: symbol | string; >symbolUnionString : string | symbol const templateStrUnion = `union with number ${symbolUnionNumber} and union with string ${symbolUnionString}`; ->templateStrUnion : string ->`union with number ${symbolUnionNumber} and union with string ${symbolUnionString}` : string +>templateStrUnion : `union with number ${string} and union with string ${string}` +>`union with number ${symbolUnionNumber} and union with string ${symbolUnionString}` : `union with number ${string} and union with string ${string}` >symbolUnionNumber : number | symbol >symbolUnionString : string | symbol diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.types b/tests/baselines/reference/parenthesizedContexualTyping3.types index d43cd213b5697..2acc75d368e6e 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping3.types +++ b/tests/baselines/reference/parenthesizedContexualTyping3.types @@ -37,7 +37,7 @@ var a = tempFun `${ x => x } ${ 10 }` >a : number >tempFun `${ x => x } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } ->`${ x => x } ${ 10 }` : string +>`${ x => x } ${ 10 }` : `${string} 10` >x => x : (x: number) => number >x : number >x : number @@ -47,7 +47,7 @@ var b = tempFun `${ (x => x) } ${ 10 }` >b : number >tempFun `${ (x => x) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } ->`${ (x => x) } ${ 10 }` : string +>`${ (x => x) } ${ 10 }` : `${string} 10` >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -58,7 +58,7 @@ var c = tempFun `${ ((x => x)) } ${ 10 }` >c : number >tempFun `${ ((x => x)) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } ->`${ ((x => x)) } ${ 10 }` : string +>`${ ((x => x)) } ${ 10 }` : `${string} 10` >((x => x)) : (x: number) => number >(x => x) : (x: number) => number >x => x : (x: number) => number @@ -70,7 +70,7 @@ var d = tempFun `${ x => x } ${ x => x } ${ 10 }` >d : number >tempFun `${ x => x } ${ x => x } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } ->`${ x => x } ${ x => x } ${ 10 }` : string +>`${ x => x } ${ x => x } ${ 10 }` : `${string} ${string} 10` >x => x : (x: number) => number >x : number >x : number @@ -83,7 +83,7 @@ var e = tempFun `${ x => x } ${ (x => x) } ${ 10 }` >e : number >tempFun `${ x => x } ${ (x => x) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } ->`${ x => x } ${ (x => x) } ${ 10 }` : string +>`${ x => x } ${ (x => x) } ${ 10 }` : `${string} ${string} 10` >x => x : (x: number) => number >x : number >x : number @@ -97,7 +97,7 @@ var f = tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` >f : number >tempFun `${ x => x } ${ ((x => x)) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } ->`${ x => x } ${ ((x => x)) } ${ 10 }` : string +>`${ x => x } ${ ((x => x)) } ${ 10 }` : `${string} ${string} 10` >x => x : (x: number) => number >x : number >x : number @@ -112,7 +112,7 @@ var g = tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` >g : number >tempFun `${ (x => x) } ${ (((x => x))) } ${ 10 }` : number >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } ->`${ (x => x) } ${ (((x => x))) } ${ 10 }` : string +>`${ (x => x) } ${ (((x => x))) } ${ 10 }` : `${string} ${string} 10` >(x => x) : (x: number) => number >x => x : (x: number) => number >x : number @@ -129,7 +129,7 @@ var h = tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` >h : any >tempFun `${ (x => x) } ${ (((x => x))) } ${ undefined }` : any >tempFun : { (tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; (tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => T, x: T): T; } ->`${ (x => x) } ${ (((x => x))) } ${ undefined }` : string +>`${ (x => x) } ${ (((x => x))) } ${ undefined }` : `${string} ${string} undefined` >(x => x) : (x: any) => any >x => x : (x: any) => any >x : any diff --git a/tests/baselines/reference/privateNameFieldCallExpression.types b/tests/baselines/reference/privateNameFieldCallExpression.types index a103c2230b4d6..cdcf01d0e5ce7 100644 --- a/tests/baselines/reference/privateNameFieldCallExpression.types +++ b/tests/baselines/reference/privateNameFieldCallExpression.types @@ -73,7 +73,7 @@ class A { >this.#fieldFunc2`head${1}middle${2}tail` : void >this.#fieldFunc2 : (a: any, ...b: any[]) => void >this : this ->`head${1}middle${2}tail` : string +>`head${1}middle${2}tail` : "head1middle2tail" >1 : 1 >2 : 2 @@ -84,7 +84,7 @@ class A { >this.getInstance : () => A >this : this >getInstance : () => A ->`test${1}and${2}` : string +>`test${1}and${2}` : "test1and2" >1 : 1 >2 : 2 } diff --git a/tests/baselines/reference/propertyOverridesAccessors2.types b/tests/baselines/reference/propertyOverridesAccessors2.types index b87387d052a98..8ea1f4449c57f 100644 --- a/tests/baselines/reference/propertyOverridesAccessors2.types +++ b/tests/baselines/reference/propertyOverridesAccessors2.types @@ -13,7 +13,7 @@ class Base { >console.log : (...data: any[]) => void >console : Console >log : (...data: any[]) => void ->`x was set to ${value}` : string +>`x was set to ${value}` : `x was set to ${number}` >value : number } diff --git a/tests/baselines/reference/recursiveTypeReferences1.types b/tests/baselines/reference/recursiveTypeReferences1.types index 8259f392c5ba8..4008c9286ac88 100644 --- a/tests/baselines/reference/recursiveTypeReferences1.types +++ b/tests/baselines/reference/recursiveTypeReferences1.types @@ -445,7 +445,7 @@ function parse(node: Tree, index: number[] = []): HTMLUListElement { >'a' : "a" >{ href: `#${el.id}`, rel: 'noopener', 'data-index': idx.join('.') } : { href: string; rel: string; 'data-index': string; } >href : string ->`#${el.id}` : string +>`#${el.id}` : `#${string}` >el.id : string >el : HTMLHeadingElement >id : string diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt index 4137661f0bef9..21293d7c84e6c 100644 --- a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.errors.txt @@ -1,12 +1,9 @@ tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(1,5): error TS2322: Type '"AB\nC"' is not assignable to type '"AB\r\nC"'. -tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts(3,5): error TS2322: Type 'string' is not assignable to type '"DE\nF"'. -==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts (2 errors) ==== +==== tests/cases/conformance/types/stringLiteral/stringLiteralTypesWithTemplateStrings02.ts (1 errors) ==== let abc: "AB\r\nC" = `AB ~~~ !!! error TS2322: Type '"AB\nC"' is not assignable to type '"AB\r\nC"'. C`; - let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`; - ~~~~~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type '"DE\nF"'. \ No newline at end of file + let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`; \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.types b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.types index c8dcf901e534b..912ab642767ae 100644 --- a/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.types +++ b/tests/baselines/reference/stringLiteralTypesWithTemplateStrings02.types @@ -6,6 +6,6 @@ let abc: "AB\r\nC" = `AB C`; let de_NEWLINE_f: "DE\nF" = `DE${"\n"}F`; >de_NEWLINE_f : "DE\nF" ->`DE${"\n"}F` : string +>`DE${"\n"}F` : "DE\nF" >"\n" : "\n" diff --git a/tests/baselines/reference/taggedTemplateChain.types b/tests/baselines/reference/taggedTemplateChain.types index 9690fc22f6991..510f0846e4895 100644 --- a/tests/baselines/reference/taggedTemplateChain.types +++ b/tests/baselines/reference/taggedTemplateChain.types @@ -10,6 +10,6 @@ a?.`b`; a?.`b${1}c`; >a?.`b${1}c` : any >a : any ->`b${1}c` : string +>`b${1}c` : "b1c" >1 : 1 diff --git a/tests/baselines/reference/taggedTemplateContextualTyping1.types b/tests/baselines/reference/taggedTemplateContextualTyping1.types index 84af70b5b88cd..09e05c6570095 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping1.types +++ b/tests/baselines/reference/taggedTemplateContextualTyping1.types @@ -33,7 +33,7 @@ function tempTag1(...rest: any[]): T { tempTag1 `${ x => { x(undefined); return x; } }${ 10 }`; >tempTag1 `${ x => { x(undefined); return x; } }${ 10 }` : 10 >tempTag1 : { (templateStrs: TemplateStringsArray, f: FuncType, x: T): T; (templateStrs: TemplateStringsArray, f: FuncType, h: FuncType, x: T): T; } ->`${ x => { x(undefined); return x; } }${ 10 }` : string +>`${ x => { x(undefined); return x; } }${ 10 }` : `${string}10` >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : number @@ -45,7 +45,7 @@ tempTag1 `${ x => { x(undefined); return x; } }${ 10 } tempTag1 `${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }`; >tempTag1 `${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }` : 10 >tempTag1 : { (templateStrs: TemplateStringsArray, f: FuncType, x: T): T; (templateStrs: TemplateStringsArray, f: FuncType, h: FuncType, x: T): T; } ->`${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }` : string +>`${ x => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ 10 }` : `${string}${string}10` >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : number @@ -63,7 +63,7 @@ tempTag1 `${ x => { x(undefined); return x; } }${ y => tempTag1 `${ x => { x(undefined); return x; } }${ (y: (p: T) => T) => { y(undefined); return y } }${ undefined }`; >tempTag1 `${ x => { x(undefined); return x; } }${ (y: (p: T) => T) => { y(undefined); return y } }${ undefined }` : any >tempTag1 : { (templateStrs: TemplateStringsArray, f: FuncType, x: T): T; (templateStrs: TemplateStringsArray, f: FuncType, h: FuncType, x: T): T; } ->`${ x => { x(undefined); return x; } }${ (y: (p: T) => T) => { y(undefined); return y } }${ undefined }` : string +>`${ x => { x(undefined); return x; } }${ (y: (p: T) => T) => { y(undefined); return y } }${ undefined }` : `${string}${string}undefined` >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : number @@ -82,7 +82,7 @@ tempTag1 `${ x => { x(undefined); return x; } }${ (y: tempTag1 `${ (x: (p: T) => T) => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ undefined }`; >tempTag1 `${ (x: (p: T) => T) => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ undefined }` : any >tempTag1 : { (templateStrs: TemplateStringsArray, f: FuncType, x: T): T; (templateStrs: TemplateStringsArray, f: FuncType, h: FuncType, x: T): T; } ->`${ (x: (p: T) => T) => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ undefined }` : string +>`${ (x: (p: T) => T) => { x(undefined); return x; } }${ y => { y(undefined); return y; } }${ undefined }` : `${string}${string}undefined` >(x: (p: T) => T) => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >p : T diff --git a/tests/baselines/reference/taggedTemplateContextualTyping2.types b/tests/baselines/reference/taggedTemplateContextualTyping2.types index d182bb526a882..a84e76263e978 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping2.types +++ b/tests/baselines/reference/taggedTemplateContextualTyping2.types @@ -39,7 +39,7 @@ function tempTag2(...rest: any[]): any { tempTag2 `${ x => { x(undefined); return x; } }${ 0 }`; >tempTag2 `${ x => { x(undefined); return x; } }${ 0 }` : number >tempTag2 : { (templateStrs: TemplateStringsArray, f: FuncType1, x: number): number; (templateStrs: TemplateStringsArray, f: FuncType2, h: FuncType2, x: string): string; } ->`${ x => { x(undefined); return x; } }${ 0 }` : string +>`${ x => { x(undefined); return x; } }${ 0 }` : `${string}0` >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : number @@ -51,7 +51,7 @@ tempTag2 `${ x => { x(undefined); return x; } }${ 0 }`; tempTag2 `${ x => { x(undefined); return x; } }${ y => { y(null); return y; } }${ "hello" }`; >tempTag2 `${ x => { x(undefined); return x; } }${ y => { y(null); return y; } }${ "hello" }` : string >tempTag2 : { (templateStrs: TemplateStringsArray, f: FuncType1, x: number): number; (templateStrs: TemplateStringsArray, f: FuncType2, h: FuncType2, x: string): string; } ->`${ x => { x(undefined); return x; } }${ y => { y(null); return y; } }${ "hello" }` : string +>`${ x => { x(undefined); return x; } }${ y => { y(null); return y; } }${ "hello" }` : `${string}${string}hello` >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : string @@ -69,7 +69,7 @@ tempTag2 `${ x => { x(undefined); return x; } }${ y => { y { x(undefined); return x; } }${ undefined }${ "hello" }`; >tempTag2 `${ x => { x(undefined); return x; } }${ undefined }${ "hello" }` : string >tempTag2 : { (templateStrs: TemplateStringsArray, f: FuncType1, x: number): number; (templateStrs: TemplateStringsArray, f: FuncType2, h: FuncType2, x: string): string; } ->`${ x => { x(undefined); return x; } }${ undefined }${ "hello" }` : string +>`${ x => { x(undefined); return x; } }${ undefined }${ "hello" }` : `${string}undefinedhello` >x => { x(undefined); return x; } : (x: (p: T) => T) => (p: T) => T >x : (p: T) => T >x(undefined) : string diff --git a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types index e42bf52c005d4..ee58cfcd1db69 100644 --- a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types +++ b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapes.types @@ -7,6 +7,6 @@ function f(...args: any[]) { f `\x0D${ "Interrupted CRLF" }\x0A`; >f `\x0D${ "Interrupted CRLF" }\x0A` : void >f : (...args: any[]) => void ->`\x0D${ "Interrupted CRLF" }\x0A` : string +>`\x0D${ "Interrupted CRLF" }\x0A` : "\rInterrupted CRLF\n" >"Interrupted CRLF" : "Interrupted CRLF" diff --git a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types index 1b5fefe9c9ee0..256d9d06b473d 100644 --- a/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types +++ b/tests/baselines/reference/taggedTemplateStringsHexadecimalEscapesES6.types @@ -7,6 +7,6 @@ function f(...args: any[]) { f `\x0D${ "Interrupted CRLF" }\x0A`; >f `\x0D${ "Interrupted CRLF" }\x0A` : void >f : (...args: any[]) => void ->`\x0D${ "Interrupted CRLF" }\x0A` : string +>`\x0D${ "Interrupted CRLF" }\x0A` : "\rInterrupted CRLF\n" >"Interrupted CRLF" : "Interrupted CRLF" diff --git a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types index d4b77f95c4fe8..32efe026183b4 100644 --- a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types +++ b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02.ts === `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` ->`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string +>`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n" >" " : " " >" " : " " >" " : " " diff --git a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types index dc6455c17a917..b75054d77d147 100644 --- a/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsPlainCharactersThatArePartsOfEscapes02_ES6.types @@ -8,7 +8,7 @@ function f(...x: any[]) { f `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` >f `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : void >f : (...x: any[]) => void ->`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string +>`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n" >" " : " " >" " : " " >" " : " " diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types index 114b37d1cf2e2..91462bef19b72 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.types @@ -28,7 +28,7 @@ function someGenerics1a(n: T, m: number) { } someGenerics1a `${3}`; >someGenerics1a `${3}` : void >someGenerics1a : (n: T, m: number) => void ->`${3}` : string +>`${3}` : "3" >3 : 3 function someGenerics1b(n: TemplateStringsArray, m: U) { } @@ -39,7 +39,7 @@ function someGenerics1b(n: TemplateStringsArray, m: U) { } someGenerics1b `${3}`; >someGenerics1b `${3}` : void >someGenerics1b : (n: TemplateStringsArray, m: U) => void ->`${3}` : string +>`${3}` : "3" >3 : 3 // Generic tag with argument of function type whose parameter is of type parameter type @@ -111,7 +111,7 @@ function someGenerics4(strs: TemplateStringsArray, n: T, f: (x: U) => void someGenerics4 `${4}${ () => null }`; >someGenerics4 `${4}${ () => null }` : void >someGenerics4 : (strs: TemplateStringsArray, n: T, f: (x: U) => void) => void ->`${4}${ () => null }` : string +>`${4}${ () => null }` : `4${string}` >4 : 4 >() => null : () => any >null : null @@ -127,7 +127,7 @@ someGenerics4 `${''}${ () => 3 }`; someGenerics4 `${ null }${ null }`; >someGenerics4 `${ null }${ null }` : void >someGenerics4 : (strs: TemplateStringsArray, n: T, f: (x: U) => void) => void ->`${ null }${ null }` : string +>`${ null }${ null }` : "nullnull" >null : null >null : null @@ -142,7 +142,7 @@ function someGenerics5(strs: TemplateStringsArray, n: T, f: (x: U) => void someGenerics5 `${ 4 } ${ () => null }`; >someGenerics5 `${ 4 } ${ () => null }` : void >someGenerics5 : (strs: TemplateStringsArray, n: T, f: (x: U) => void) => void ->`${ 4 } ${ () => null }` : string +>`${ 4 } ${ () => null }` : `4 ${string}` >4 : 4 >() => null : () => any >null : null @@ -158,7 +158,7 @@ someGenerics5 `${ '' }${ () => 3 }`; someGenerics5 `${null}${null}`; >someGenerics5 `${null}${null}` : void >someGenerics5 : (strs: TemplateStringsArray, n: T, f: (x: U) => void) => void ->`${null}${null}` : string +>`${null}${null}` : "nullnull" >null : null >null : null @@ -285,7 +285,7 @@ var x = someGenerics8 `${ someGenerics7 }`; x `${null}${null}${null}`; >x `${null}${null}${null}` : void >x : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void ->`${null}${null}${null}` : string +>`${null}${null}${null}` : "nullnullnull" >null : null >null : null >null : null @@ -305,7 +305,7 @@ var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; >a9a : string >someGenerics9 `${ '' }${ 0 }${ [] }` : "" >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T ->`${ '' }${ 0 }${ [] }` : string +>`${ '' }${ 0 }${ [] }` : `0${string}` >'' : "" >0 : 0 >[] : undefined[] @@ -333,7 +333,7 @@ var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: >a9e : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T ->`${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : string +>`${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : `undefined${string}${string}` >undefined : undefined >{ x: 6, z: new Date() } : { x: number; z: Date; } >x : number @@ -378,7 +378,7 @@ var a = someGenerics9 `${ 7 }${ anyVar }${ 4 }`; >a : any >someGenerics9 `${ 7 }${ anyVar }${ 4 }` : any >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T ->`${ 7 }${ anyVar }${ 4 }` : string +>`${ 7 }${ anyVar }${ 4 }` : `7${any}4` >7 : 7 >anyVar : any >4 : 4 @@ -391,7 +391,7 @@ var arr = someGenerics9 `${ [] }${ null }${ undefined }`; >arr : any[] >someGenerics9 `${ [] }${ null }${ undefined }` : any[] >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T ->`${ [] }${ null }${ undefined }` : string +>`${ [] }${ null }${ undefined }` : `${string}nullundefined` >[] : undefined[] >null : null >undefined : undefined diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types index 1953bde609932..c0a42cb12b6d7 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.types @@ -28,7 +28,7 @@ function someGenerics1a(n: T, m: number) { } someGenerics1a `${3}`; >someGenerics1a `${3}` : void >someGenerics1a : (n: T, m: number) => void ->`${3}` : string +>`${3}` : "3" >3 : 3 function someGenerics1b(n: TemplateStringsArray, m: U) { } @@ -39,7 +39,7 @@ function someGenerics1b(n: TemplateStringsArray, m: U) { } someGenerics1b `${3}`; >someGenerics1b `${3}` : void >someGenerics1b : (n: TemplateStringsArray, m: U) => void ->`${3}` : string +>`${3}` : "3" >3 : 3 // Generic tag with argument of function type whose parameter is of type parameter type @@ -111,7 +111,7 @@ function someGenerics4(strs: TemplateStringsArray, n: T, f: (x: U) => void someGenerics4 `${4}${ () => null }`; >someGenerics4 `${4}${ () => null }` : void >someGenerics4 : (strs: TemplateStringsArray, n: T, f: (x: U) => void) => void ->`${4}${ () => null }` : string +>`${4}${ () => null }` : `4${string}` >4 : 4 >() => null : () => any >null : null @@ -127,7 +127,7 @@ someGenerics4 `${''}${ () => 3 }`; someGenerics4 `${ null }${ null }`; >someGenerics4 `${ null }${ null }` : void >someGenerics4 : (strs: TemplateStringsArray, n: T, f: (x: U) => void) => void ->`${ null }${ null }` : string +>`${ null }${ null }` : "nullnull" >null : null >null : null @@ -142,7 +142,7 @@ function someGenerics5(strs: TemplateStringsArray, n: T, f: (x: U) => void someGenerics5 `${ 4 } ${ () => null }`; >someGenerics5 `${ 4 } ${ () => null }` : void >someGenerics5 : (strs: TemplateStringsArray, n: T, f: (x: U) => void) => void ->`${ 4 } ${ () => null }` : string +>`${ 4 } ${ () => null }` : `4 ${string}` >4 : 4 >() => null : () => any >null : null @@ -158,7 +158,7 @@ someGenerics5 `${ '' }${ () => 3 }`; someGenerics5 `${null}${null}`; >someGenerics5 `${null}${null}` : void >someGenerics5 : (strs: TemplateStringsArray, n: T, f: (x: U) => void) => void ->`${null}${null}` : string +>`${null}${null}` : "nullnull" >null : null >null : null @@ -285,7 +285,7 @@ var x = someGenerics8 `${ someGenerics7 }`; x `${null}${null}${null}`; >x `${null}${null}${null}` : void >x : (strs: TemplateStringsArray, a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void ->`${null}${null}${null}` : string +>`${null}${null}${null}` : "nullnullnull" >null : null >null : null >null : null @@ -305,7 +305,7 @@ var a9a = someGenerics9 `${ '' }${ 0 }${ [] }`; >a9a : string >someGenerics9 `${ '' }${ 0 }${ [] }` : "" >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T ->`${ '' }${ 0 }${ [] }` : string +>`${ '' }${ 0 }${ [] }` : `0${string}` >'' : "" >0 : 0 >[] : undefined[] @@ -333,7 +333,7 @@ var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: >a9e : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : { x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T ->`${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : string +>`${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }` : `undefined${string}${string}` >undefined : undefined >{ x: 6, z: new Date() } : { x: number; z: Date; } >x : number @@ -378,7 +378,7 @@ var a = someGenerics9 `${ 7 }${ anyVar }${ 4 }`; >a : any >someGenerics9 `${ 7 }${ anyVar }${ 4 }` : any >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T ->`${ 7 }${ anyVar }${ 4 }` : string +>`${ 7 }${ anyVar }${ 4 }` : `7${any}4` >7 : 7 >anyVar : any >4 : 4 @@ -391,7 +391,7 @@ var arr = someGenerics9 `${ [] }${ null }${ undefined }`; >arr : any[] >someGenerics9 `${ [] }${ null }${ undefined }` : any[] >someGenerics9 : (strs: TemplateStringsArray, a: T, b: T, c: T) => T ->`${ [] }${ null }${ undefined }` : string +>`${ [] }${ null }${ undefined }` : `${string}nullundefined` >[] : undefined[] >null : null >undefined : undefined diff --git a/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.types b/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.types index 9f5543bd030c5..3ee924bd2553b 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.types +++ b/tests/baselines/reference/taggedTemplateStringsWithCurriedFunction.types @@ -37,7 +37,7 @@ f({ ...{ x: 0 } })`x${f}x`; >{ x: 0 } : { x: number; } >x : number >0 : 0 ->`x${f}x` : string +>`x${f}x` : `x${string}x` >f : (_: any) => (..._: any[]) => string f({ ...{ x: 0 }, y: (() => 1)() })``; diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types index 1e0acac274aec..aac6a9ef5198a 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types @@ -32,7 +32,7 @@ f `abc` f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -47,7 +47,7 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi`.member : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >member : I @@ -63,7 +63,7 @@ f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" @@ -77,7 +77,7 @@ f `abc`[0].member `abc${1}def${2}ghi`; >`abc` : "abc" >0 : 0 >member : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -87,12 +87,12 @@ f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" >member : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -102,12 +102,12 @@ f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; >f `abc${ true }def${ true }ghi`["member"] : I >f `abc${ true }def${ true }ghi` : I >f : I ->`abc${ true }def${ true }ghi` : string +>`abc${ true }def${ true }ghi` : "abctruedeftrueghi" >true : true >true : true >"member" : "member" >member : I ->`abc${ 1 }def${ 2 }ghi` : string +>`abc${ 1 }def${ 2 }ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -123,7 +123,7 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag : (x: string) => void >f : I >thisIsNotATag : (x: string) => void ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types index 39993e1367b6f..e1790c8933e05 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types @@ -32,7 +32,7 @@ f `abc` f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -47,7 +47,7 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi`.member : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >member : I @@ -63,7 +63,7 @@ f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" @@ -77,7 +77,7 @@ f `abc`[0].member `abc${1}def${2}ghi`; >`abc` : "abc" >0 : 0 >member : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -87,12 +87,12 @@ f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" >member : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -102,12 +102,12 @@ f `abc${ true }def${ true }ghi`["member"].member `abc${ 1 }def${ 2 }ghi`; >f `abc${ true }def${ true }ghi`["member"] : I >f `abc${ true }def${ true }ghi` : I >f : I ->`abc${ true }def${ true }ghi` : string +>`abc${ true }def${ true }ghi` : "abctruedeftrueghi" >true : true >true : true >"member" : "member" >member : I ->`abc${ 1 }def${ 2 }ghi` : string +>`abc${ 1 }def${ 2 }ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -123,7 +123,7 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag : (x: string) => void >f : I >thisIsNotATag : (x: string) => void ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types index 7049ed1cbb746..4fa74ad2d2bb2 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressions.types @@ -30,7 +30,7 @@ var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; >f `abc${ 0 }def`.member : new (s: string) => new (n: number) => new () => boolean >f `abc${ 0 }def` : I >f : I ->`abc${ 0 }def` : string +>`abc${ 0 }def` : "abc0def" >0 : 0 >member : new (s: string) => new (n: number) => new () => boolean >"hello" : "hello" diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types index 365e824c76b08..b953073a17ab4 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.types @@ -30,7 +30,7 @@ var x = new new new f `abc${ 0 }def`.member("hello")(42) === true; >f `abc${ 0 }def`.member : new (s: string) => new (n: number) => new () => boolean >f `abc${ 0 }def` : I >f : I ->`abc${ 0 }def` : string +>`abc${ 0 }def` : "abc0def" >0 : 0 >member : new (s: string) => new (n: number) => new () => boolean >"hello" : "hello" diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.types index e809c1c274578..a051231230175 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.types @@ -84,14 +84,14 @@ var v = foo `${1}`; // string >v : string >foo `${1}` : string >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}` : string +>`${1}` : "1" >1 : 1 var w = foo `${1}${2}`; // boolean >w : boolean >foo `${1}${2}` : boolean >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}${2}` : string +>`${1}${2}` : "12" >1 : 1 >2 : 2 @@ -99,7 +99,7 @@ var x = foo `${1}${true}`; // boolean (with error) >x : never >foo `${1}${true}` : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}${true}` : string +>`${1}${true}` : "1true" >1 : 1 >true : true @@ -107,7 +107,7 @@ var y = foo `${1}${"2"}`; // {} >y : {} >foo `${1}${"2"}` : {} >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}${"2"}` : string +>`${1}${"2"}` : "12" >1 : 1 >"2" : "2" @@ -115,7 +115,7 @@ var z = foo `${1}${2}${3}`; // any (with error) >z : never >foo `${1}${2}${3}` : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}${2}${3}` : string +>`${1}${2}${3}` : "123" >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.types index d9cb80eb05c80..1f84f29a2ee96 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.types @@ -84,14 +84,14 @@ var v = foo `${1}`; // string >v : string >foo `${1}` : string >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}` : string +>`${1}` : "1" >1 : 1 var w = foo `${1}${2}`; // boolean >w : boolean >foo `${1}${2}` : boolean >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}${2}` : string +>`${1}${2}` : "12" >1 : 1 >2 : 2 @@ -99,7 +99,7 @@ var x = foo `${1}${true}`; // boolean (with error) >x : never >foo `${1}${true}` : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}${true}` : string +>`${1}${true}` : "1true" >1 : 1 >true : true @@ -107,7 +107,7 @@ var y = foo `${1}${"2"}`; // {} >y : {} >foo `${1}${"2"}` : {} >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}${"2"}` : string +>`${1}${"2"}` : "12" >1 : 1 >"2" : "2" @@ -115,7 +115,7 @@ var z = foo `${1}${2}${3}`; // any (with error) >z : never >foo `${1}${2}${3}` : never >foo : { (strs: TemplateStringsArray): number; (strs: TemplateStringsArray, x: number): string; (strs: TemplateStringsArray, x: number, y: number): boolean; (strs: TemplateStringsArray, x: number, y: string): {}; } ->`${1}${2}${3}` : string +>`${1}${2}${3}` : "123" >1 : 1 >2 : 2 >3 : 3 diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types index d9bac7879d94d..1bfdf77919a84 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2.types @@ -21,7 +21,7 @@ var a = foo1 `${1}`; >a : string >foo1 `${1}` : string >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } ->`${1}` : string +>`${1}` : "1" >1 : 1 var b = foo1([], 1); @@ -53,7 +53,7 @@ var c = foo2 `${1}`; >c : string >foo2 `${1}` : string >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } ->`${1}` : string +>`${1}` : "1" >1 : 1 var d = foo2([], 1); diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types index 68180a23d8f5f..4ae8b4ac37e98 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.types @@ -21,7 +21,7 @@ var a = foo1 `${1}`; >a : string >foo1 `${1}` : string >foo1 : { (strs: TemplateStringsArray, x: number): string; (strs: string[], x: number): number; } ->`${1}` : string +>`${1}` : "1" >1 : 1 var b = foo1([], 1); @@ -53,7 +53,7 @@ var c = foo2 `${1}`; >c : string >foo2 `${1}` : string >foo2 : { (strs: string[], x: number): number; (strs: TemplateStringsArray, x: number): string; } ->`${1}` : string +>`${1}` : "1" >1 : 1 var d = foo2([], 1); diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.types index 138b2a162da61..44fa1ad821ec9 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.types @@ -18,7 +18,7 @@ var s: string = fn1 `${ undefined }`; >s : string >fn1 `${ undefined }` : string >fn1 : { (strs: TemplateStringsArray, s: string): string; (strs: TemplateStringsArray, n: number): number; } ->`${ undefined }` : string +>`${ undefined }` : "undefined" >undefined : undefined // No candidate overloads found @@ -48,7 +48,7 @@ var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed >d1 : Date >fn2 `${ 0 }${ undefined }` : any >fn2 : { (strs: TemplateStringsArray, s: string, n: number): number; (strs: TemplateStringsArray, n: number, t: T): T; } ->`${ 0 }${ undefined }` : string +>`${ 0 }${ undefined }` : "0undefined" >0 : 0 >undefined : undefined @@ -56,7 +56,7 @@ var d2 = fn2 `${ 0 }${ undefined }`; // any >d2 : any >fn2 `${ 0 }${ undefined }` : any >fn2 : { (strs: TemplateStringsArray, s: string, n: number): number; (strs: TemplateStringsArray, n: number, t: T): T; } ->`${ 0 }${ undefined }` : string +>`${ 0 }${ undefined }` : "0undefined" >0 : 0 >undefined : undefined @@ -74,7 +74,7 @@ d2(); // no error (typed as any) fn2 `${ 0 }${ '' }`; // OK >fn2 `${ 0 }${ '' }` : "" >fn2 : { (strs: TemplateStringsArray, s: string, n: number): number; (strs: TemplateStringsArray, n: number, t: T): T; } ->`${ 0 }${ '' }` : string +>`${ 0 }${ '' }` : "0" >0 : 0 >'' : "" @@ -82,7 +82,7 @@ fn2 `${ 0 }${ '' }`; // OK fn2 `${ '' }${ 0 }`; // OK >fn2 `${ '' }${ 0 }` : number >fn2 : { (strs: TemplateStringsArray, s: string, n: number): number; (strs: TemplateStringsArray, n: number, t: T): T; } ->`${ '' }${ 0 }` : string +>`${ '' }${ 0 }` : "0" >'' : "" >0 : 0 @@ -114,14 +114,14 @@ var s = fn3 `${ 3 }`; >s : string >fn3 `${ 3 }` : string >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var s = fn3 `${'' }${ 3 }${ '' }`; >s : string >fn3 `${'' }${ 3 }${ '' }` : "" >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${'' }${ 3 }${ '' }` : string +>`${'' }${ 3 }${ '' }` : "3" >'' : "" >3 : 3 >'' : "" @@ -130,7 +130,7 @@ var n = fn3 `${ 5 }${ 5 }${ 5 }`; >n : number >fn3 `${ 5 }${ 5 }${ 5 }` : number >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ 5 }${ 5 }${ 5 }` : string +>`${ 5 }${ 5 }${ 5 }` : "555" >5 : 5 >5 : 5 >5 : 5 @@ -143,14 +143,14 @@ var s = fn3 `${ 4 }` >s : string >fn3 `${ 4 }` : string >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ 4 }` : string +>`${ 4 }` : "4" >4 : 4 var s = fn3 `${ '' }${ '' }${ '' }`; >s : string >fn3 `${ '' }${ '' }${ '' }` : "" >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ '' }${ '' }${ '' }` : string +>`${ '' }${ '' }${ '' }` : "" >'' : "" >'' : "" >'' : "" @@ -159,7 +159,7 @@ var n = fn3 `${ '' }${ '' }${ 3 }`; >n : number >fn3 `${ '' }${ '' }${ 3 }` : 3 >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ '' }${ '' }${ 3 }` : string +>`${ '' }${ '' }${ 3 }` : "3" >'' : "" >'' : "" >3 : 3 @@ -194,28 +194,28 @@ function fn4() { } fn4 `${ '' }${ 3 }`; >fn4 `${ '' }${ 3 }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ '' }${ 3 }` : string +>`${ '' }${ 3 }` : "3" >'' : "" >3 : 3 fn4 `${ 3 }${ '' }`; >fn4 `${ 3 }${ '' }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ 3 }${ '' }` : string +>`${ 3 }${ '' }` : "3" >3 : 3 >'' : "" fn4 `${ 3 }${ undefined }`; >fn4 `${ 3 }${ undefined }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ 3 }${ undefined }` : string +>`${ 3 }${ undefined }` : "3undefined" >3 : 3 >undefined : undefined fn4 `${ '' }${ null }`; >fn4 `${ '' }${ null }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ '' }${ null }` : string +>`${ '' }${ null }` : "null" >'' : "" >null : null @@ -223,7 +223,7 @@ fn4 `${ '' }${ null }`; fn4 `${ null }${ null }`; // Error >fn4 `${ null }${ null }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ null }${ null }` : string +>`${ null }${ null }` : "nullnull" >null : null >null : null @@ -231,14 +231,14 @@ fn4 `${ null }${ null }`; // Error fn4 `${ true }${ null }`; >fn4 `${ true }${ null }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ true }${ null }` : string +>`${ true }${ null }` : "truenull" >true : true >null : null fn4 `${ null }${ true }`; >fn4 `${ null }${ true }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ null }${ true }` : string +>`${ null }${ true }` : "nulltrue" >null : null >true : true diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.types b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.types index 57d82e034ae04..61426f6353056 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.types @@ -18,7 +18,7 @@ var s: string = fn1 `${ undefined }`; >s : string >fn1 `${ undefined }` : string >fn1 : { (strs: TemplateStringsArray, s: string): string; (strs: TemplateStringsArray, n: number): number; } ->`${ undefined }` : string +>`${ undefined }` : "undefined" >undefined : undefined // No candidate overloads found @@ -48,7 +48,7 @@ var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed >d1 : Date >fn2 `${ 0 }${ undefined }` : any >fn2 : { (strs: TemplateStringsArray, s: string, n: number): number; (strs: TemplateStringsArray, n: number, t: T): T; } ->`${ 0 }${ undefined }` : string +>`${ 0 }${ undefined }` : "0undefined" >0 : 0 >undefined : undefined @@ -56,7 +56,7 @@ var d2 = fn2 `${ 0 }${ undefined }`; // any >d2 : any >fn2 `${ 0 }${ undefined }` : any >fn2 : { (strs: TemplateStringsArray, s: string, n: number): number; (strs: TemplateStringsArray, n: number, t: T): T; } ->`${ 0 }${ undefined }` : string +>`${ 0 }${ undefined }` : "0undefined" >0 : 0 >undefined : undefined @@ -74,7 +74,7 @@ d2(); // no error (typed as any) fn2 `${ 0 }${ '' }`; // OK >fn2 `${ 0 }${ '' }` : "" >fn2 : { (strs: TemplateStringsArray, s: string, n: number): number; (strs: TemplateStringsArray, n: number, t: T): T; } ->`${ 0 }${ '' }` : string +>`${ 0 }${ '' }` : "0" >0 : 0 >'' : "" @@ -82,7 +82,7 @@ fn2 `${ 0 }${ '' }`; // OK fn2 `${ '' }${ 0 }`; // OK >fn2 `${ '' }${ 0 }` : number >fn2 : { (strs: TemplateStringsArray, s: string, n: number): number; (strs: TemplateStringsArray, n: number, t: T): T; } ->`${ '' }${ 0 }` : string +>`${ '' }${ 0 }` : "0" >'' : "" >0 : 0 @@ -114,14 +114,14 @@ var s = fn3 `${ 3 }`; >s : string >fn3 `${ 3 }` : string >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var s = fn3 `${'' }${ 3 }${ '' }`; >s : string >fn3 `${'' }${ 3 }${ '' }` : "" >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${'' }${ 3 }${ '' }` : string +>`${'' }${ 3 }${ '' }` : "3" >'' : "" >3 : 3 >'' : "" @@ -130,7 +130,7 @@ var n = fn3 `${ 5 }${ 5 }${ 5 }`; >n : number >fn3 `${ 5 }${ 5 }${ 5 }` : number >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ 5 }${ 5 }${ 5 }` : string +>`${ 5 }${ 5 }${ 5 }` : "555" >5 : 5 >5 : 5 >5 : 5 @@ -143,14 +143,14 @@ var s = fn3 `${ 4 }` >s : string >fn3 `${ 4 }` : string >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ 4 }` : string +>`${ 4 }` : "4" >4 : 4 var s = fn3 `${ '' }${ '' }${ '' }`; >s : string >fn3 `${ '' }${ '' }${ '' }` : "" >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ '' }${ '' }${ '' }` : string +>`${ '' }${ '' }${ '' }` : "" >'' : "" >'' : "" >'' : "" @@ -159,7 +159,7 @@ var n = fn3 `${ '' }${ '' }${ 3 }`; >n : number >fn3 `${ '' }${ '' }${ 3 }` : 3 >fn3 : { (strs: TemplateStringsArray, n: T): string; (strs: TemplateStringsArray, s: string, t: T, u: U): U; (strs: TemplateStringsArray, v: V, u: U, t: T): number; } ->`${ '' }${ '' }${ 3 }` : string +>`${ '' }${ '' }${ 3 }` : "3" >'' : "" >'' : "" >3 : 3 @@ -194,28 +194,28 @@ function fn4() { } fn4 `${ '' }${ 3 }`; >fn4 `${ '' }${ 3 }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ '' }${ 3 }` : string +>`${ '' }${ 3 }` : "3" >'' : "" >3 : 3 fn4 `${ 3 }${ '' }`; >fn4 `${ 3 }${ '' }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ 3 }${ '' }` : string +>`${ 3 }${ '' }` : "3" >3 : 3 >'' : "" fn4 `${ 3 }${ undefined }`; >fn4 `${ 3 }${ undefined }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ 3 }${ undefined }` : string +>`${ 3 }${ undefined }` : "3undefined" >3 : 3 >undefined : undefined fn4 `${ '' }${ null }`; >fn4 `${ '' }${ null }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ '' }${ null }` : string +>`${ '' }${ null }` : "null" >'' : "" >null : null @@ -223,7 +223,7 @@ fn4 `${ '' }${ null }`; fn4 `${ null }${ null }`; // Error >fn4 `${ null }${ null }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ null }${ null }` : string +>`${ null }${ null }` : "nullnull" >null : null >null : null @@ -231,14 +231,14 @@ fn4 `${ null }${ null }`; // Error fn4 `${ true }${ null }`; >fn4 `${ true }${ null }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ true }${ null }` : string +>`${ true }${ null }` : "truenull" >true : true >null : null fn4 `${ null }${ true }`; >fn4 `${ null }${ true }` : any >fn4 : { (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray, n: T, m: U): any; (strs: TemplateStringsArray): any; } ->`${ null }${ true }` : string +>`${ null }${ true }` : "nulltrue" >null : null >true : true diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types index 3d39c883056d8..9d09a445ac6d2 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclare.types @@ -8,6 +8,6 @@ function declare(x: any, ...ys: any[]) { declare `Hello ${0} world!`; >declare `Hello ${0} world!` : void >declare : (x: any, ...ys: any[]) => void ->`Hello ${0} world!` : string +>`Hello ${0} world!` : "Hello 0 world!" >0 : 0 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types index 57309b399ba0d..76163bf33c767 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagNamedDeclareES6.types @@ -8,6 +8,6 @@ function declare(x: any, ...ys: any[]) { declare `Hello ${0} world!`; >declare `Hello ${0} world!` : void >declare : (x: any, ...ys: any[]) => void ->`Hello ${0} world!` : string +>`Hello ${0} world!` : "Hello 0 world!" >0 : 0 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types index 9bd975bb472ec..da75f4cec414a 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types @@ -10,7 +10,7 @@ f `abc` f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -30,7 +30,7 @@ f.g.h `abc${1}def${2}ghi`; >f : any >g : any >h : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -45,7 +45,7 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi`.member : any >f `abc${1}def${2}ghi` : any >f : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >member : any @@ -61,7 +61,7 @@ f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : any >f `abc${1}def${2}ghi` : any >f : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" @@ -75,7 +75,7 @@ f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >`abc` : "abc" >"member" : "member" >someOtherTag : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -85,12 +85,12 @@ f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"] : any >f `abc${1}def${2}ghi` : any >f : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" >someOtherTag : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -106,7 +106,7 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag : any >f : any >thisIsNotATag : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types index 3fde2cd552d42..af4251130db25 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types @@ -10,7 +10,7 @@ f `abc` f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : any >f : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -30,7 +30,7 @@ f.g.h `abc${1}def${2}ghi`; >f : any >g : any >h : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -45,7 +45,7 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi`.member : any >f `abc${1}def${2}ghi` : any >f : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >member : any @@ -61,7 +61,7 @@ f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : any >f `abc${1}def${2}ghi` : any >f : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" @@ -75,7 +75,7 @@ f `abc`["member"].someOtherTag `abc${1}def${2}ghi`; >`abc` : "abc" >"member" : "member" >someOtherTag : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -85,12 +85,12 @@ f `abc${1}def${2}ghi`["member"].someOtherTag `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"] : any >f `abc${1}def${2}ghi` : any >f : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" >someOtherTag : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -106,7 +106,7 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag : any >f : any >thisIsNotATag : any ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types index 2f8b5df162bbf..1c41bcbaed049 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types @@ -32,7 +32,7 @@ f `abc` f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -47,7 +47,7 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi`.member : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >member : I @@ -63,7 +63,7 @@ f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" @@ -77,7 +77,7 @@ f `abc`[0].member `abc${1}def${2}ghi`; >`abc` : "abc" >0 : 0 >member : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -87,12 +87,12 @@ f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" >member : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -108,7 +108,7 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag : (x: string) => void >f : I >thisIsNotATag : (x: string) => void ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types index 313a338baf6e9..5bd96e1f154cf 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types @@ -32,7 +32,7 @@ f `abc` f `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -47,7 +47,7 @@ f `abc${1}def${2}ghi`.member; >f `abc${1}def${2}ghi`.member : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >member : I @@ -63,7 +63,7 @@ f `abc${1}def${2}ghi`["member"]; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" @@ -77,7 +77,7 @@ f `abc`[0].member `abc${1}def${2}ghi`; >`abc` : "abc" >0 : 0 >member : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -87,12 +87,12 @@ f `abc${1}def${2}ghi`["member"].member `abc${1}def${2}ghi`; >f `abc${1}def${2}ghi`["member"] : I >f `abc${1}def${2}ghi` : I >f : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 >"member" : "member" >member : I ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 @@ -108,7 +108,7 @@ f.thisIsNotATag(`abc${1}def${2}ghi`); >f.thisIsNotATag : (x: string) => void >f : I >thisIsNotATag : (x: string) => void ->`abc${1}def${2}ghi` : string +>`abc${1}def${2}ghi` : "abc1def2ghi" >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types index 4b9b447d32a32..18d40b65bc40c 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types +++ b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapes.types @@ -7,6 +7,6 @@ function f(...args: any[]) { f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'`; >f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : void >f : (...args: any[]) => void ->`'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : string +>`'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : "'💩' should be converted to '💩'" >" should be converted to " : " should be converted to " diff --git a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types index 36a298c5a38e9..1558663ff7908 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithUnicodeEscapesES6.types @@ -7,6 +7,6 @@ function f(...args: any[]) { f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'`; >f `'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : void >f : (...args: any[]) => void ->`'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : string +>`'\u{1f4a9}'${ " should be converted to " }'\uD83D\uDCA9'` : "'💩' should be converted to '💩'" >" should be converted to " : " should be converted to " diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.types index 16e40b638aa85..8298380638969 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.types @@ -10,6 +10,6 @@ function f(x: TemplateStringsArray, y: string, z: string) { f `123qdawdrqw${ >f `123qdawdrqw${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void ->`123qdawdrqw${ : string +>`123qdawdrqw${ : `123qdawdrqw${any}` > : any diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.types index 600d85805ee3b..093c57969e5bc 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.types @@ -10,7 +10,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { f `123qdawdrqw${ }${ >f `123qdawdrqw${ }${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void ->`123qdawdrqw${ }${ : string +>`123qdawdrqw${ }${ : `123qdawdrqw${any}${any}` > : any > : any diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.types index dd512edab241f..84444acf4b4d0 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.types @@ -10,7 +10,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { f `123qdawdrqw${ 1 }${ >f `123qdawdrqw${ 1 }${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void ->`123qdawdrqw${ 1 }${ : string +>`123qdawdrqw${ 1 }${ : `123qdawdrqw1${any}` >1 : 1 > : any diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.types index 8fb37587be28d..11431691a72eb 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.types @@ -10,7 +10,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { f `123qdawdrqw${ 1 }${ }${ >f `123qdawdrqw${ 1 }${ }${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void ->`123qdawdrqw${ 1 }${ }${ : string +>`123qdawdrqw${ 1 }${ }${ : `123qdawdrqw1${any}${any}` >1 : 1 > : any > : any diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.types index b83f6fd5770ed..fbfaf564ae26b 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.types @@ -10,7 +10,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { f `123qdawdrqw${ 1 }${ 2 }${ >f `123qdawdrqw${ 1 }${ 2 }${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void ->`123qdawdrqw${ 1 }${ 2 }${ : string +>`123qdawdrqw${ 1 }${ 2 }${ : `123qdawdrqw12${any}` >1 : 1 >2 : 2 > : any diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.types b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.types index 6c73c0e59a093..54c6d5900e54e 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.types +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.types @@ -10,7 +10,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { f `123qdawdrqw${ 1 }${ >f `123qdawdrqw${ 1 }${ : void >f : (x: TemplateStringsArray, y: string, z: string) => void ->`123qdawdrqw${ 1 }${ : string +>`123qdawdrqw${ 1 }${ : `123qdawdrqw1${any}` >1 : 1 > : any diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.types b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.types index c2719c22877f7..89e075be990d6 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments1.types +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments1.types @@ -20,7 +20,14 @@ export const a = f ` >a : void >f ` hello ${stuff => stuff.x} brave ${stuff => stuff.y} world ${stuff => stuff.z}` : void >f : (strs: TemplateStringsArray, ...callbacks: ((x: T) => any)[]) => void ->` hello ${stuff => stuff.x} brave ${stuff => stuff.y} world ${stuff => stuff.z}` : string +>` hello ${stuff => stuff.x} brave ${stuff => stuff.y} world ${stuff => stuff.z}` : ` + hello + ${string} + brave + ${string} + world + ${string} +` hello ${stuff => stuff.x} @@ -66,7 +73,14 @@ export const b = g ` >b : string | number | boolean >g ` hello ${stuff => stuff.x} brave ${stuff => stuff.y} world ${stuff => stuff.z}` : string | number | boolean >g : (strs: TemplateStringsArray, t: (i: Input) => T, u: (i: Input) => U, v: (i: Input) => V) => T | U | V ->` hello ${stuff => stuff.x} brave ${stuff => stuff.y} world ${stuff => stuff.z}` : string +>` hello ${stuff => stuff.x} brave ${stuff => stuff.y} world ${stuff => stuff.z}` : ` + hello + ${string} + brave + ${string} + world + ${string} +` hello ${stuff => stuff.x} diff --git a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types index c78719846cf72..3cd64576b349d 100644 --- a/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types +++ b/tests/baselines/reference/taggedTemplatesWithTypeArguments2.types @@ -18,7 +18,7 @@ const a = new tag `${100} ${200}`("hello", "world"); >new tag `${100} ${200}`("hello", "world") : any >tag `${100} ${200}` : SomethingNewable >tag : SomethingTaggable ->`${100} ${200}` : string +>`${100} ${200}` : "100 200" >100 : 100 >200 : 200 >"hello" : "hello" @@ -29,7 +29,7 @@ const b = new tag `${"hello"} ${"world"}`(100, 200); >new tag `${"hello"} ${"world"}`(100, 200) : any >tag `${"hello"} ${"world"}` : SomethingNewable >tag : SomethingTaggable ->`${"hello"} ${"world"}` : string +>`${"hello"} ${"world"}` : "hello world" >"hello" : "hello" >"world" : "world" >100 : 100 @@ -41,7 +41,7 @@ const c = new tag `${100} ${200}`("hello", "world"); >new tag `${100} ${200}` : any >tag `${100} ${200}` : SomethingNewable >tag : SomethingTaggable ->`${100} ${200}` : string +>`${100} ${200}` : "100 200" >100 : 100 >200 : 200 >"hello" : "hello" @@ -53,7 +53,7 @@ const d = new tag `${"hello"} ${"world"}`(100, 200); >new tag `${"hello"} ${"world"}` : any >tag `${"hello"} ${"world"}` : SomethingNewable >tag : SomethingTaggable ->`${"hello"} ${"world"}` : string +>`${"hello"} ${"world"}` : "hello world" >"hello" : "hello" >"world" : "world" >100 : 100 diff --git a/tests/baselines/reference/templateLiteralTypes1.types b/tests/baselines/reference/templateLiteralTypes1.types index 3ab499d448bd1..61429f5de463b 100644 --- a/tests/baselines/reference/templateLiteralTypes1.types +++ b/tests/baselines/reference/templateLiteralTypes1.types @@ -8,7 +8,7 @@ const createScopedActionType = (scope: S) => (type: T) => `${scope}/${type}` as `${S}/${T}` : (type: T) => `${S}/${T}` >type : T >`${scope}/${type}` as `${S}/${T}` : `${S}/${T}` ->`${scope}/${type}` : string +>`${scope}/${type}` : `${S}/${T}` >scope : S >type : T diff --git a/tests/baselines/reference/templateStringBinaryOperations.types b/tests/baselines/reference/templateStringBinaryOperations.types index 01d306487ee01..f554657502536 100644 --- a/tests/baselines/reference/templateStringBinaryOperations.types +++ b/tests/baselines/reference/templateStringBinaryOperations.types @@ -3,55 +3,55 @@ var a = 1 + `${ 3 }`; >a : string >1 + `${ 3 }` : string >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b = 1 + `2${ 3 }`; >b : string >1 + `2${ 3 }` : string >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c = 1 + `${ 3 }4`; >c : string >1 + `${ 3 }4` : string >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d = 1 + `2${ 3 }4`; >d : string >1 + `2${ 3 }4` : string >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e = `${ 3 }` + 5; >e : string >`${ 3 }` + 5 : string ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f = `2${ 3 }` + 5; >f : string >`2${ 3 }` + 5 : string ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g = `${ 3 }4` + 5; >g : string >`${ 3 }4` + 5 : string ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h = `2${ 3 }4` + 5; >h : string >`2${ 3 }4` + 5 : string ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -60,7 +60,7 @@ var i = 1 + `${ 3 }` + 5; >1 + `${ 3 }` + 5 : string >1 + `${ 3 }` : string >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 @@ -69,7 +69,7 @@ var j = 1 + `2${ 3 }` + 5; >1 + `2${ 3 }` + 5 : string >1 + `2${ 3 }` : string >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 @@ -78,7 +78,7 @@ var k = 1 + `${ 3 }4` + 5; >1 + `${ 3 }4` + 5 : string >1 + `${ 3 }4` : string >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 @@ -87,7 +87,7 @@ var l = 1 + `2${ 3 }4` + 5; >1 + `2${ 3 }4` + 5 : string >1 + `2${ 3 }4` : string >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -95,7 +95,7 @@ var a2 = 1 + `${ 3 - 4 }`; >a2 : string >1 + `${ 3 - 4 }` : string >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -104,7 +104,7 @@ var b2 = 1 + `2${ 3 - 4 }`; >b2 : string >1 + `2${ 3 - 4 }` : string >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -113,7 +113,7 @@ var c2 = 1 + `${ 3 - 4 }5`; >c2 : string >1 + `${ 3 - 4 }5` : string >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -122,7 +122,7 @@ var d2 = 1 + `2${ 3 - 4 }5`; >d2 : string >1 + `2${ 3 - 4 }5` : string >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -130,7 +130,7 @@ var d2 = 1 + `2${ 3 - 4 }5`; var e2 = `${ 3 - 4 }` + 6; >e2 : string >`${ 3 - 4 }` + 6 : string ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -139,7 +139,7 @@ var e2 = `${ 3 - 4 }` + 6; var f2 = `2${ 3 - 4 }` + 6; >f2 : string >`2${ 3 - 4 }` + 6 : string ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -148,7 +148,7 @@ var f2 = `2${ 3 - 4 }` + 6; var g2 = `${ 3 - 4 }5` + 6; >g2 : string >`${ 3 - 4 }5` + 6 : string ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -157,7 +157,7 @@ var g2 = `${ 3 - 4 }5` + 6; var h2 = `2${ 3 - 4 }5` + 6; >h2 : string >`2${ 3 - 4 }5` + 6 : string ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -168,7 +168,7 @@ var i2 = 1 + `${ 3 - 4 }` + 6; >1 + `${ 3 - 4 }` + 6 : string >1 + `${ 3 - 4 }` : string >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -179,7 +179,7 @@ var j2 = 1 + `2${ 3 - 4 }` + 6; >1 + `2${ 3 - 4 }` + 6 : string >1 + `2${ 3 - 4 }` : string >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -190,7 +190,7 @@ var k2 = 1 + `${ 3 - 4 }5` + 6; >1 + `${ 3 - 4 }5` + 6 : string >1 + `${ 3 - 4 }5` : string >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -201,7 +201,7 @@ var l2 = 1 + `2${ 3 - 4 }5` + 6; >1 + `2${ 3 - 4 }5` + 6 : string >1 + `2${ 3 - 4 }5` : string >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -211,7 +211,7 @@ var a3 = 1 + `${ 3 * 4 }`; >a3 : string >1 + `${ 3 * 4 }` : string >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -220,7 +220,7 @@ var b3 = 1 + `2${ 3 * 4 }`; >b3 : string >1 + `2${ 3 * 4 }` : string >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -229,7 +229,7 @@ var c3 = 1 + `${ 3 * 4 }5`; >c3 : string >1 + `${ 3 * 4 }5` : string >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -238,7 +238,7 @@ var d3 = 1 + `2${ 3 * 4 }5`; >d3 : string >1 + `2${ 3 * 4 }5` : string >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -246,7 +246,7 @@ var d3 = 1 + `2${ 3 * 4 }5`; var e3 = `${ 3 * 4 }` + 6; >e3 : string >`${ 3 * 4 }` + 6 : string ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -255,7 +255,7 @@ var e3 = `${ 3 * 4 }` + 6; var f3 = `2${ 3 * 4 }` + 6; >f3 : string >`2${ 3 * 4 }` + 6 : string ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -264,7 +264,7 @@ var f3 = `2${ 3 * 4 }` + 6; var g3 = `${ 3 * 4 }5` + 6; >g3 : string >`${ 3 * 4 }5` + 6 : string ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -273,7 +273,7 @@ var g3 = `${ 3 * 4 }5` + 6; var h3 = `2${ 3 * 4 }5` + 6; >h3 : string >`2${ 3 * 4 }5` + 6 : string ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -284,7 +284,7 @@ var i3 = 1 + `${ 3 * 4 }` + 6; >1 + `${ 3 * 4 }` + 6 : string >1 + `${ 3 * 4 }` : string >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -295,7 +295,7 @@ var j3 = 1 + `2${ 3 * 4 }` + 6; >1 + `2${ 3 * 4 }` + 6 : string >1 + `2${ 3 * 4 }` : string >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -306,7 +306,7 @@ var k3 = 1 + `${ 3 * 4 }5` + 6; >1 + `${ 3 * 4 }5` + 6 : string >1 + `${ 3 * 4 }5` : string >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -317,7 +317,7 @@ var l3 = 1 + `2${ 3 * 4 }5` + 6; >1 + `2${ 3 * 4 }5` + 6 : string >1 + `2${ 3 * 4 }5` : string >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -327,7 +327,7 @@ var a4 = 1 + `${ 3 & 4 }`; >a4 : string >1 + `${ 3 & 4 }` : string >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -336,7 +336,7 @@ var b4 = 1 + `2${ 3 & 4 }`; >b4 : string >1 + `2${ 3 & 4 }` : string >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -345,7 +345,7 @@ var c4 = 1 + `${ 3 & 4 }5`; >c4 : string >1 + `${ 3 & 4 }5` : string >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -354,7 +354,7 @@ var d4 = 1 + `2${ 3 & 4 }5`; >d4 : string >1 + `2${ 3 & 4 }5` : string >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -362,7 +362,7 @@ var d4 = 1 + `2${ 3 & 4 }5`; var e4 = `${ 3 & 4 }` + 6; >e4 : string >`${ 3 & 4 }` + 6 : string ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -371,7 +371,7 @@ var e4 = `${ 3 & 4 }` + 6; var f4 = `2${ 3 & 4 }` + 6; >f4 : string >`2${ 3 & 4 }` + 6 : string ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -380,7 +380,7 @@ var f4 = `2${ 3 & 4 }` + 6; var g4 = `${ 3 & 4 }5` + 6; >g4 : string >`${ 3 & 4 }5` + 6 : string ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -389,7 +389,7 @@ var g4 = `${ 3 & 4 }5` + 6; var h4 = `2${ 3 & 4 }5` + 6; >h4 : string >`2${ 3 & 4 }5` + 6 : string ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -400,7 +400,7 @@ var i4 = 1 + `${ 3 & 4 }` + 6; >1 + `${ 3 & 4 }` + 6 : string >1 + `${ 3 & 4 }` : string >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -411,7 +411,7 @@ var j4 = 1 + `2${ 3 & 4 }` + 6; >1 + `2${ 3 & 4 }` + 6 : string >1 + `2${ 3 & 4 }` : string >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -422,7 +422,7 @@ var k4 = 1 + `${ 3 & 4 }5` + 6; >1 + `${ 3 & 4 }5` + 6 : string >1 + `${ 3 & 4 }5` : string >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -433,7 +433,7 @@ var l4 = 1 + `2${ 3 & 4 }5` + 6; >1 + `2${ 3 & 4 }5` + 6 : string >1 + `2${ 3 & 4 }5` : string >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 diff --git a/tests/baselines/reference/templateStringBinaryOperationsES6.types b/tests/baselines/reference/templateStringBinaryOperationsES6.types index 0ac9775a655ab..ebbc7bcf88c2e 100644 --- a/tests/baselines/reference/templateStringBinaryOperationsES6.types +++ b/tests/baselines/reference/templateStringBinaryOperationsES6.types @@ -3,55 +3,55 @@ var a = 1 + `${ 3 }`; >a : string >1 + `${ 3 }` : string >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b = 1 + `2${ 3 }`; >b : string >1 + `2${ 3 }` : string >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c = 1 + `${ 3 }4`; >c : string >1 + `${ 3 }4` : string >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d = 1 + `2${ 3 }4`; >d : string >1 + `2${ 3 }4` : string >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e = `${ 3 }` + 5; >e : string >`${ 3 }` + 5 : string ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f = `2${ 3 }` + 5; >f : string >`2${ 3 }` + 5 : string ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g = `${ 3 }4` + 5; >g : string >`${ 3 }4` + 5 : string ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h = `2${ 3 }4` + 5; >h : string >`2${ 3 }4` + 5 : string ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -60,7 +60,7 @@ var i = 1 + `${ 3 }` + 5; >1 + `${ 3 }` + 5 : string >1 + `${ 3 }` : string >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 @@ -69,7 +69,7 @@ var j = 1 + `2${ 3 }` + 5; >1 + `2${ 3 }` + 5 : string >1 + `2${ 3 }` : string >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 @@ -78,7 +78,7 @@ var k = 1 + `${ 3 }4` + 5; >1 + `${ 3 }4` + 5 : string >1 + `${ 3 }4` : string >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 @@ -87,7 +87,7 @@ var l = 1 + `2${ 3 }4` + 5; >1 + `2${ 3 }4` + 5 : string >1 + `2${ 3 }4` : string >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -95,7 +95,7 @@ var a2 = 1 + `${ 3 - 4 }`; >a2 : string >1 + `${ 3 - 4 }` : string >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -104,7 +104,7 @@ var b2 = 1 + `2${ 3 - 4 }`; >b2 : string >1 + `2${ 3 - 4 }` : string >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -113,7 +113,7 @@ var c2 = 1 + `${ 3 - 4 }5`; >c2 : string >1 + `${ 3 - 4 }5` : string >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -122,7 +122,7 @@ var d2 = 1 + `2${ 3 - 4 }5`; >d2 : string >1 + `2${ 3 - 4 }5` : string >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -130,7 +130,7 @@ var d2 = 1 + `2${ 3 - 4 }5`; var e2 = `${ 3 - 4 }` + 6; >e2 : string >`${ 3 - 4 }` + 6 : string ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -139,7 +139,7 @@ var e2 = `${ 3 - 4 }` + 6; var f2 = `2${ 3 - 4 }` + 6; >f2 : string >`2${ 3 - 4 }` + 6 : string ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -148,7 +148,7 @@ var f2 = `2${ 3 - 4 }` + 6; var g2 = `${ 3 - 4 }5` + 6; >g2 : string >`${ 3 - 4 }5` + 6 : string ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -157,7 +157,7 @@ var g2 = `${ 3 - 4 }5` + 6; var h2 = `2${ 3 - 4 }5` + 6; >h2 : string >`2${ 3 - 4 }5` + 6 : string ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -168,7 +168,7 @@ var i2 = 1 + `${ 3 - 4 }` + 6; >1 + `${ 3 - 4 }` + 6 : string >1 + `${ 3 - 4 }` : string >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -179,7 +179,7 @@ var j2 = 1 + `2${ 3 - 4 }` + 6; >1 + `2${ 3 - 4 }` + 6 : string >1 + `2${ 3 - 4 }` : string >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -190,7 +190,7 @@ var k2 = 1 + `${ 3 - 4 }5` + 6; >1 + `${ 3 - 4 }5` + 6 : string >1 + `${ 3 - 4 }5` : string >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -201,7 +201,7 @@ var l2 = 1 + `2${ 3 - 4 }5` + 6; >1 + `2${ 3 - 4 }5` + 6 : string >1 + `2${ 3 - 4 }5` : string >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -211,7 +211,7 @@ var a3 = 1 + `${ 3 * 4 }`; >a3 : string >1 + `${ 3 * 4 }` : string >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -220,7 +220,7 @@ var b3 = 1 + `2${ 3 * 4 }`; >b3 : string >1 + `2${ 3 * 4 }` : string >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -229,7 +229,7 @@ var c3 = 1 + `${ 3 * 4 }5`; >c3 : string >1 + `${ 3 * 4 }5` : string >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -238,7 +238,7 @@ var d3 = 1 + `2${ 3 * 4 }5`; >d3 : string >1 + `2${ 3 * 4 }5` : string >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -246,7 +246,7 @@ var d3 = 1 + `2${ 3 * 4 }5`; var e3 = `${ 3 * 4 }` + 6; >e3 : string >`${ 3 * 4 }` + 6 : string ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -255,7 +255,7 @@ var e3 = `${ 3 * 4 }` + 6; var f3 = `2${ 3 * 4 }` + 6; >f3 : string >`2${ 3 * 4 }` + 6 : string ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -264,7 +264,7 @@ var f3 = `2${ 3 * 4 }` + 6; var g3 = `${ 3 * 4 }5` + 6; >g3 : string >`${ 3 * 4 }5` + 6 : string ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -273,7 +273,7 @@ var g3 = `${ 3 * 4 }5` + 6; var h3 = `2${ 3 * 4 }5` + 6; >h3 : string >`2${ 3 * 4 }5` + 6 : string ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -284,7 +284,7 @@ var i3 = 1 + `${ 3 * 4 }` + 6; >1 + `${ 3 * 4 }` + 6 : string >1 + `${ 3 * 4 }` : string >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -295,7 +295,7 @@ var j3 = 1 + `2${ 3 * 4 }` + 6; >1 + `2${ 3 * 4 }` + 6 : string >1 + `2${ 3 * 4 }` : string >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -306,7 +306,7 @@ var k3 = 1 + `${ 3 * 4 }5` + 6; >1 + `${ 3 * 4 }5` + 6 : string >1 + `${ 3 * 4 }5` : string >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -317,7 +317,7 @@ var l3 = 1 + `2${ 3 * 4 }5` + 6; >1 + `2${ 3 * 4 }5` + 6 : string >1 + `2${ 3 * 4 }5` : string >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -327,7 +327,7 @@ var a4 = 1 + `${ 3 & 4 }`; >a4 : string >1 + `${ 3 & 4 }` : string >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -336,7 +336,7 @@ var b4 = 1 + `2${ 3 & 4 }`; >b4 : string >1 + `2${ 3 & 4 }` : string >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -345,7 +345,7 @@ var c4 = 1 + `${ 3 & 4 }5`; >c4 : string >1 + `${ 3 & 4 }5` : string >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -354,7 +354,7 @@ var d4 = 1 + `2${ 3 & 4 }5`; >d4 : string >1 + `2${ 3 & 4 }5` : string >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -362,7 +362,7 @@ var d4 = 1 + `2${ 3 & 4 }5`; var e4 = `${ 3 & 4 }` + 6; >e4 : string >`${ 3 & 4 }` + 6 : string ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -371,7 +371,7 @@ var e4 = `${ 3 & 4 }` + 6; var f4 = `2${ 3 & 4 }` + 6; >f4 : string >`2${ 3 & 4 }` + 6 : string ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -380,7 +380,7 @@ var f4 = `2${ 3 & 4 }` + 6; var g4 = `${ 3 & 4 }5` + 6; >g4 : string >`${ 3 & 4 }5` + 6 : string ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -389,7 +389,7 @@ var g4 = `${ 3 & 4 }5` + 6; var h4 = `2${ 3 & 4 }5` + 6; >h4 : string >`2${ 3 & 4 }5` + 6 : string ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -400,7 +400,7 @@ var i4 = 1 + `${ 3 & 4 }` + 6; >1 + `${ 3 & 4 }` + 6 : string >1 + `${ 3 & 4 }` : string >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -411,7 +411,7 @@ var j4 = 1 + `2${ 3 & 4 }` + 6; >1 + `2${ 3 & 4 }` + 6 : string >1 + `2${ 3 & 4 }` : string >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -422,7 +422,7 @@ var k4 = 1 + `${ 3 & 4 }5` + 6; >1 + `${ 3 & 4 }5` + 6 : string >1 + `${ 3 & 4 }5` : string >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -433,7 +433,7 @@ var l4 = 1 + `2${ 3 & 4 }5` + 6; >1 + `2${ 3 & 4 }5` + 6 : string >1 + `2${ 3 & 4 }5` : string >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 diff --git a/tests/baselines/reference/templateStringBinaryOperationsES6Invalid.types b/tests/baselines/reference/templateStringBinaryOperationsES6Invalid.types index 8782991b7106c..4c859c9108be6 100644 --- a/tests/baselines/reference/templateStringBinaryOperationsES6Invalid.types +++ b/tests/baselines/reference/templateStringBinaryOperationsES6Invalid.types @@ -3,55 +3,55 @@ var a = 1 - `${ 3 }`; >a : number >1 - `${ 3 }` : number >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b = 1 - `2${ 3 }`; >b : number >1 - `2${ 3 }` : number >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c = 1 - `${ 3 }4`; >c : number >1 - `${ 3 }4` : number >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d = 1 - `2${ 3 }4`; >d : number >1 - `2${ 3 }4` : number >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e = `${ 3 }` - 5; >e : number >`${ 3 }` - 5 : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f = `2${ 3 }` - 5; >f : number >`2${ 3 }` - 5 : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g = `${ 3 }4` - 5; >g : number >`${ 3 }4` - 5 : number ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h = `2${ 3 }4` - 5; >h : number >`2${ 3 }4` - 5 : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -59,55 +59,55 @@ var a2 = 1 * `${ 3 }`; >a2 : number >1 * `${ 3 }` : number >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b2 = 1 * `2${ 3 }`; >b2 : number >1 * `2${ 3 }` : number >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c2 = 1 * `${ 3 }4`; >c2 : number >1 * `${ 3 }4` : number >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d2 = 1 * `2${ 3 }4`; >d2 : number >1 * `2${ 3 }4` : number >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e2 = `${ 3 }` * 5; >e2 : number >`${ 3 }` * 5 : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f2 = `2${ 3 }` * 5; >f2 : number >`2${ 3 }` * 5 : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g2 = `${ 3 }4` * 5; >g2 : number >`${ 3 }4` * 5 : number ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h2 = `2${ 3 }4` * 5; >h2 : number >`2${ 3 }4` * 5 : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -115,55 +115,55 @@ var a3 = 1 & `${ 3 }`; >a3 : number >1 & `${ 3 }` : number >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b3 = 1 & `2${ 3 }`; >b3 : number >1 & `2${ 3 }` : number >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c3 = 1 & `${ 3 }4`; >c3 : number >1 & `${ 3 }4` : number >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d3 = 1 & `2${ 3 }4`; >d3 : number >1 & `2${ 3 }4` : number >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e3 = `${ 3 }` & 5; >e3 : number >`${ 3 }` & 5 : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f3 = `2${ 3 }` & 5; >f3 : number >`2${ 3 }` & 5 : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g3 = `${ 3 }4` & 5; >g3 : number >`${ 3 }4` & 5 : number ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h3 = `2${ 3 }4` & 5; >h3 : number >`2${ 3 }4` & 5 : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -171,7 +171,7 @@ var a4 = 1 - `${ 3 - 4 }`; >a4 : number >1 - `${ 3 - 4 }` : number >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -180,7 +180,7 @@ var b4 = 1 - `2${ 3 - 4 }`; >b4 : number >1 - `2${ 3 - 4 }` : number >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -189,7 +189,7 @@ var c4 = 1 - `${ 3 - 4 }5`; >c4 : number >1 - `${ 3 - 4 }5` : number >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -198,7 +198,7 @@ var d4 = 1 - `2${ 3 - 4 }5`; >d4 : number >1 - `2${ 3 - 4 }5` : number >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -206,7 +206,7 @@ var d4 = 1 - `2${ 3 - 4 }5`; var e4 = `${ 3 - 4 }` - 6; >e4 : number >`${ 3 - 4 }` - 6 : number ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -215,7 +215,7 @@ var e4 = `${ 3 - 4 }` - 6; var f4 = `2${ 3 - 4 }` - 6; >f4 : number >`2${ 3 - 4 }` - 6 : number ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -224,7 +224,7 @@ var f4 = `2${ 3 - 4 }` - 6; var g4 = `${ 3 - 4 }5` - 6; >g4 : number >`${ 3 - 4 }5` - 6 : number ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -233,7 +233,7 @@ var g4 = `${ 3 - 4 }5` - 6; var h4 = `2${ 3 - 4 }5` - 6; >h4 : number >`2${ 3 - 4 }5` - 6 : number ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -243,7 +243,7 @@ var a5 = 1 - `${ 3 * 4 }`; >a5 : number >1 - `${ 3 * 4 }` : number >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -252,7 +252,7 @@ var b5 = 1 - `2${ 3 * 4 }`; >b5 : number >1 - `2${ 3 * 4 }` : number >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -261,7 +261,7 @@ var c5 = 1 - `${ 3 * 4 }5`; >c5 : number >1 - `${ 3 * 4 }5` : number >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -270,7 +270,7 @@ var d5 = 1 - `2${ 3 * 4 }5`; >d5 : number >1 - `2${ 3 * 4 }5` : number >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -278,7 +278,7 @@ var d5 = 1 - `2${ 3 * 4 }5`; var e5 = `${ 3 * 4 }` - 6; >e5 : number >`${ 3 * 4 }` - 6 : number ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -287,7 +287,7 @@ var e5 = `${ 3 * 4 }` - 6; var f5 = `2${ 3 * 4 }` - 6; >f5 : number >`2${ 3 * 4 }` - 6 : number ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -296,7 +296,7 @@ var f5 = `2${ 3 * 4 }` - 6; var g5 = `${ 3 * 4 }5` - 6; >g5 : number >`${ 3 * 4 }5` - 6 : number ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -305,7 +305,7 @@ var g5 = `${ 3 * 4 }5` - 6; var h5 = `2${ 3 * 4 }5` - 6; >h5 : number >`2${ 3 * 4 }5` - 6 : number ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -315,7 +315,7 @@ var a6 = 1 - `${ 3 & 4 }`; >a6 : number >1 - `${ 3 & 4 }` : number >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -324,7 +324,7 @@ var b6 = 1 - `2${ 3 & 4 }`; >b6 : number >1 - `2${ 3 & 4 }` : number >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -333,7 +333,7 @@ var c6 = 1 - `${ 3 & 4 }5`; >c6 : number >1 - `${ 3 & 4 }5` : number >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -342,7 +342,7 @@ var d6 = 1 - `2${ 3 & 4 }5`; >d6 : number >1 - `2${ 3 & 4 }5` : number >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -350,7 +350,7 @@ var d6 = 1 - `2${ 3 & 4 }5`; var e6 = `${ 3 & 4 }` - 6; >e6 : number >`${ 3 & 4 }` - 6 : number ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -359,7 +359,7 @@ var e6 = `${ 3 & 4 }` - 6; var f6 = `2${ 3 & 4 }` - 6; >f6 : number >`2${ 3 & 4 }` - 6 : number ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -368,7 +368,7 @@ var f6 = `2${ 3 & 4 }` - 6; var g6 = `${ 3 & 4 }5` - 6; >g6 : number >`${ 3 & 4 }5` - 6 : number ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -377,7 +377,7 @@ var g6 = `${ 3 & 4 }5` - 6; var h6 = `2${ 3 & 4 }5` - 6; >h6 : number >`2${ 3 & 4 }5` - 6 : number ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -387,7 +387,7 @@ var a7 = 1 * `${ 3 - 4 }`; >a7 : number >1 * `${ 3 - 4 }` : number >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -396,7 +396,7 @@ var b7 = 1 * `2${ 3 - 4 }`; >b7 : number >1 * `2${ 3 - 4 }` : number >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -405,7 +405,7 @@ var c7 = 1 * `${ 3 - 4 }5`; >c7 : number >1 * `${ 3 - 4 }5` : number >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -414,7 +414,7 @@ var d7 = 1 * `2${ 3 - 4 }5`; >d7 : number >1 * `2${ 3 - 4 }5` : number >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -422,7 +422,7 @@ var d7 = 1 * `2${ 3 - 4 }5`; var e7 = `${ 3 - 4 }` * 6; >e7 : number >`${ 3 - 4 }` * 6 : number ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -431,7 +431,7 @@ var e7 = `${ 3 - 4 }` * 6; var f7 = `2${ 3 - 4 }` * 6; >f7 : number >`2${ 3 - 4 }` * 6 : number ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -440,7 +440,7 @@ var f7 = `2${ 3 - 4 }` * 6; var g7 = `${ 3 - 4 }5` * 6; >g7 : number >`${ 3 - 4 }5` * 6 : number ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -449,7 +449,7 @@ var g7 = `${ 3 - 4 }5` * 6; var h7 = `2${ 3 - 4 }5` * 6; >h7 : number >`2${ 3 - 4 }5` * 6 : number ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -459,7 +459,7 @@ var a8 = 1 * `${ 3 * 4 }`; >a8 : number >1 * `${ 3 * 4 }` : number >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -468,7 +468,7 @@ var b8 = 1 * `2${ 3 * 4 }`; >b8 : number >1 * `2${ 3 * 4 }` : number >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -477,7 +477,7 @@ var c8 = 1 * `${ 3 * 4 }5`; >c8 : number >1 * `${ 3 * 4 }5` : number >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -486,7 +486,7 @@ var d8 = 1 * `2${ 3 * 4 }5`; >d8 : number >1 * `2${ 3 * 4 }5` : number >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -494,7 +494,7 @@ var d8 = 1 * `2${ 3 * 4 }5`; var e8 = `${ 3 * 4 }` * 6; >e8 : number >`${ 3 * 4 }` * 6 : number ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -503,7 +503,7 @@ var e8 = `${ 3 * 4 }` * 6; var f8 = `2${ 3 * 4 }` * 6; >f8 : number >`2${ 3 * 4 }` * 6 : number ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -512,7 +512,7 @@ var f8 = `2${ 3 * 4 }` * 6; var g8 = `${ 3 * 4 }5` * 6; >g8 : number >`${ 3 * 4 }5` * 6 : number ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -521,7 +521,7 @@ var g8 = `${ 3 * 4 }5` * 6; var h8 = `2${ 3 * 4 }5` * 6; >h8 : number >`2${ 3 * 4 }5` * 6 : number ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -531,7 +531,7 @@ var a9 = 1 * `${ 3 & 4 }`; >a9 : number >1 * `${ 3 & 4 }` : number >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -540,7 +540,7 @@ var b9 = 1 * `2${ 3 & 4 }`; >b9 : number >1 * `2${ 3 & 4 }` : number >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -549,7 +549,7 @@ var c9 = 1 * `${ 3 & 4 }5`; >c9 : number >1 * `${ 3 & 4 }5` : number >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -558,7 +558,7 @@ var d9 = 1 * `2${ 3 & 4 }5`; >d9 : number >1 * `2${ 3 & 4 }5` : number >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -566,7 +566,7 @@ var d9 = 1 * `2${ 3 & 4 }5`; var e9 = `${ 3 & 4 }` * 6; >e9 : number >`${ 3 & 4 }` * 6 : number ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -575,7 +575,7 @@ var e9 = `${ 3 & 4 }` * 6; var f9 = `2${ 3 & 4 }` * 6; >f9 : number >`2${ 3 & 4 }` * 6 : number ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -584,7 +584,7 @@ var f9 = `2${ 3 & 4 }` * 6; var g9 = `${ 3 & 4 }5` * 6; >g9 : number >`${ 3 & 4 }5` * 6 : number ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -593,7 +593,7 @@ var g9 = `${ 3 & 4 }5` * 6; var h9 = `2${ 3 & 4 }5` * 6; >h9 : number >`2${ 3 & 4 }5` * 6 : number ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -603,7 +603,7 @@ var aa = 1 & `${ 3 - 4 }`; >aa : number >1 & `${ 3 - 4 }` : number >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -612,7 +612,7 @@ var ba = 1 & `2${ 3 - 4 }`; >ba : number >1 & `2${ 3 - 4 }` : number >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -621,7 +621,7 @@ var ca = 1 & `${ 3 - 4 }5`; >ca : number >1 & `${ 3 - 4 }5` : number >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -630,7 +630,7 @@ var da = 1 & `2${ 3 - 4 }5`; >da : number >1 & `2${ 3 - 4 }5` : number >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -638,7 +638,7 @@ var da = 1 & `2${ 3 - 4 }5`; var ea = `${ 3 - 4 }` & 6; >ea : number >`${ 3 - 4 }` & 6 : number ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -647,7 +647,7 @@ var ea = `${ 3 - 4 }` & 6; var fa = `2${ 3 - 4 }` & 6; >fa : number >`2${ 3 - 4 }` & 6 : number ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -656,7 +656,7 @@ var fa = `2${ 3 - 4 }` & 6; var ga = `${ 3 - 4 }5` & 6; >ga : number >`${ 3 - 4 }5` & 6 : number ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -665,7 +665,7 @@ var ga = `${ 3 - 4 }5` & 6; var ha = `2${ 3 - 4 }5` & 6; >ha : number >`2${ 3 - 4 }5` & 6 : number ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -675,7 +675,7 @@ var ab = 1 & `${ 3 * 4 }`; >ab : number >1 & `${ 3 * 4 }` : number >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -684,7 +684,7 @@ var bb = 1 & `2${ 3 * 4 }`; >bb : number >1 & `2${ 3 * 4 }` : number >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -693,7 +693,7 @@ var cb = 1 & `${ 3 * 4 }5`; >cb : number >1 & `${ 3 * 4 }5` : number >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -702,7 +702,7 @@ var db = 1 & `2${ 3 * 4 }5`; >db : number >1 & `2${ 3 * 4 }5` : number >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -710,7 +710,7 @@ var db = 1 & `2${ 3 * 4 }5`; var eb = `${ 3 * 4 }` & 6; >eb : number >`${ 3 * 4 }` & 6 : number ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -719,7 +719,7 @@ var eb = `${ 3 * 4 }` & 6; var fb = `2${ 3 * 4 }` & 6; >fb : number >`2${ 3 * 4 }` & 6 : number ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -728,7 +728,7 @@ var fb = `2${ 3 * 4 }` & 6; var gb = `${ 3 * 4 }5` & 6; >gb : number >`${ 3 * 4 }5` & 6 : number ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -737,7 +737,7 @@ var gb = `${ 3 * 4 }5` & 6; var hb = `2${ 3 * 4 }5` & 6; >hb : number >`2${ 3 * 4 }5` & 6 : number ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -747,7 +747,7 @@ var ac = 1 & `${ 3 & 4 }`; >ac : number >1 & `${ 3 & 4 }` : number >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -756,7 +756,7 @@ var bc = 1 & `2${ 3 & 4 }`; >bc : number >1 & `2${ 3 & 4 }` : number >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -765,7 +765,7 @@ var cc = 1 & `${ 3 & 4 }5`; >cc : number >1 & `${ 3 & 4 }5` : number >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -774,7 +774,7 @@ var dc = 1 & `2${ 3 & 4 }5`; >dc : number >1 & `2${ 3 & 4 }5` : number >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -782,7 +782,7 @@ var dc = 1 & `2${ 3 & 4 }5`; var ec = `${ 3 & 4 }` & 6; >ec : number >`${ 3 & 4 }` & 6 : number ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -791,7 +791,7 @@ var ec = `${ 3 & 4 }` & 6; var fc = `2${ 3 & 4 }` & 6; >fc : number >`2${ 3 & 4 }` & 6 : number ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -800,7 +800,7 @@ var fc = `2${ 3 & 4 }` & 6; var gc = `${ 3 & 4 }5` & 6; >gc : number >`${ 3 & 4 }5` & 6 : number ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -809,7 +809,7 @@ var gc = `${ 3 & 4 }5` & 6; var hc = `2${ 3 & 4 }5` & 6; >hc : number >`2${ 3 & 4 }5` & 6 : number ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 diff --git a/tests/baselines/reference/templateStringBinaryOperationsInvalid.types b/tests/baselines/reference/templateStringBinaryOperationsInvalid.types index 37f0149ad74db..2bfb626146530 100644 --- a/tests/baselines/reference/templateStringBinaryOperationsInvalid.types +++ b/tests/baselines/reference/templateStringBinaryOperationsInvalid.types @@ -3,55 +3,55 @@ var a = 1 - `${ 3 }`; >a : number >1 - `${ 3 }` : number >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b = 1 - `2${ 3 }`; >b : number >1 - `2${ 3 }` : number >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c = 1 - `${ 3 }4`; >c : number >1 - `${ 3 }4` : number >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d = 1 - `2${ 3 }4`; >d : number >1 - `2${ 3 }4` : number >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e = `${ 3 }` - 5; >e : number >`${ 3 }` - 5 : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f = `2${ 3 }` - 5; >f : number >`2${ 3 }` - 5 : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g = `${ 3 }4` - 5; >g : number >`${ 3 }4` - 5 : number ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h = `2${ 3 }4` - 5; >h : number >`2${ 3 }4` - 5 : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -59,55 +59,55 @@ var a2 = 1 * `${ 3 }`; >a2 : number >1 * `${ 3 }` : number >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b2 = 1 * `2${ 3 }`; >b2 : number >1 * `2${ 3 }` : number >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c2 = 1 * `${ 3 }4`; >c2 : number >1 * `${ 3 }4` : number >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d2 = 1 * `2${ 3 }4`; >d2 : number >1 * `2${ 3 }4` : number >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e2 = `${ 3 }` * 5; >e2 : number >`${ 3 }` * 5 : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f2 = `2${ 3 }` * 5; >f2 : number >`2${ 3 }` * 5 : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g2 = `${ 3 }4` * 5; >g2 : number >`${ 3 }4` * 5 : number ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h2 = `2${ 3 }4` * 5; >h2 : number >`2${ 3 }4` * 5 : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -115,55 +115,55 @@ var a3 = 1 & `${ 3 }`; >a3 : number >1 & `${ 3 }` : number >1 : 1 ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 var b3 = 1 & `2${ 3 }`; >b3 : number >1 & `2${ 3 }` : number >1 : 1 ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 var c3 = 1 & `${ 3 }4`; >c3 : number >1 & `${ 3 }4` : number >1 : 1 ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 var d3 = 1 & `2${ 3 }4`; >d3 : number >1 & `2${ 3 }4` : number >1 : 1 ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 var e3 = `${ 3 }` & 5; >e3 : number >`${ 3 }` & 5 : number ->`${ 3 }` : string +>`${ 3 }` : "3" >3 : 3 >5 : 5 var f3 = `2${ 3 }` & 5; >f3 : number >`2${ 3 }` & 5 : number ->`2${ 3 }` : string +>`2${ 3 }` : "23" >3 : 3 >5 : 5 var g3 = `${ 3 }4` & 5; >g3 : number >`${ 3 }4` & 5 : number ->`${ 3 }4` : string +>`${ 3 }4` : "34" >3 : 3 >5 : 5 var h3 = `2${ 3 }4` & 5; >h3 : number >`2${ 3 }4` & 5 : number ->`2${ 3 }4` : string +>`2${ 3 }4` : "234" >3 : 3 >5 : 5 @@ -171,7 +171,7 @@ var a4 = 1 - `${ 3 - 4 }`; >a4 : number >1 - `${ 3 - 4 }` : number >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -180,7 +180,7 @@ var b4 = 1 - `2${ 3 - 4 }`; >b4 : number >1 - `2${ 3 - 4 }` : number >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -189,7 +189,7 @@ var c4 = 1 - `${ 3 - 4 }5`; >c4 : number >1 - `${ 3 - 4 }5` : number >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -198,7 +198,7 @@ var d4 = 1 - `2${ 3 - 4 }5`; >d4 : number >1 - `2${ 3 - 4 }5` : number >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -206,7 +206,7 @@ var d4 = 1 - `2${ 3 - 4 }5`; var e4 = `${ 3 - 4 }` - 6; >e4 : number >`${ 3 - 4 }` - 6 : number ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -215,7 +215,7 @@ var e4 = `${ 3 - 4 }` - 6; var f4 = `2${ 3 - 4 }` - 6; >f4 : number >`2${ 3 - 4 }` - 6 : number ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -224,7 +224,7 @@ var f4 = `2${ 3 - 4 }` - 6; var g4 = `${ 3 - 4 }5` - 6; >g4 : number >`${ 3 - 4 }5` - 6 : number ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -233,7 +233,7 @@ var g4 = `${ 3 - 4 }5` - 6; var h4 = `2${ 3 - 4 }5` - 6; >h4 : number >`2${ 3 - 4 }5` - 6 : number ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -243,7 +243,7 @@ var a5 = 1 - `${ 3 * 4 }`; >a5 : number >1 - `${ 3 * 4 }` : number >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -252,7 +252,7 @@ var b5 = 1 - `2${ 3 * 4 }`; >b5 : number >1 - `2${ 3 * 4 }` : number >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -261,7 +261,7 @@ var c5 = 1 - `${ 3 * 4 }5`; >c5 : number >1 - `${ 3 * 4 }5` : number >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -270,7 +270,7 @@ var d5 = 1 - `2${ 3 * 4 }5`; >d5 : number >1 - `2${ 3 * 4 }5` : number >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -278,7 +278,7 @@ var d5 = 1 - `2${ 3 * 4 }5`; var e5 = `${ 3 * 4 }` - 6; >e5 : number >`${ 3 * 4 }` - 6 : number ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -287,7 +287,7 @@ var e5 = `${ 3 * 4 }` - 6; var f5 = `2${ 3 * 4 }` - 6; >f5 : number >`2${ 3 * 4 }` - 6 : number ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -296,7 +296,7 @@ var f5 = `2${ 3 * 4 }` - 6; var g5 = `${ 3 * 4 }5` - 6; >g5 : number >`${ 3 * 4 }5` - 6 : number ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -305,7 +305,7 @@ var g5 = `${ 3 * 4 }5` - 6; var h5 = `2${ 3 * 4 }5` - 6; >h5 : number >`2${ 3 * 4 }5` - 6 : number ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -315,7 +315,7 @@ var a6 = 1 - `${ 3 & 4 }`; >a6 : number >1 - `${ 3 & 4 }` : number >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -324,7 +324,7 @@ var b6 = 1 - `2${ 3 & 4 }`; >b6 : number >1 - `2${ 3 & 4 }` : number >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -333,7 +333,7 @@ var c6 = 1 - `${ 3 & 4 }5`; >c6 : number >1 - `${ 3 & 4 }5` : number >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -342,7 +342,7 @@ var d6 = 1 - `2${ 3 & 4 }5`; >d6 : number >1 - `2${ 3 & 4 }5` : number >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -350,7 +350,7 @@ var d6 = 1 - `2${ 3 & 4 }5`; var e6 = `${ 3 & 4 }` - 6; >e6 : number >`${ 3 & 4 }` - 6 : number ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -359,7 +359,7 @@ var e6 = `${ 3 & 4 }` - 6; var f6 = `2${ 3 & 4 }` - 6; >f6 : number >`2${ 3 & 4 }` - 6 : number ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -368,7 +368,7 @@ var f6 = `2${ 3 & 4 }` - 6; var g6 = `${ 3 & 4 }5` - 6; >g6 : number >`${ 3 & 4 }5` - 6 : number ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -377,7 +377,7 @@ var g6 = `${ 3 & 4 }5` - 6; var h6 = `2${ 3 & 4 }5` - 6; >h6 : number >`2${ 3 & 4 }5` - 6 : number ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -387,7 +387,7 @@ var a7 = 1 * `${ 3 - 4 }`; >a7 : number >1 * `${ 3 - 4 }` : number >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -396,7 +396,7 @@ var b7 = 1 * `2${ 3 - 4 }`; >b7 : number >1 * `2${ 3 - 4 }` : number >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -405,7 +405,7 @@ var c7 = 1 * `${ 3 - 4 }5`; >c7 : number >1 * `${ 3 - 4 }5` : number >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -414,7 +414,7 @@ var d7 = 1 * `2${ 3 - 4 }5`; >d7 : number >1 * `2${ 3 - 4 }5` : number >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -422,7 +422,7 @@ var d7 = 1 * `2${ 3 - 4 }5`; var e7 = `${ 3 - 4 }` * 6; >e7 : number >`${ 3 - 4 }` * 6 : number ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -431,7 +431,7 @@ var e7 = `${ 3 - 4 }` * 6; var f7 = `2${ 3 - 4 }` * 6; >f7 : number >`2${ 3 - 4 }` * 6 : number ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -440,7 +440,7 @@ var f7 = `2${ 3 - 4 }` * 6; var g7 = `${ 3 - 4 }5` * 6; >g7 : number >`${ 3 - 4 }5` * 6 : number ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -449,7 +449,7 @@ var g7 = `${ 3 - 4 }5` * 6; var h7 = `2${ 3 - 4 }5` * 6; >h7 : number >`2${ 3 - 4 }5` * 6 : number ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -459,7 +459,7 @@ var a8 = 1 * `${ 3 * 4 }`; >a8 : number >1 * `${ 3 * 4 }` : number >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -468,7 +468,7 @@ var b8 = 1 * `2${ 3 * 4 }`; >b8 : number >1 * `2${ 3 * 4 }` : number >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -477,7 +477,7 @@ var c8 = 1 * `${ 3 * 4 }5`; >c8 : number >1 * `${ 3 * 4 }5` : number >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -486,7 +486,7 @@ var d8 = 1 * `2${ 3 * 4 }5`; >d8 : number >1 * `2${ 3 * 4 }5` : number >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -494,7 +494,7 @@ var d8 = 1 * `2${ 3 * 4 }5`; var e8 = `${ 3 * 4 }` * 6; >e8 : number >`${ 3 * 4 }` * 6 : number ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -503,7 +503,7 @@ var e8 = `${ 3 * 4 }` * 6; var f8 = `2${ 3 * 4 }` * 6; >f8 : number >`2${ 3 * 4 }` * 6 : number ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -512,7 +512,7 @@ var f8 = `2${ 3 * 4 }` * 6; var g8 = `${ 3 * 4 }5` * 6; >g8 : number >`${ 3 * 4 }5` * 6 : number ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -521,7 +521,7 @@ var g8 = `${ 3 * 4 }5` * 6; var h8 = `2${ 3 * 4 }5` * 6; >h8 : number >`2${ 3 * 4 }5` * 6 : number ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -531,7 +531,7 @@ var a9 = 1 * `${ 3 & 4 }`; >a9 : number >1 * `${ 3 & 4 }` : number >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -540,7 +540,7 @@ var b9 = 1 * `2${ 3 & 4 }`; >b9 : number >1 * `2${ 3 & 4 }` : number >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -549,7 +549,7 @@ var c9 = 1 * `${ 3 & 4 }5`; >c9 : number >1 * `${ 3 & 4 }5` : number >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -558,7 +558,7 @@ var d9 = 1 * `2${ 3 & 4 }5`; >d9 : number >1 * `2${ 3 & 4 }5` : number >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -566,7 +566,7 @@ var d9 = 1 * `2${ 3 & 4 }5`; var e9 = `${ 3 & 4 }` * 6; >e9 : number >`${ 3 & 4 }` * 6 : number ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -575,7 +575,7 @@ var e9 = `${ 3 & 4 }` * 6; var f9 = `2${ 3 & 4 }` * 6; >f9 : number >`2${ 3 & 4 }` * 6 : number ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -584,7 +584,7 @@ var f9 = `2${ 3 & 4 }` * 6; var g9 = `${ 3 & 4 }5` * 6; >g9 : number >`${ 3 & 4 }5` * 6 : number ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -593,7 +593,7 @@ var g9 = `${ 3 & 4 }5` * 6; var h9 = `2${ 3 & 4 }5` * 6; >h9 : number >`2${ 3 & 4 }5` * 6 : number ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -603,7 +603,7 @@ var aa = 1 & `${ 3 - 4 }`; >aa : number >1 & `${ 3 - 4 }` : number >1 : 1 ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -612,7 +612,7 @@ var ba = 1 & `2${ 3 - 4 }`; >ba : number >1 & `2${ 3 - 4 }` : number >1 : 1 ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -621,7 +621,7 @@ var ca = 1 & `${ 3 - 4 }5`; >ca : number >1 & `${ 3 - 4 }5` : number >1 : 1 ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -630,7 +630,7 @@ var da = 1 & `2${ 3 - 4 }5`; >da : number >1 & `2${ 3 - 4 }5` : number >1 : 1 ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -638,7 +638,7 @@ var da = 1 & `2${ 3 - 4 }5`; var ea = `${ 3 - 4 }` & 6; >ea : number >`${ 3 - 4 }` & 6 : number ->`${ 3 - 4 }` : string +>`${ 3 - 4 }` : `${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -647,7 +647,7 @@ var ea = `${ 3 - 4 }` & 6; var fa = `2${ 3 - 4 }` & 6; >fa : number >`2${ 3 - 4 }` & 6 : number ->`2${ 3 - 4 }` : string +>`2${ 3 - 4 }` : `2${number}` >3 - 4 : number >3 : 3 >4 : 4 @@ -656,7 +656,7 @@ var fa = `2${ 3 - 4 }` & 6; var ga = `${ 3 - 4 }5` & 6; >ga : number >`${ 3 - 4 }5` & 6 : number ->`${ 3 - 4 }5` : string +>`${ 3 - 4 }5` : `${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -665,7 +665,7 @@ var ga = `${ 3 - 4 }5` & 6; var ha = `2${ 3 - 4 }5` & 6; >ha : number >`2${ 3 - 4 }5` & 6 : number ->`2${ 3 - 4 }5` : string +>`2${ 3 - 4 }5` : `2${number}5` >3 - 4 : number >3 : 3 >4 : 4 @@ -675,7 +675,7 @@ var ab = 1 & `${ 3 * 4 }`; >ab : number >1 & `${ 3 * 4 }` : number >1 : 1 ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -684,7 +684,7 @@ var bb = 1 & `2${ 3 * 4 }`; >bb : number >1 & `2${ 3 * 4 }` : number >1 : 1 ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -693,7 +693,7 @@ var cb = 1 & `${ 3 * 4 }5`; >cb : number >1 & `${ 3 * 4 }5` : number >1 : 1 ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -702,7 +702,7 @@ var db = 1 & `2${ 3 * 4 }5`; >db : number >1 & `2${ 3 * 4 }5` : number >1 : 1 ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -710,7 +710,7 @@ var db = 1 & `2${ 3 * 4 }5`; var eb = `${ 3 * 4 }` & 6; >eb : number >`${ 3 * 4 }` & 6 : number ->`${ 3 * 4 }` : string +>`${ 3 * 4 }` : `${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -719,7 +719,7 @@ var eb = `${ 3 * 4 }` & 6; var fb = `2${ 3 * 4 }` & 6; >fb : number >`2${ 3 * 4 }` & 6 : number ->`2${ 3 * 4 }` : string +>`2${ 3 * 4 }` : `2${number}` >3 * 4 : number >3 : 3 >4 : 4 @@ -728,7 +728,7 @@ var fb = `2${ 3 * 4 }` & 6; var gb = `${ 3 * 4 }5` & 6; >gb : number >`${ 3 * 4 }5` & 6 : number ->`${ 3 * 4 }5` : string +>`${ 3 * 4 }5` : `${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -737,7 +737,7 @@ var gb = `${ 3 * 4 }5` & 6; var hb = `2${ 3 * 4 }5` & 6; >hb : number >`2${ 3 * 4 }5` & 6 : number ->`2${ 3 * 4 }5` : string +>`2${ 3 * 4 }5` : `2${number}5` >3 * 4 : number >3 : 3 >4 : 4 @@ -747,7 +747,7 @@ var ac = 1 & `${ 3 & 4 }`; >ac : number >1 & `${ 3 & 4 }` : number >1 : 1 ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -756,7 +756,7 @@ var bc = 1 & `2${ 3 & 4 }`; >bc : number >1 & `2${ 3 & 4 }` : number >1 : 1 ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -765,7 +765,7 @@ var cc = 1 & `${ 3 & 4 }5`; >cc : number >1 & `${ 3 & 4 }5` : number >1 : 1 ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -774,7 +774,7 @@ var dc = 1 & `2${ 3 & 4 }5`; >dc : number >1 & `2${ 3 & 4 }5` : number >1 : 1 ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -782,7 +782,7 @@ var dc = 1 & `2${ 3 & 4 }5`; var ec = `${ 3 & 4 }` & 6; >ec : number >`${ 3 & 4 }` & 6 : number ->`${ 3 & 4 }` : string +>`${ 3 & 4 }` : `${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -791,7 +791,7 @@ var ec = `${ 3 & 4 }` & 6; var fc = `2${ 3 & 4 }` & 6; >fc : number >`2${ 3 & 4 }` & 6 : number ->`2${ 3 & 4 }` : string +>`2${ 3 & 4 }` : `2${number}` >3 & 4 : number >3 : 3 >4 : 4 @@ -800,7 +800,7 @@ var fc = `2${ 3 & 4 }` & 6; var gc = `${ 3 & 4 }5` & 6; >gc : number >`${ 3 & 4 }5` & 6 : number ->`${ 3 & 4 }5` : string +>`${ 3 & 4 }5` : `${number}5` >3 & 4 : number >3 : 3 >4 : 4 @@ -809,7 +809,7 @@ var gc = `${ 3 & 4 }5` & 6; var hc = `2${ 3 & 4 }5` & 6; >hc : number >`2${ 3 & 4 }5` & 6 : number ->`2${ 3 & 4 }5` : string +>`2${ 3 & 4 }5` : `2${number}5` >3 & 4 : number >3 : 3 >4 : 4 diff --git a/tests/baselines/reference/templateStringInArray.types b/tests/baselines/reference/templateStringInArray.types index 03271a5dcd7c0..220b0b923d1f6 100644 --- a/tests/baselines/reference/templateStringInArray.types +++ b/tests/baselines/reference/templateStringInArray.types @@ -4,6 +4,6 @@ var x = [1, 2, `abc${ 123 }def`]; >[1, 2, `abc${ 123 }def`] : (string | number)[] >1 : 1 >2 : 2 ->`abc${ 123 }def` : string +>`abc${ 123 }def` : "abc123def" >123 : 123 diff --git a/tests/baselines/reference/templateStringInArrowFunction.types b/tests/baselines/reference/templateStringInArrowFunction.types index a059e440d5a84..326e20d62255f 100644 --- a/tests/baselines/reference/templateStringInArrowFunction.types +++ b/tests/baselines/reference/templateStringInArrowFunction.types @@ -1,8 +1,8 @@ === tests/cases/conformance/es6/templates/templateStringInArrowFunction.ts === var x = x => `abc${ x }def`; ->x : (x: any) => string ->x => `abc${ x }def` : (x: any) => string +>x : (x: any) => `abc${any}def` +>x => `abc${ x }def` : (x: any) => `abc${any}def` >x : any ->`abc${ x }def` : string +>`abc${ x }def` : `abc${any}def` >x : any diff --git a/tests/baselines/reference/templateStringInArrowFunctionES6.types b/tests/baselines/reference/templateStringInArrowFunctionES6.types index 72611067793df..67b82c570f05a 100644 --- a/tests/baselines/reference/templateStringInArrowFunctionES6.types +++ b/tests/baselines/reference/templateStringInArrowFunctionES6.types @@ -1,8 +1,8 @@ === tests/cases/conformance/es6/templates/templateStringInArrowFunctionES6.ts === var x = x => `abc${ x }def`; ->x : (x: any) => string ->x => `abc${ x }def` : (x: any) => string +>x : (x: any) => `abc${any}def` +>x => `abc${ x }def` : (x: any) => `abc${any}def` >x : any ->`abc${ x }def` : string +>`abc${ x }def` : `abc${any}def` >x : any diff --git a/tests/baselines/reference/templateStringInCallExpression.types b/tests/baselines/reference/templateStringInCallExpression.types index ef1bcca2fa4da..4f77d60947ef5 100644 --- a/tests/baselines/reference/templateStringInCallExpression.types +++ b/tests/baselines/reference/templateStringInCallExpression.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/templates/templateStringInCallExpression.ts === `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); >`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`) : any ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 ->`hello ${0} world` : string +>`hello ${0} world` : "hello 0 world" >0 : 0 >` ` : " " ->`1${2}3` : string +>`1${2}3` : "123" >2 : 2 diff --git a/tests/baselines/reference/templateStringInCallExpressionES6.types b/tests/baselines/reference/templateStringInCallExpressionES6.types index f0c75c7828db5..6878494406edf 100644 --- a/tests/baselines/reference/templateStringInCallExpressionES6.types +++ b/tests/baselines/reference/templateStringInCallExpressionES6.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/templates/templateStringInCallExpressionES6.ts === `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); >`abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`) : any ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 ->`hello ${0} world` : string +>`hello ${0} world` : "hello 0 world" >0 : 0 >` ` : " " ->`1${2}3` : string +>`1${2}3` : "123" >2 : 2 diff --git a/tests/baselines/reference/templateStringInConditional.types b/tests/baselines/reference/templateStringInConditional.types index a375d572a5df1..07419cc1e8913 100644 --- a/tests/baselines/reference/templateStringInConditional.types +++ b/tests/baselines/reference/templateStringInConditional.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/templates/templateStringInConditional.ts === var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; >x : string ->`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : string ->`abc${ " " }def` : string +>`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : "abc def" +>`abc${ " " }def` : "abc def" >" " : " " ->`abc${ " " }def` : string +>`abc${ " " }def` : "abc def" >" " : " " ->`abc${ " " }def` : string +>`abc${ " " }def` : "abc def" >" " : " " diff --git a/tests/baselines/reference/templateStringInConditionalES6.types b/tests/baselines/reference/templateStringInConditionalES6.types index 0f65ab2297743..25a00f77091b3 100644 --- a/tests/baselines/reference/templateStringInConditionalES6.types +++ b/tests/baselines/reference/templateStringInConditionalES6.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/templates/templateStringInConditionalES6.ts === var x = `abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def`; >x : string ->`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : string ->`abc${ " " }def` : string +>`abc${ " " }def` ? `abc${ " " }def` : `abc${ " " }def` : "abc def" +>`abc${ " " }def` : "abc def" >" " : " " ->`abc${ " " }def` : string +>`abc${ " " }def` : "abc def" >" " : " " ->`abc${ " " }def` : string +>`abc${ " " }def` : "abc def" >" " : " " diff --git a/tests/baselines/reference/templateStringInDeleteExpression.types b/tests/baselines/reference/templateStringInDeleteExpression.types index 1ae84e4e2ff53..5abeb123965d6 100644 --- a/tests/baselines/reference/templateStringInDeleteExpression.types +++ b/tests/baselines/reference/templateStringInDeleteExpression.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringInDeleteExpression.ts === delete `abc${0}abc`; >delete `abc${0}abc` : boolean ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 diff --git a/tests/baselines/reference/templateStringInDeleteExpressionES6.types b/tests/baselines/reference/templateStringInDeleteExpressionES6.types index 80569e533e42b..e3ed5d4fd47dd 100644 --- a/tests/baselines/reference/templateStringInDeleteExpressionES6.types +++ b/tests/baselines/reference/templateStringInDeleteExpressionES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringInDeleteExpressionES6.ts === delete `abc${0}abc`; >delete `abc${0}abc` : boolean ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 diff --git a/tests/baselines/reference/templateStringInDivision.types b/tests/baselines/reference/templateStringInDivision.types index 1afbd71fda1b4..b6d2a45c4b38e 100644 --- a/tests/baselines/reference/templateStringInDivision.types +++ b/tests/baselines/reference/templateStringInDivision.types @@ -2,7 +2,7 @@ var x = `abc${ 1 }def` / 1; >x : number >`abc${ 1 }def` / 1 : number ->`abc${ 1 }def` : string +>`abc${ 1 }def` : "abc1def" >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/templateStringInEqualityChecks.errors.txt b/tests/baselines/reference/templateStringInEqualityChecks.errors.txt new file mode 100644 index 0000000000000..6d765999b43d4 --- /dev/null +++ b/tests/baselines/reference/templateStringInEqualityChecks.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/templates/templateStringInEqualityChecks.ts(1,9): error TS2367: This condition will always return 'false' since the types '"abc0abc"' and '"abc"' have no overlap. +tests/cases/conformance/es6/templates/templateStringInEqualityChecks.ts(2,9): error TS2367: This condition will always return 'true' since the types '"abc"' and '"abc0abc"' have no overlap. + + +==== tests/cases/conformance/es6/templates/templateStringInEqualityChecks.ts (2 errors) ==== + var x = `abc${0}abc` === `abc` || + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2367: This condition will always return 'false' since the types '"abc0abc"' and '"abc"' have no overlap. + `abc` !== `abc${0}abc` && + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2367: This condition will always return 'true' since the types '"abc"' and '"abc0abc"' have no overlap. + `abc${0}abc` == "abc0abc" && + "abc0abc" !== `abc${0}abc`; \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInEqualityChecks.types b/tests/baselines/reference/templateStringInEqualityChecks.types index cddc533a23947..3cf7469e28dcd 100644 --- a/tests/baselines/reference/templateStringInEqualityChecks.types +++ b/tests/baselines/reference/templateStringInEqualityChecks.types @@ -3,7 +3,7 @@ var x = `abc${0}abc` === `abc` || >x : boolean >`abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean >`abc${0}abc` === `abc` : boolean ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 >`abc` : "abc" @@ -12,18 +12,18 @@ var x = `abc${0}abc` === `abc` || >`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" : boolean >`abc` !== `abc${0}abc` : boolean >`abc` : "abc" ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 `abc${0}abc` == "abc0abc" && >`abc${0}abc` == "abc0abc" : boolean ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 >"abc0abc" : "abc0abc" "abc0abc" !== `abc${0}abc`; >"abc0abc" !== `abc${0}abc` : boolean >"abc0abc" : "abc0abc" ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 diff --git a/tests/baselines/reference/templateStringInEqualityChecksES6.errors.txt b/tests/baselines/reference/templateStringInEqualityChecksES6.errors.txt new file mode 100644 index 0000000000000..095914c97be00 --- /dev/null +++ b/tests/baselines/reference/templateStringInEqualityChecksES6.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/es6/templates/templateStringInEqualityChecksES6.ts(1,9): error TS2367: This condition will always return 'false' since the types '"abc0abc"' and '"abc"' have no overlap. +tests/cases/conformance/es6/templates/templateStringInEqualityChecksES6.ts(2,9): error TS2367: This condition will always return 'true' since the types '"abc"' and '"abc0abc"' have no overlap. + + +==== tests/cases/conformance/es6/templates/templateStringInEqualityChecksES6.ts (2 errors) ==== + var x = `abc${0}abc` === `abc` || + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2367: This condition will always return 'false' since the types '"abc0abc"' and '"abc"' have no overlap. + `abc` !== `abc${0}abc` && + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2367: This condition will always return 'true' since the types '"abc"' and '"abc0abc"' have no overlap. + `abc${0}abc` == "abc0abc" && + "abc0abc" !== `abc${0}abc`; \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInEqualityChecksES6.types b/tests/baselines/reference/templateStringInEqualityChecksES6.types index 58a243007256e..f67cb61cbcaff 100644 --- a/tests/baselines/reference/templateStringInEqualityChecksES6.types +++ b/tests/baselines/reference/templateStringInEqualityChecksES6.types @@ -3,7 +3,7 @@ var x = `abc${0}abc` === `abc` || >x : boolean >`abc${0}abc` === `abc` || `abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" && "abc0abc" !== `abc${0}abc` : boolean >`abc${0}abc` === `abc` : boolean ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 >`abc` : "abc" @@ -12,18 +12,18 @@ var x = `abc${0}abc` === `abc` || >`abc` !== `abc${0}abc` && `abc${0}abc` == "abc0abc" : boolean >`abc` !== `abc${0}abc` : boolean >`abc` : "abc" ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 `abc${0}abc` == "abc0abc" && >`abc${0}abc` == "abc0abc" : boolean ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 >"abc0abc" : "abc0abc" "abc0abc" !== `abc${0}abc`; >"abc0abc" !== `abc${0}abc` : boolean >"abc0abc" : "abc0abc" ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 diff --git a/tests/baselines/reference/templateStringInFunctionExpression.types b/tests/baselines/reference/templateStringInFunctionExpression.types index af92d867acd70..7c32e1e5858cb 100644 --- a/tests/baselines/reference/templateStringInFunctionExpression.types +++ b/tests/baselines/reference/templateStringInFunctionExpression.types @@ -5,11 +5,11 @@ var x = function y() { >y : () => string `abc${ 0 }def` ->`abc${ 0 }def` : string +>`abc${ 0 }def` : "abc0def" >0 : 0 return `abc${ 0 }def`; ->`abc${ 0 }def` : string +>`abc${ 0 }def` : "abc0def" >0 : 0 }; diff --git a/tests/baselines/reference/templateStringInFunctionExpressionES6.types b/tests/baselines/reference/templateStringInFunctionExpressionES6.types index 2ab90b9e37404..e7a310a7f0607 100644 --- a/tests/baselines/reference/templateStringInFunctionExpressionES6.types +++ b/tests/baselines/reference/templateStringInFunctionExpressionES6.types @@ -5,11 +5,11 @@ var x = function y() { >y : () => string `abc${ 0 }def` ->`abc${ 0 }def` : string +>`abc${ 0 }def` : "abc0def" >0 : 0 return `abc${ 0 }def`; ->`abc${ 0 }def` : string +>`abc${ 0 }def` : "abc0def" >0 : 0 }; diff --git a/tests/baselines/reference/templateStringInInOperator.types b/tests/baselines/reference/templateStringInInOperator.types index 5ed944af49626..2c00b2f40a1e3 100644 --- a/tests/baselines/reference/templateStringInInOperator.types +++ b/tests/baselines/reference/templateStringInInOperator.types @@ -2,7 +2,7 @@ var x = `${ "hi" }` in { hi: 10, hello: 20}; >x : boolean >`${ "hi" }` in { hi: 10, hello: 20} : boolean ->`${ "hi" }` : string +>`${ "hi" }` : "hi" >"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number diff --git a/tests/baselines/reference/templateStringInInOperatorES6.types b/tests/baselines/reference/templateStringInInOperatorES6.types index 335b77380c2ad..c78a128a28f3c 100644 --- a/tests/baselines/reference/templateStringInInOperatorES6.types +++ b/tests/baselines/reference/templateStringInInOperatorES6.types @@ -2,7 +2,7 @@ var x = `${ "hi" }` in { hi: 10, hello: 20}; >x : boolean >`${ "hi" }` in { hi: 10, hello: 20} : boolean ->`${ "hi" }` : string +>`${ "hi" }` : "hi" >"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } >hi : number diff --git a/tests/baselines/reference/templateStringInIndexExpression.types b/tests/baselines/reference/templateStringInIndexExpression.types index 9ad6b1e141db0..5d05878b17cf7 100644 --- a/tests/baselines/reference/templateStringInIndexExpression.types +++ b/tests/baselines/reference/templateStringInIndexExpression.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringInIndexExpression.ts === `abc${0}abc`[`0`]; >`abc${0}abc`[`0`] : error ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 >`0` : "0" diff --git a/tests/baselines/reference/templateStringInIndexExpressionES6.types b/tests/baselines/reference/templateStringInIndexExpressionES6.types index d86fb2309e72b..aef018ff0f927 100644 --- a/tests/baselines/reference/templateStringInIndexExpressionES6.types +++ b/tests/baselines/reference/templateStringInIndexExpressionES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringInIndexExpressionES6.ts === `abc${0}abc`[`0`]; >`abc${0}abc`[`0`] : error ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 >`0` : "0" diff --git a/tests/baselines/reference/templateStringInInstanceOf.types b/tests/baselines/reference/templateStringInInstanceOf.types index 244d008da5252..a551448dd38e9 100644 --- a/tests/baselines/reference/templateStringInInstanceOf.types +++ b/tests/baselines/reference/templateStringInInstanceOf.types @@ -2,7 +2,7 @@ var x = `abc${ 0 }def` instanceof String; >x : boolean >`abc${ 0 }def` instanceof String : boolean ->`abc${ 0 }def` : string +>`abc${ 0 }def` : "abc0def" >0 : 0 >String : StringConstructor diff --git a/tests/baselines/reference/templateStringInInstanceOfES6.types b/tests/baselines/reference/templateStringInInstanceOfES6.types index c93393def3831..396c6da8e9d0c 100644 --- a/tests/baselines/reference/templateStringInInstanceOfES6.types +++ b/tests/baselines/reference/templateStringInInstanceOfES6.types @@ -2,7 +2,7 @@ var x = `abc${ 0 }def` instanceof String; >x : boolean >`abc${ 0 }def` instanceof String : boolean ->`abc${ 0 }def` : string +>`abc${ 0 }def` : "abc0def" >0 : 0 >String : StringConstructor diff --git a/tests/baselines/reference/templateStringInModuleName.types b/tests/baselines/reference/templateStringInModuleName.types index 8ebf16e05d2f8..9258b48d4dd34 100644 --- a/tests/baselines/reference/templateStringInModuleName.types +++ b/tests/baselines/reference/templateStringInModuleName.types @@ -10,6 +10,6 @@ declare module `M${2}` { >declare : any >module `M${2}` : any >module : any ->`M${2}` : string +>`M${2}` : "M2" >2 : 2 } diff --git a/tests/baselines/reference/templateStringInModuleNameES6.types b/tests/baselines/reference/templateStringInModuleNameES6.types index 9e7aaafd9ea93..0efaf18adfbab 100644 --- a/tests/baselines/reference/templateStringInModuleNameES6.types +++ b/tests/baselines/reference/templateStringInModuleNameES6.types @@ -10,6 +10,6 @@ declare module `M${2}` { >declare : any >module `M${2}` : any >module : any ->`M${2}` : string +>`M${2}` : "M2" >2 : 2 } diff --git a/tests/baselines/reference/templateStringInModulo.types b/tests/baselines/reference/templateStringInModulo.types index c348299718224..77413a081d2fc 100644 --- a/tests/baselines/reference/templateStringInModulo.types +++ b/tests/baselines/reference/templateStringInModulo.types @@ -3,6 +3,6 @@ var x = 1 % `abc${ 1 }def`; >x : number >1 % `abc${ 1 }def` : number >1 : 1 ->`abc${ 1 }def` : string +>`abc${ 1 }def` : "abc1def" >1 : 1 diff --git a/tests/baselines/reference/templateStringInModuloES6.types b/tests/baselines/reference/templateStringInModuloES6.types index 8d515d3f4444b..a4052ee2acd0d 100644 --- a/tests/baselines/reference/templateStringInModuloES6.types +++ b/tests/baselines/reference/templateStringInModuloES6.types @@ -3,6 +3,6 @@ var x = 1 % `abc${ 1 }def`; >x : number >1 % `abc${ 1 }def` : number >1 : 1 ->`abc${ 1 }def` : string +>`abc${ 1 }def` : "abc1def" >1 : 1 diff --git a/tests/baselines/reference/templateStringInMultiplication.types b/tests/baselines/reference/templateStringInMultiplication.types index 133330698e55e..3cc2aaa075afd 100644 --- a/tests/baselines/reference/templateStringInMultiplication.types +++ b/tests/baselines/reference/templateStringInMultiplication.types @@ -3,6 +3,6 @@ var x = 1 * `abc${ 1 }def`; >x : number >1 * `abc${ 1 }def` : number >1 : 1 ->`abc${ 1 }def` : string +>`abc${ 1 }def` : "abc1def" >1 : 1 diff --git a/tests/baselines/reference/templateStringInMultiplicationES6.types b/tests/baselines/reference/templateStringInMultiplicationES6.types index 7bc4663bfc5d4..2e4513a2c054d 100644 --- a/tests/baselines/reference/templateStringInMultiplicationES6.types +++ b/tests/baselines/reference/templateStringInMultiplicationES6.types @@ -3,6 +3,6 @@ var x = 1 * `abc${ 1 }def`; >x : number >1 * `abc${ 1 }def` : number >1 : 1 ->`abc${ 1 }def` : string +>`abc${ 1 }def` : "abc1def" >1 : 1 diff --git a/tests/baselines/reference/templateStringInNewExpression.types b/tests/baselines/reference/templateStringInNewExpression.types index c4bc213db14b9..1c58cec14d9ff 100644 --- a/tests/baselines/reference/templateStringInNewExpression.types +++ b/tests/baselines/reference/templateStringInNewExpression.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/templates/templateStringInNewExpression.ts === new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); >new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`) : any ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 ->`hello ${0} world` : string +>`hello ${0} world` : "hello 0 world" >0 : 0 >` ` : " " ->`1${2}3` : string +>`1${2}3` : "123" >2 : 2 diff --git a/tests/baselines/reference/templateStringInNewExpressionES6.types b/tests/baselines/reference/templateStringInNewExpressionES6.types index 284f59bab1d12..ef18f9a3b748e 100644 --- a/tests/baselines/reference/templateStringInNewExpressionES6.types +++ b/tests/baselines/reference/templateStringInNewExpressionES6.types @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/templates/templateStringInNewExpressionES6.ts === new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`); >new `abc${0}abc`(`hello ${0} world`, ` `, `1${2}3`) : any ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 ->`hello ${0} world` : string +>`hello ${0} world` : "hello 0 world" >0 : 0 >` ` : " " ->`1${2}3` : string +>`1${2}3` : "123" >2 : 2 diff --git a/tests/baselines/reference/templateStringInNewOperator.types b/tests/baselines/reference/templateStringInNewOperator.types index c3853ed431e6c..e35f6d8fa03a2 100644 --- a/tests/baselines/reference/templateStringInNewOperator.types +++ b/tests/baselines/reference/templateStringInNewOperator.types @@ -2,6 +2,6 @@ var x = new `abc${ 1 }def`; >x : any >new `abc${ 1 }def` : any ->`abc${ 1 }def` : string +>`abc${ 1 }def` : "abc1def" >1 : 1 diff --git a/tests/baselines/reference/templateStringInNewOperatorES6.types b/tests/baselines/reference/templateStringInNewOperatorES6.types index ff6a9dbfb2924..fccea6b14c983 100644 --- a/tests/baselines/reference/templateStringInNewOperatorES6.types +++ b/tests/baselines/reference/templateStringInNewOperatorES6.types @@ -2,6 +2,6 @@ var x = new `abc${ 1 }def`; >x : any >new `abc${ 1 }def` : any ->`abc${ 1 }def` : string +>`abc${ 1 }def` : "abc1def" >1 : 1 diff --git a/tests/baselines/reference/templateStringInObjectLiteral.types b/tests/baselines/reference/templateStringInObjectLiteral.types index e0ebb07e8b9e1..c796962283c3f 100644 --- a/tests/baselines/reference/templateStringInObjectLiteral.types +++ b/tests/baselines/reference/templateStringInObjectLiteral.types @@ -6,7 +6,7 @@ var x = { a: `abc${ 123 }def`, >a : string ->`abc${ 123 }def` : string +>`abc${ 123 }def` : "abc123def" >123 : 123 `b`: 321 diff --git a/tests/baselines/reference/templateStringInObjectLiteralES6.types b/tests/baselines/reference/templateStringInObjectLiteralES6.types index 30797e78c6b76..ae46359177bda 100644 --- a/tests/baselines/reference/templateStringInObjectLiteralES6.types +++ b/tests/baselines/reference/templateStringInObjectLiteralES6.types @@ -6,7 +6,7 @@ var x = { a: `abc${ 123 }def`, >a : string ->`abc${ 123 }def` : string +>`abc${ 123 }def` : "abc123def" >123 : 123 `b`: 321 diff --git a/tests/baselines/reference/templateStringInParentheses.types b/tests/baselines/reference/templateStringInParentheses.types index ca9b328d5b5a1..c69dce0b49e73 100644 --- a/tests/baselines/reference/templateStringInParentheses.types +++ b/tests/baselines/reference/templateStringInParentheses.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringInParentheses.ts === var x = (`abc${0}abc`); >x : string ->(`abc${0}abc`) : string ->`abc${0}abc` : string +>(`abc${0}abc`) : "abc0abc" +>`abc${0}abc` : "abc0abc" >0 : 0 diff --git a/tests/baselines/reference/templateStringInParenthesesES6.types b/tests/baselines/reference/templateStringInParenthesesES6.types index 518ad88091865..5b0986aee052c 100644 --- a/tests/baselines/reference/templateStringInParenthesesES6.types +++ b/tests/baselines/reference/templateStringInParenthesesES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringInParenthesesES6.ts === var x = (`abc${0}abc`); >x : string ->(`abc${0}abc`) : string ->`abc${0}abc` : string +>(`abc${0}abc`) : "abc0abc" +>`abc${0}abc` : "abc0abc" >0 : 0 diff --git a/tests/baselines/reference/templateStringInPropertyAssignment.types b/tests/baselines/reference/templateStringInPropertyAssignment.types index c47a921e94117..6850229d1ef16 100644 --- a/tests/baselines/reference/templateStringInPropertyAssignment.types +++ b/tests/baselines/reference/templateStringInPropertyAssignment.types @@ -5,7 +5,7 @@ var x = { a: `abc${ 123 }def${ 456 }ghi` >a : string ->`abc${ 123 }def${ 456 }ghi` : string +>`abc${ 123 }def${ 456 }ghi` : "abc123def456ghi" >123 : 123 >456 : 456 } diff --git a/tests/baselines/reference/templateStringInPropertyAssignmentES6.types b/tests/baselines/reference/templateStringInPropertyAssignmentES6.types index 43a9e0f5507ff..a0dafd6663899 100644 --- a/tests/baselines/reference/templateStringInPropertyAssignmentES6.types +++ b/tests/baselines/reference/templateStringInPropertyAssignmentES6.types @@ -5,7 +5,7 @@ var x = { a: `abc${ 123 }def${ 456 }ghi` >a : string ->`abc${ 123 }def${ 456 }ghi` : string +>`abc${ 123 }def${ 456 }ghi` : "abc123def456ghi" >123 : 123 >456 : 456 } diff --git a/tests/baselines/reference/templateStringInPropertyName2.types b/tests/baselines/reference/templateStringInPropertyName2.types index 627abc040c022..5e3652e3e9ae2 100644 --- a/tests/baselines/reference/templateStringInPropertyName2.types +++ b/tests/baselines/reference/templateStringInPropertyName2.types @@ -5,7 +5,7 @@ var x = { >{ : {} `abc${ 123 }def${ 456 }ghi`: 321 ->`abc${ 123 }def${ 456 }ghi` : string +>`abc${ 123 }def${ 456 }ghi` : "abc123def456ghi" >123 : 123 >456 : 456 >321 : 321 diff --git a/tests/baselines/reference/templateStringInPropertyNameES6_2.types b/tests/baselines/reference/templateStringInPropertyNameES6_2.types index ff96d8155db6a..92868155b71ac 100644 --- a/tests/baselines/reference/templateStringInPropertyNameES6_2.types +++ b/tests/baselines/reference/templateStringInPropertyNameES6_2.types @@ -5,7 +5,7 @@ var x = { >{ : {} `abc${ 123 }def${ 456 }ghi`: 321 ->`abc${ 123 }def${ 456 }ghi` : string +>`abc${ 123 }def${ 456 }ghi` : "abc123def456ghi" >123 : 123 >456 : 456 >321 : 321 diff --git a/tests/baselines/reference/templateStringInSwitchAndCase.errors.txt b/tests/baselines/reference/templateStringInSwitchAndCase.errors.txt new file mode 100644 index 0000000000000..5c7ea1e95376d --- /dev/null +++ b/tests/baselines/reference/templateStringInSwitchAndCase.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts(2,10): error TS2678: Type '"abc"' is not comparable to type '"abc0abc"'. +tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts(3,10): error TS2678: Type '"123"' is not comparable to type '"abc0abc"'. + + +==== tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts (2 errors) ==== + switch (`abc${0}abc`) { + case `abc`: + ~~~~~ +!!! error TS2678: Type '"abc"' is not comparable to type '"abc0abc"'. + case `123`: + ~~~~~ +!!! error TS2678: Type '"123"' is not comparable to type '"abc0abc"'. + case `abc${0}abc`: + `def${1}def`; + } \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInSwitchAndCase.types b/tests/baselines/reference/templateStringInSwitchAndCase.types index d54891ff05159..b7b148cc77066 100644 --- a/tests/baselines/reference/templateStringInSwitchAndCase.types +++ b/tests/baselines/reference/templateStringInSwitchAndCase.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringInSwitchAndCase.ts === switch (`abc${0}abc`) { ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 case `abc`: @@ -10,10 +10,10 @@ switch (`abc${0}abc`) { >`123` : "123" case `abc${0}abc`: ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 `def${1}def`; ->`def${1}def` : string +>`def${1}def` : "def1def" >1 : 1 } diff --git a/tests/baselines/reference/templateStringInSwitchAndCaseES6.errors.txt b/tests/baselines/reference/templateStringInSwitchAndCaseES6.errors.txt new file mode 100644 index 0000000000000..ef11779c794cf --- /dev/null +++ b/tests/baselines/reference/templateStringInSwitchAndCaseES6.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts(2,10): error TS2678: Type '"abc"' is not comparable to type '"abc0abc"'. +tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts(3,10): error TS2678: Type '"123"' is not comparable to type '"abc0abc"'. + + +==== tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts (2 errors) ==== + switch (`abc${0}abc`) { + case `abc`: + ~~~~~ +!!! error TS2678: Type '"abc"' is not comparable to type '"abc0abc"'. + case `123`: + ~~~~~ +!!! error TS2678: Type '"123"' is not comparable to type '"abc0abc"'. + case `abc${0}abc`: + `def${1}def`; + } \ No newline at end of file diff --git a/tests/baselines/reference/templateStringInSwitchAndCaseES6.types b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types index 8c7c4fee2c1b0..80afd347a9892 100644 --- a/tests/baselines/reference/templateStringInSwitchAndCaseES6.types +++ b/tests/baselines/reference/templateStringInSwitchAndCaseES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringInSwitchAndCaseES6.ts === switch (`abc${0}abc`) { ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 case `abc`: @@ -10,10 +10,10 @@ switch (`abc${0}abc`) { >`123` : "123" case `abc${0}abc`: ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 `def${1}def`; ->`def${1}def` : string +>`def${1}def` : "def1def" >1 : 1 } diff --git a/tests/baselines/reference/templateStringInTaggedTemplate.types b/tests/baselines/reference/templateStringInTaggedTemplate.types index 6c4a059bed3b1..f1eead3fb9d8d 100644 --- a/tests/baselines/reference/templateStringInTaggedTemplate.types +++ b/tests/baselines/reference/templateStringInTaggedTemplate.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringInTaggedTemplate.ts === `I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` >`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` : any ->`I AM THE ${ `${ `TAG` } ` } PORTION` : string ->`${ `TAG` } ` : string +>`I AM THE ${ `${ `TAG` } ` } PORTION` : "I AM THE TAG PORTION" +>`${ `TAG` } ` : "TAG " >`TAG` : "TAG" ->`I ${ "AM" } THE TEMPLATE PORTION` : string +>`I ${ "AM" } THE TEMPLATE PORTION` : "I AM THE TEMPLATE PORTION" >"AM" : "AM" diff --git a/tests/baselines/reference/templateStringInTaggedTemplateES6.types b/tests/baselines/reference/templateStringInTaggedTemplateES6.types index dd2a4898a906c..aeead5bb5d4ae 100644 --- a/tests/baselines/reference/templateStringInTaggedTemplateES6.types +++ b/tests/baselines/reference/templateStringInTaggedTemplateES6.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringInTaggedTemplateES6.ts === `I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` >`I AM THE ${ `${ `TAG` } ` } PORTION` `I ${ "AM" } THE TEMPLATE PORTION` : any ->`I AM THE ${ `${ `TAG` } ` } PORTION` : string ->`${ `TAG` } ` : string +>`I AM THE ${ `${ `TAG` } ` } PORTION` : "I AM THE TAG PORTION" +>`${ `TAG` } ` : "TAG " >`TAG` : "TAG" ->`I ${ "AM" } THE TEMPLATE PORTION` : string +>`I ${ "AM" } THE TEMPLATE PORTION` : "I AM THE TEMPLATE PORTION" >"AM" : "AM" diff --git a/tests/baselines/reference/templateStringInTypeAssertion.types b/tests/baselines/reference/templateStringInTypeAssertion.types index c8950634a36ee..a219f97b65b4d 100644 --- a/tests/baselines/reference/templateStringInTypeAssertion.types +++ b/tests/baselines/reference/templateStringInTypeAssertion.types @@ -2,6 +2,6 @@ var x = `abc${ 123 }def`; >x : any >`abc${ 123 }def` : any ->`abc${ 123 }def` : string +>`abc${ 123 }def` : "abc123def" >123 : 123 diff --git a/tests/baselines/reference/templateStringInTypeAssertionES6.types b/tests/baselines/reference/templateStringInTypeAssertionES6.types index becccd7373803..523eeede88363 100644 --- a/tests/baselines/reference/templateStringInTypeAssertionES6.types +++ b/tests/baselines/reference/templateStringInTypeAssertionES6.types @@ -2,6 +2,6 @@ var x = `abc${ 123 }def`; >x : any >`abc${ 123 }def` : any ->`abc${ 123 }def` : string +>`abc${ 123 }def` : "abc123def" >123 : 123 diff --git a/tests/baselines/reference/templateStringInTypeOf.types b/tests/baselines/reference/templateStringInTypeOf.types index 195150c6aa8b8..a1f9d200ac20a 100644 --- a/tests/baselines/reference/templateStringInTypeOf.types +++ b/tests/baselines/reference/templateStringInTypeOf.types @@ -2,6 +2,6 @@ var x = typeof `abc${ 123 }def`; >x : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >typeof `abc${ 123 }def` : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" ->`abc${ 123 }def` : string +>`abc${ 123 }def` : "abc123def" >123 : 123 diff --git a/tests/baselines/reference/templateStringInTypeOfES6.types b/tests/baselines/reference/templateStringInTypeOfES6.types index 27aab9cc9d981..959ce7decb597 100644 --- a/tests/baselines/reference/templateStringInTypeOfES6.types +++ b/tests/baselines/reference/templateStringInTypeOfES6.types @@ -2,6 +2,6 @@ var x = typeof `abc${ 123 }def`; >x : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >typeof `abc${ 123 }def` : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" ->`abc${ 123 }def` : string +>`abc${ 123 }def` : "abc123def" >123 : 123 diff --git a/tests/baselines/reference/templateStringInUnaryPlus.types b/tests/baselines/reference/templateStringInUnaryPlus.types index aa2b4fe4f2d63..5683220783405 100644 --- a/tests/baselines/reference/templateStringInUnaryPlus.types +++ b/tests/baselines/reference/templateStringInUnaryPlus.types @@ -2,6 +2,6 @@ var x = +`abc${ 123 }def`; >x : number >+`abc${ 123 }def` : number ->`abc${ 123 }def` : string +>`abc${ 123 }def` : "abc123def" >123 : 123 diff --git a/tests/baselines/reference/templateStringInUnaryPlusES6.types b/tests/baselines/reference/templateStringInUnaryPlusES6.types index 8286fa8b6c142..1858a309b5496 100644 --- a/tests/baselines/reference/templateStringInUnaryPlusES6.types +++ b/tests/baselines/reference/templateStringInUnaryPlusES6.types @@ -2,6 +2,6 @@ var x = +`abc${ 123 }def`; >x : number >+`abc${ 123 }def` : number ->`abc${ 123 }def` : string +>`abc${ 123 }def` : "abc123def" >123 : 123 diff --git a/tests/baselines/reference/templateStringInWhile.types b/tests/baselines/reference/templateStringInWhile.types index c0914ee771c9c..e21beddf2b8c2 100644 --- a/tests/baselines/reference/templateStringInWhile.types +++ b/tests/baselines/reference/templateStringInWhile.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringInWhile.ts === while (`abc${0}abc`) { ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 `def${1}def`; ->`def${1}def` : string +>`def${1}def` : "def1def" >1 : 1 } diff --git a/tests/baselines/reference/templateStringInWhileES6.types b/tests/baselines/reference/templateStringInWhileES6.types index 29119d7f77ede..fc09ced07b9f8 100644 --- a/tests/baselines/reference/templateStringInWhileES6.types +++ b/tests/baselines/reference/templateStringInWhileES6.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringInWhileES6.ts === while (`abc${0}abc`) { ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 `def${1}def`; ->`def${1}def` : string +>`def${1}def` : "def1def" >1 : 1 } diff --git a/tests/baselines/reference/templateStringInYieldKeyword.types b/tests/baselines/reference/templateStringInYieldKeyword.types index 71cce7b74eb1b..96d966acf0803 100644 --- a/tests/baselines/reference/templateStringInYieldKeyword.types +++ b/tests/baselines/reference/templateStringInYieldKeyword.types @@ -1,12 +1,12 @@ === tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts === function* gen() { ->gen : () => Generator +>gen : () => Generator<`abc${any}def`, void, unknown> // Once this is supported, the inner expression does not need to be parenthesized. var x = yield `abc${ x }def`; >x : any >yield `abc${ x }def` : any ->`abc${ x }def` : string +>`abc${ x }def` : `abc${any}def` >x : any } diff --git a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types index 7d78d7f29fb65..63caabdceeaf1 100644 --- a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types +++ b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringPlainCharactersThatArePartsOfEscapes02.ts === `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` ->`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string +>`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n" >" " : " " >" " : " " >" " : " " diff --git a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types index ee2b0b3600d34..beaa6f39fc78e 100644 --- a/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types +++ b/tests/baselines/reference/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringPlainCharactersThatArePartsOfEscapes02_ES6.ts === `0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` ->`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : string +>`0${ " " }1${ " " }2${ " " }3${ " " }4${ " " }5${ " " }6${ " " }7${ " " }8${ " " }9${ " " }10${ " " }11${ " " }12${ " " }13${ " " }14${ " " }15${ " " }16${ " " }17${ " " }18${ " " }19${ " " }20${ " " }2028${ " " }2029${ " " }0085${ " " }t${ " " }v${ " " }f${ " " }b${ " " }r${ " " }n` : "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2028 2029 0085 t v f b r n" >" " : " " >" " : " " >" " : " " diff --git a/tests/baselines/reference/templateStringWithEmbeddedAddition.types b/tests/baselines/reference/templateStringWithEmbeddedAddition.types index 56bc197c37764..17dfa769857a3 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedAddition.types +++ b/tests/baselines/reference/templateStringWithEmbeddedAddition.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedAddition.ts === var x = `abc${ 10 + 10 }def`; >x : string ->`abc${ 10 + 10 }def` : string +>`abc${ 10 + 10 }def` : `abc${number}def` >10 + 10 : number >10 : 10 >10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types index 6ee46c39f57c1..50e43d4edfc56 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedAdditionES6.ts === var x = `abc${ 10 + 10 }def`; >x : string ->`abc${ 10 + 10 }def` : string +>`abc${ 10 + 10 }def` : `abc${number}def` >10 + 10 : number >10 : 10 >10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedArray.types b/tests/baselines/reference/templateStringWithEmbeddedArray.types index b82fa26d40049..1c50d92da7581 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArray.types +++ b/tests/baselines/reference/templateStringWithEmbeddedArray.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedArray.ts === var x = `abc${ [1,2,3] }def`; >x : string ->`abc${ [1,2,3] }def` : string +>`abc${ [1,2,3] }def` : `abc${string}def` >[1,2,3] : number[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types index e8701a7f4c30a..b9d23edf7ef66 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedArrayES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrayES6.ts === var x = `abc${ [1,2,3] }def`; >x : string ->`abc${ [1,2,3] }def` : string +>`abc${ [1,2,3] }def` : `abc${string}def` >[1,2,3] : number[] >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.types b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.types index 9e8d81e7ab8a6..c2bf5c8adf7f7 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.types +++ b/tests/baselines/reference/templateStringWithEmbeddedArrowFunction.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunction.ts === var x = `abc${ x => x }def`; >x : string ->`abc${ x => x }def` : string +>`abc${ x => x }def` : `abc${string}def` >x => x : (x: any) => any >x : any >x : any diff --git a/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.types b/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.types index a7adad631302f..04cde9c573f36 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedArrowFunctionES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedArrowFunctionES6.ts === var x = `abc${ x => x }def`; >x : string ->`abc${ x => x }def` : string +>`abc${ x => x }def` : `abc${string}def` >x => x : (x: any) => any >x : any >x : any diff --git a/tests/baselines/reference/templateStringWithEmbeddedComments.types b/tests/baselines/reference/templateStringWithEmbeddedComments.types index f948a8bdaaf10..508149c3144d8 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedComments.types +++ b/tests/baselines/reference/templateStringWithEmbeddedComments.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedComments.ts === `head${ // single line comment ->`head${ // single line comment10}middle${/* Multi- * line * comment */ 20 // closing comment}tail` : string +>`head${ // single line comment10}middle${/* Multi- * line * comment */ 20 // closing comment}tail` : "head10\nmiddle20\ntail" 10 >10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types index cd2e0b23441a7..f8c5c0e6921cd 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedCommentsES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedCommentsES6.ts === `head${ // single line comment ->`head${ // single line comment10}middle${/* Multi- * line * comment */ 20 // closing comment}tail` : string +>`head${ // single line comment10}middle${/* Multi- * line * comment */ 20 // closing comment}tail` : "head10\nmiddle20\ntail" 10 >10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditional.types b/tests/baselines/reference/templateStringWithEmbeddedConditional.types index d79433e7b8aa3..e70cf84f45e36 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedConditional.types +++ b/tests/baselines/reference/templateStringWithEmbeddedConditional.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditional.ts === var x = `abc${ true ? false : " " }def`; ->x : string ->`abc${ true ? false : " " }def` : string +>x : "abcfalsedef" | "abc def" +>`abc${ true ? false : " " }def` : "abcfalsedef" | "abc def" >true ? false : " " : false | " " >true : true >false : false diff --git a/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types index 1ddc81a19e701..58e7770cbbcb4 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedConditionalES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedConditionalES6.ts === var x = `abc${ true ? false : " " }def`; ->x : string ->`abc${ true ? false : " " }def` : string +>x : "abcfalsedef" | "abc def" +>`abc${ true ? false : " " }def` : "abcfalsedef" | "abc def" >true ? false : " " : false | " " >true : true >false : false diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivision.types b/tests/baselines/reference/templateStringWithEmbeddedDivision.types index 6f8913756246c..500ff08ec8388 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedDivision.types +++ b/tests/baselines/reference/templateStringWithEmbeddedDivision.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivision.ts === var x = `abc${ 1 / 1 }def`; >x : string ->`abc${ 1 / 1 }def` : string +>`abc${ 1 / 1 }def` : `abc${number}def` >1 / 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types index f91b3a27639ee..292f9c082000e 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedDivisionES6.ts === var x = `abc${ 1 / 1 }def`; >x : string ->`abc${ 1 / 1 }def` : string +>`abc${ 1 / 1 }def` : `abc${number}def` >1 / 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.types b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.types index 19a37ae86f414..d3a6abdfc0d3e 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.types +++ b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpression.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpression.ts === var x = `abc${ function y() { return y; } }def`; >x : string ->`abc${ function y() { return y; } }def` : string +>`abc${ function y() { return y; } }def` : `abc${string}def` >function y() { return y; } : () => any >y : () => any >y : () => any diff --git a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.types b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.types index c7a4f2e2bc403..5f23f58e2a625 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedFunctionExpressionES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedFunctionExpressionES6.ts === var x = `abc${ function y() { return y; } }def`; >x : string ->`abc${ function y() { return y; } }def` : string +>`abc${ function y() { return y; } }def` : `abc${string}def` >function y() { return y; } : () => any >y : () => any >y : () => any diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperator.types b/tests/baselines/reference/templateStringWithEmbeddedInOperator.types index f97ca55b63364..617dc58c92041 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInOperator.types +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperator.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperator.ts === var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; ->x : string ->`abc${ "hi" in { hi: 10, hello: 20} }def` : string +>x : "abcfalsedef" | "abctruedef" +>`abc${ "hi" in { hi: 10, hello: 20} }def` : "abcfalsedef" | "abctruedef" >"hi" in { hi: 10, hello: 20} : boolean >"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } diff --git a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types index a1346c2ce6d6c..ccd38d6cabc58 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedInOperatorES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedInOperatorES6.ts === var x = `abc${ "hi" in { hi: 10, hello: 20} }def`; ->x : string ->`abc${ "hi" in { hi: 10, hello: 20} }def` : string +>x : "abcfalsedef" | "abctruedef" +>`abc${ "hi" in { hi: 10, hello: 20} }def` : "abcfalsedef" | "abctruedef" >"hi" in { hi: 10, hello: 20} : boolean >"hi" : "hi" >{ hi: 10, hello: 20} : { hi: number; hello: number; } diff --git a/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.types b/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.types index fea4b20d90446..28e3f8b60880d 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.types +++ b/tests/baselines/reference/templateStringWithEmbeddedInstanceOf.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOf.ts === var x = `abc${ "hello" instanceof String }def`; ->x : string ->`abc${ "hello" instanceof String }def` : string +>x : "abcfalsedef" | "abctruedef" +>`abc${ "hello" instanceof String }def` : "abcfalsedef" | "abctruedef" >"hello" instanceof String : boolean >"hello" : "hello" >String : StringConstructor diff --git a/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.types b/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.types index 8fbe2994c65a1..729a9fdab7d4e 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOfES6.ts === var x = `abc${ "hello" instanceof String }def`; ->x : string ->`abc${ "hello" instanceof String }def` : string +>x : "abcfalsedef" | "abctruedef" +>`abc${ "hello" instanceof String }def` : "abcfalsedef" | "abctruedef" >"hello" instanceof String : boolean >"hello" : "hello" >String : StringConstructor diff --git a/tests/baselines/reference/templateStringWithEmbeddedModulo.types b/tests/baselines/reference/templateStringWithEmbeddedModulo.types index c471180956327..5b71d6c355475 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedModulo.types +++ b/tests/baselines/reference/templateStringWithEmbeddedModulo.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedModulo.ts === var x = `abc${ 1 % 1 }def`; >x : string ->`abc${ 1 % 1 }def` : string +>`abc${ 1 % 1 }def` : `abc${number}def` >1 % 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types index 2a1e6b602e2cb..f160811ed7273 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedModuloES6.ts === var x = `abc${ 1 % 1 }def`; >x : string ->`abc${ 1 % 1 }def` : string +>`abc${ 1 % 1 }def` : `abc${number}def` >1 % 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types index f442ab3165bbc..9d74b404fc617 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplication.ts === var x = `abc${ 7 * 6 }def`; >x : string ->`abc${ 7 * 6 }def` : string +>`abc${ 7 * 6 }def` : `abc${number}def` >7 * 6 : number >7 : 7 >6 : 6 diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types index 3e9f15773efba..24927520c237d 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedMultiplicationES6.ts === var x = `abc${ 7 * 6 }def`; >x : string ->`abc${ 7 * 6 }def` : string +>`abc${ 7 * 6 }def` : `abc${number}def` >7 * 6 : number >7 : 7 >6 : 6 diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types index 1e358a571b3ac..6b1c12b81bc3e 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperator.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperator.ts === var x = `abc${ new String("Hi") }def`; >x : string ->`abc${ new String("Hi") }def` : string +>`abc${ new String("Hi") }def` : `abc${string}def` >new String("Hi") : String >String : StringConstructor >"Hi" : "Hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types index 4939c6f867f3a..b96cdfbbe71a9 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperatorES6.ts === var x = `abc${ new String("Hi") }def`; >x : string ->`abc${ new String("Hi") }def` : string +>`abc${ new String("Hi") }def` : `abc${string}def` >new String("Hi") : String >String : StringConstructor >"Hi" : "Hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types index 9854e4e905632..537ed7b76c3b8 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteral.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteral.ts === var x = `abc${ { x: 10, y: 20 } }def`; >x : string ->`abc${ { x: 10, y: 20 } }def` : string +>`abc${ { x: 10, y: 20 } }def` : `abc${string}def` >{ x: 10, y: 20 } : { x: number; y: number; } >x : number >10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types index db086517791dd..286ea752a0947 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedObjectLiteralES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedObjectLiteralES6.ts === var x = `abc${ { x: 10, y: 20 } }def`; >x : string ->`abc${ { x: 10, y: 20 } }def` : string +>`abc${ { x: 10, y: 20 } }def` : `abc${string}def` >{ x: 10, y: 20 } : { x: number; y: number; } >x : number >10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types index cef4f69c0a959..ccc38f4e12f8b 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateString.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateString.ts === var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; >x : string ->`123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321` : string ->`456 ${ " | " } 654` : string +>`123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321` : "123456 | 654321 123456 | 654321" +>`456 ${ " | " } 654` : "456 | 654" >" | " : " | " ->`456 ${ " | " } 654` : string +>`456 ${ " | " } 654` : "456 | 654" >" | " : " | " diff --git a/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types index 12532c8402e48..05dd538b9667b 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTemplateStringES6.types @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedTemplateStringES6.ts === var x = `123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321`; >x : string ->`123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321` : string ->`456 ${ " | " } 654` : string +>`123${ `456 ${ " | " } 654` }321 123${ `456 ${ " | " } 654` }321` : "123456 | 654321 123456 | 654321" +>`456 ${ " | " } 654` : "456 | 654" >" | " : " | " ->`456 ${ " | " } 654` : string +>`456 ${ " | " } 654` : "456 | 654" >" | " : " | " diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types index 898263825af3a..d6e8a4aaedc25 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAddition.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAddition.ts === var x = `abc${ (10 + 10) }def`; >x : string ->`abc${ (10 + 10) }def` : string +>`abc${ (10 + 10) }def` : `abc${any}def` >(10 + 10) : any >(10 + 10) : number >10 + 10 : number diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types index e9e81a2d097d5..4e006b001a3c8 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeAssertionOnAdditionES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeAssertionOnAdditionES6.ts === var x = `abc${ (10 + 10) }def`; >x : string ->`abc${ (10 + 10) }def` : string +>`abc${ (10 + 10) }def` : `abc${any}def` >(10 + 10) : any >(10 + 10) : number >10 + 10 : number diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types index 3069fbb80f3f0..7e1879ddfa380 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperator.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperator.ts === var x = `abc${ typeof "hi" }def`; ->x : string ->`abc${ typeof "hi" }def` : string +>x : "abcstringdef" | "abcnumberdef" | "abcbigintdef" | "abcbooleandef" | "abcsymboldef" | "abcundefineddef" | "abcobjectdef" | "abcfunctiondef" +>`abc${ typeof "hi" }def` : "abcstringdef" | "abcnumberdef" | "abcbigintdef" | "abcbooleandef" | "abcsymboldef" | "abcundefineddef" | "abcobjectdef" | "abcfunctiondef" >typeof "hi" : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >"hi" : "hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types index 35608d6f6049f..3e645795ceab1 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedTypeOfOperatorES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedTypeOfOperatorES6.ts === var x = `abc${ typeof "hi" }def`; ->x : string ->`abc${ typeof "hi" }def` : string +>x : "abcstringdef" | "abcnumberdef" | "abcbigintdef" | "abcbooleandef" | "abcsymboldef" | "abcundefineddef" | "abcobjectdef" | "abcfunctiondef" +>`abc${ typeof "hi" }def` : "abcstringdef" | "abcnumberdef" | "abcbigintdef" | "abcbooleandef" | "abcsymboldef" | "abcundefineddef" | "abcobjectdef" | "abcfunctiondef" >typeof "hi" : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" >"hi" : "hi" diff --git a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.types b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.types index 9c6c4bc921367..5e7a765637fc2 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.types +++ b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlus.ts === var x = `abc${ +Infinity }def`; >x : string ->`abc${ +Infinity }def` : string +>`abc${ +Infinity }def` : `abc${number}def` >+Infinity : number >Infinity : number diff --git a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.types b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.types index 4a957f636e6de..79267e084c9a4 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.types @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlusES6.ts === var x = `abc${ +Infinity }def`; >x : string ->`abc${ +Infinity }def` : string +>`abc${ +Infinity }def` : `abc${number}def` >+Infinity : number >Infinity : number diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.types b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.types index 901d91ecb377d..43637582d6234 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.types +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeyword.types @@ -5,7 +5,7 @@ function* gen { // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`; >x : string ->`abc${ yield 10 }def` : string +>`abc${ yield 10 }def` : `abc${any}def` >yield 10 : any >10 : 10 } diff --git a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types index a4226bc3f4400..84e4804e38416 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types +++ b/tests/baselines/reference/templateStringWithEmbeddedYieldKeywordES6.types @@ -5,7 +5,7 @@ function* gen() { // Once this is supported, yield *must* be parenthesized. var x = `abc${ yield 10 }def`; >x : string ->`abc${ yield 10 }def` : string +>`abc${ yield 10 }def` : `abc${any}def` >yield 10 : any >10 : 10 } diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types index efc2723c270d2..fbe6b30e84487 100644 --- a/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortions.types @@ -5,69 +5,69 @@ var a = ``; var b = `${ 0 }`; >b : string ->`${ 0 }` : string +>`${ 0 }` : "0" >0 : 0 var c = `1${ 0 }`; >c : string ->`1${ 0 }` : string +>`1${ 0 }` : "10" >0 : 0 var d = `${ 0 }2`; >d : string ->`${ 0 }2` : string +>`${ 0 }2` : "02" >0 : 0 var e = `1${ 0 }2`; >e : string ->`1${ 0 }2` : string +>`1${ 0 }2` : "102" >0 : 0 var f = `${ 0 }${ 0 }`; >f : string ->`${ 0 }${ 0 }` : string +>`${ 0 }${ 0 }` : "00" >0 : 0 >0 : 0 var g = `1${ 0 }${ 0 }`; >g : string ->`1${ 0 }${ 0 }` : string +>`1${ 0 }${ 0 }` : "100" >0 : 0 >0 : 0 var h = `${ 0 }2${ 0 }`; >h : string ->`${ 0 }2${ 0 }` : string +>`${ 0 }2${ 0 }` : "020" >0 : 0 >0 : 0 var i = `1${ 0 }2${ 0 }`; >i : string ->`1${ 0 }2${ 0 }` : string +>`1${ 0 }2${ 0 }` : "1020" >0 : 0 >0 : 0 var j = `${ 0 }${ 0 }3`; >j : string ->`${ 0 }${ 0 }3` : string +>`${ 0 }${ 0 }3` : "003" >0 : 0 >0 : 0 var k = `1${ 0 }${ 0 }3`; >k : string ->`1${ 0 }${ 0 }3` : string +>`1${ 0 }${ 0 }3` : "1003" >0 : 0 >0 : 0 var l = `${ 0 }2${ 0 }3`; >l : string ->`${ 0 }2${ 0 }3` : string +>`${ 0 }2${ 0 }3` : "0203" >0 : 0 >0 : 0 var m = `1${ 0 }2${ 0 }3`; >m : string ->`1${ 0 }2${ 0 }3` : string +>`1${ 0 }2${ 0 }3` : "10203" >0 : 0 >0 : 0 diff --git a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types index aad4f1eb09518..a0c680135c6e2 100644 --- a/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types +++ b/tests/baselines/reference/templateStringWithEmptyLiteralPortionsES6.types @@ -5,69 +5,69 @@ var a = ``; var b = `${ 0 }`; >b : string ->`${ 0 }` : string +>`${ 0 }` : "0" >0 : 0 var c = `1${ 0 }`; >c : string ->`1${ 0 }` : string +>`1${ 0 }` : "10" >0 : 0 var d = `${ 0 }2`; >d : string ->`${ 0 }2` : string +>`${ 0 }2` : "02" >0 : 0 var e = `1${ 0 }2`; >e : string ->`1${ 0 }2` : string +>`1${ 0 }2` : "102" >0 : 0 var f = `${ 0 }${ 0 }`; >f : string ->`${ 0 }${ 0 }` : string +>`${ 0 }${ 0 }` : "00" >0 : 0 >0 : 0 var g = `1${ 0 }${ 0 }`; >g : string ->`1${ 0 }${ 0 }` : string +>`1${ 0 }${ 0 }` : "100" >0 : 0 >0 : 0 var h = `${ 0 }2${ 0 }`; >h : string ->`${ 0 }2${ 0 }` : string +>`${ 0 }2${ 0 }` : "020" >0 : 0 >0 : 0 var i = `1${ 0 }2${ 0 }`; >i : string ->`1${ 0 }2${ 0 }` : string +>`1${ 0 }2${ 0 }` : "1020" >0 : 0 >0 : 0 var j = `${ 0 }${ 0 }3`; >j : string ->`${ 0 }${ 0 }3` : string +>`${ 0 }${ 0 }3` : "003" >0 : 0 >0 : 0 var k = `1${ 0 }${ 0 }3`; >k : string ->`1${ 0 }${ 0 }3` : string +>`1${ 0 }${ 0 }3` : "1003" >0 : 0 >0 : 0 var l = `${ 0 }2${ 0 }3`; >l : string ->`${ 0 }2${ 0 }3` : string +>`${ 0 }2${ 0 }3` : "0203" >0 : 0 >0 : 0 var m = `1${ 0 }2${ 0 }3`; >m : string ->`1${ 0 }2${ 0 }3` : string +>`1${ 0 }2${ 0 }3` : "10203" >0 : 0 >0 : 0 diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types index 8c6d4dc2e79ba..b0d90076ef429 100644 --- a/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortion.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortion.ts === ` /**head ${ 10 } // still middle ${ 20 } /* still tail ` ->` /**head ${ 10 } // still middle ${ 20 } /* still tail ` : string +>` /**head ${ 10 } // still middle ${ 20 } /* still tail ` : " /**head 10 // still middle 20 /* still tail " >10 : 10 >20 : 20 diff --git a/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types index fa9ede6976b3f..3f27bda84688f 100644 --- a/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types +++ b/tests/baselines/reference/templateStringWithOpenCommentInStringPortionES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/templates/templateStringWithOpenCommentInStringPortionES6.ts === ` /**head ${ 10 } // still middle ${ 20 } /* still tail ` ->` /**head ${ 10 } // still middle ${ 20 } /* still tail ` : string +>` /**head ${ 10 } // still middle ${ 20 } /* still tail ` : " /**head 10 // still middle 20 /* still tail " >10 : 10 >20 : 20 diff --git a/tests/baselines/reference/templateStringWithPropertyAccess.types b/tests/baselines/reference/templateStringWithPropertyAccess.types index faa2fda38889e..65f006c430c55 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccess.types +++ b/tests/baselines/reference/templateStringWithPropertyAccess.types @@ -2,7 +2,7 @@ `abc${0}abc`.indexOf(`abc`); >`abc${0}abc`.indexOf(`abc`) : number >`abc${0}abc`.indexOf : (searchString: string, position?: number) => number ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 >indexOf : (searchString: string, position?: number) => number >`abc` : "abc" diff --git a/tests/baselines/reference/templateStringWithPropertyAccessES6.types b/tests/baselines/reference/templateStringWithPropertyAccessES6.types index 36a84452808e9..4ffce701c4098 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccessES6.types +++ b/tests/baselines/reference/templateStringWithPropertyAccessES6.types @@ -2,7 +2,7 @@ `abc${0}abc`.indexOf(`abc`); >`abc${0}abc`.indexOf(`abc`) : number >`abc${0}abc`.indexOf : (searchString: string, position?: number) => number ->`abc${0}abc` : string +>`abc${0}abc` : "abc0abc" >0 : 0 >indexOf : (searchString: string, position?: number) => number >`abc` : "abc" diff --git a/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.types b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.types index 1ffd2e8305e72..902b87f52cbc5 100644 --- a/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.types +++ b/tests/baselines/reference/templateStringsArrayTypeDefinedInES5Mode.types @@ -20,7 +20,7 @@ f({}, 10, 10); f `abcdef${ 1234 }${ 5678 }ghijkl`; >f `abcdef${ 1234 }${ 5678 }ghijkl` : void >f : (x: TemplateStringsArray, y: number, z: number) => void ->`abcdef${ 1234 }${ 5678 }ghijkl` : string +>`abcdef${ 1234 }${ 5678 }ghijkl` : "abcdef12345678ghijkl" >1234 : 1234 >5678 : 5678 diff --git a/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.types b/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.types index 5deba77862b6b..2ef3d21cacdfb 100644 --- a/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.types +++ b/tests/baselines/reference/templateStringsArrayTypeNotDefinedES5Mode.types @@ -16,7 +16,7 @@ f({}, 10, 10); f `abcdef${ 1234 }${ 5678 }ghijkl`; >f `abcdef${ 1234 }${ 5678 }ghijkl` : void >f : (x: TemplateStringsArray, y: number, z: number) => void ->`abcdef${ 1234 }${ 5678 }ghijkl` : string +>`abcdef${ 1234 }${ 5678 }ghijkl` : "abcdef12345678ghijkl" >1234 : 1234 >5678 : 5678 diff --git a/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.types b/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.types index 6fca2974a3dab..38ba746f76891 100644 --- a/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.types +++ b/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.types @@ -20,7 +20,7 @@ f({}, 10, 10); f `abcdef${ 1234 }${ 5678 }ghijkl`; >f `abcdef${ 1234 }${ 5678 }ghijkl` : void >f : (x: TemplateStringsArray, y: number, z: number) => void ->`abcdef${ 1234 }${ 5678 }ghijkl` : string +>`abcdef${ 1234 }${ 5678 }ghijkl` : "abcdef12345678ghijkl" >1234 : 1234 >5678 : 5678 diff --git a/tests/baselines/reference/truthinessCallExpressionCoercion.types b/tests/baselines/reference/truthinessCallExpressionCoercion.types index 21c2328455c74..e54295cb3ee03 100644 --- a/tests/baselines/reference/truthinessCallExpressionCoercion.types +++ b/tests/baselines/reference/truthinessCallExpressionCoercion.types @@ -192,7 +192,7 @@ function A(stats: StatsBase) { >console.log : (...data: any[]) => void >console : Console >log : (...data: any[]) => void ->`[Directory] ${stats.ctime}` : string +>`[Directory] ${stats.ctime}` : `[Directory] ${number}` >stats.ctime : number >stats : StatsBase >ctime : number diff --git a/tests/baselines/reference/typeGuardIntersectionTypes.types b/tests/baselines/reference/typeGuardIntersectionTypes.types index bf119d5743c6e..6d9d0f47ac470 100644 --- a/tests/baselines/reference/typeGuardIntersectionTypes.types +++ b/tests/baselines/reference/typeGuardIntersectionTypes.types @@ -196,7 +196,7 @@ function identifyBeast(beast: Beast) { log(`unknown - ${beast.legs} legs, wings`); >log(`unknown - ${beast.legs} legs, wings`) : void >log : (s: string) => void ->`unknown - ${beast.legs} legs, wings` : string +>`unknown - ${beast.legs} legs, wings` : `unknown - ${number} legs, wings` >beast.legs : number >beast : Beast & Legged & Winged >legs : number @@ -208,7 +208,7 @@ function identifyBeast(beast: Beast) { log(`manbearpig - ${beast.legs} legs, no wings`); >log(`manbearpig - ${beast.legs} legs, no wings`) : void >log : (s: string) => void ->`manbearpig - ${beast.legs} legs, no wings` : string +>`manbearpig - ${beast.legs} legs, no wings` : `manbearpig - ${number} legs, no wings` >beast.legs : number >beast : Beast & Legged >legs : number diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.types index ddb24f5de937a..90cebfc3043c2 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES5.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates20_ES5.ts === var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; >x : string ->`\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : string +>`\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : "Hello world" >`\u{20}\u{020}\u{0020}\u{000020}` : " " diff --git a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES6.types b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES6.types index 8244bc5b7fd71..f8ae16d4a4cd1 100644 --- a/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES6.types +++ b/tests/baselines/reference/unicodeExtendedEscapesInTemplates20_ES6.types @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInTemplates20_ES6.ts === var x = `\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}`; >x : string ->`\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : string +>`\u{48}\u{65}\u{6c}\u{6c}\u{6f}${`\u{20}\u{020}\u{0020}\u{000020}`}\u{77}\u{6f}\u{72}\u{6c}\u{64}` : "Hello world" >`\u{20}\u{020}\u{0020}\u{000020}` : " " From e35c42ec6f307db3baa813926b0474afcd7443bf Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 8 Dec 2020 14:45:05 -1000 Subject: [PATCH 05/11] Minor fixes --- src/compiler/types.ts | 1 + tests/baselines/reference/api/tsserverlibrary.d.ts | 1 - tests/baselines/reference/api/typescript.d.ts | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 54a5d236b6e99..b5da057c0f1c7 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4991,6 +4991,7 @@ namespace ts { /* @internal */ export type FreshableLiteralType = LiteralType | TemplateLiteralType; + /* @internal */ export type FreshableType = FreshableLiteralType | FreshableIntrinsicType; // String literal types (TypeFlags.StringLiteral) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index b8ccd0e73d1cf..17d7af1a8bb41 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2511,7 +2511,6 @@ declare namespace ts { aliasSymbol?: Symbol; aliasTypeArguments?: readonly Type[]; } - export type FreshableType = FreshableLiteralType | FreshableIntrinsicType; export interface LiteralType extends Type { value: string | number | PseudoBigInt; freshType: LiteralType; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index a3dea2016e000..a2fabe6574d24 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2511,7 +2511,6 @@ declare namespace ts { aliasSymbol?: Symbol; aliasTypeArguments?: readonly Type[]; } - export type FreshableType = FreshableLiteralType | FreshableIntrinsicType; export interface LiteralType extends Type { value: string | number | PseudoBigInt; freshType: LiteralType; From dfd760d95cb3fff219c126c14c69b6d70adbf22b Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 8 Dec 2020 17:46:04 -1000 Subject: [PATCH 06/11] Add tests --- .../types/literal/templateLiteralTypes2.ts | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 tests/cases/conformance/types/literal/templateLiteralTypes2.ts diff --git a/tests/cases/conformance/types/literal/templateLiteralTypes2.ts b/tests/cases/conformance/types/literal/templateLiteralTypes2.ts new file mode 100644 index 0000000000000..22e5413cd8579 --- /dev/null +++ b/tests/cases/conformance/types/literal/templateLiteralTypes2.ts @@ -0,0 +1,93 @@ +// @strict: true +// @declaration: true + +function ft1(s: string, n: number, u: 'foo' | 'bar' | 'baz', t: T) { + const c1 = `abc${s}`; // `abc${string}` + const c2 = `abc${n}`; // `abc${number}` + const c3 = `abc${u}`; // "abcfoo" | "abcbar" | "abcbaz" + const c4 = `abc${t}`; // `abc${T} + const d1: `abc${string}` = `abc${s}`; + const d2: `abc${number}` = `abc${n}`; + const d3: `abc${'foo' | 'bar' | 'baz'}` = `abc${u}`; + const d4: `abc${T}` = `abc${t}`; +} + +function ft2(s: string) { + return `abc${s}`; +} + +function ft10(s: string) { + const c1 = `abc${s}`; // Widening type `abc${string}` + let v1 = c1; // Type string + const c2 = c1; // Widening type `abc${string}` + let v2 = c2; // Type string + const c3: `abc${string}` = `abc${s}`; + let v3 = c3; // Type `abc${string}` + const c4: `abc${string}` = c1; // Type `abc${string}` + let v4 = c4; // Type `abc${string}` +} + +function ft11(s: string, cond: boolean) { + const c1 = cond ? `foo${s}` : `bar${s}`; // widening `foo${string}` | widening `bar${string}` + const c2: `foo${string}` | `bar${string}` = c1; // `foo${string}` | `bar${string}` + const c3 = cond ? c1 : c2; // `foo${string}` | `bar${string}` + const c4 = cond ? c3 : `baz${s}`; // `foo${string}` | `bar${string}` | widening `baz${string}` + const c5: `foo${string}` | `bar${string}` | `baz${string}` = c4; // `foo${string}` | `bar${string}` | `baz${string}` + let v1 = c1; // string + let v2 = c2; // `foo${string}` | `bar${string}` + let v3 = c3; // `foo${string}` | `bar${string}` + let v4 = c4; // string + let v5 = c5; // `foo${string}` | `bar${string}` | `baz${string}` +} + +function ft12(s: string) { + const c1 = `foo${s}`; + let v1 = c1; + const c2: `foo${string}` = `foo${s}`; + let v2 = c2; + const c3 = `foo${s}` as `foo${string}`; + let v3 = c3; + const c4 = <`foo${string}`>`foo${s}`; + let v4 = c4; + const c5 = `foo${s}` as const; + let v5 = c5; +} + +declare function widening(x: T): T; +declare function nonWidening(x: T): T; + +function ft13(s: string, cond: boolean) { + let x1 = widening(`foo${s}`); + let x2 = widening(cond ? 'a' : `foo${s}`); + let y1 = nonWidening(`foo${s}`); + let y2 = nonWidening(cond ? 'a' : `foo${s}`); +} + +type T0 = string | `${number}px`; + +// Repro from #41631 + +declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown; + +const t1 = takesLiteral("foo.bar.baz"); // "baz" +const id2 = "foo.bar.baz"; +const t2 = takesLiteral(id2); // "baz" + +declare const someString: string; +const t3 = takesLiteral(`foo.bar.${someString}`); // string + +const id4 = `foo.bar.${someString}`; +const t4 = takesLiteral(id4); // string + +declare const someUnion: 'abc' | 'def' | 'ghi'; +const t5 = takesLiteral(`foo.bar.${someUnion}`); // "abc" | "def" | "ghi" + +// Repro from #41732 + +const pixelValue: number = 22; + +type PixelValueType = `${number}px`; + +const pixelString: PixelValueType = `22px`; + +const pixelStringWithTemplate: PixelValueType = `${pixelValue}px`; From 54c3be98f5aa0479cc34fe495c0e5ef1ccc1d96f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 8 Dec 2020 17:46:11 -1000 Subject: [PATCH 07/11] Accept new baselines --- .../reference/templateLiteralTypes2.js | 185 ++++++++++ .../reference/templateLiteralTypes2.symbols | 296 ++++++++++++++++ .../reference/templateLiteralTypes2.types | 330 ++++++++++++++++++ 3 files changed, 811 insertions(+) create mode 100644 tests/baselines/reference/templateLiteralTypes2.js create mode 100644 tests/baselines/reference/templateLiteralTypes2.symbols create mode 100644 tests/baselines/reference/templateLiteralTypes2.types diff --git a/tests/baselines/reference/templateLiteralTypes2.js b/tests/baselines/reference/templateLiteralTypes2.js new file mode 100644 index 0000000000000..8b36bee5f7ff9 --- /dev/null +++ b/tests/baselines/reference/templateLiteralTypes2.js @@ -0,0 +1,185 @@ +//// [templateLiteralTypes2.ts] +function ft1(s: string, n: number, u: 'foo' | 'bar' | 'baz', t: T) { + const c1 = `abc${s}`; // `abc${string}` + const c2 = `abc${n}`; // `abc${number}` + const c3 = `abc${u}`; // "abcfoo" | "abcbar" | "abcbaz" + const c4 = `abc${t}`; // `abc${T} + const d1: `abc${string}` = `abc${s}`; + const d2: `abc${number}` = `abc${n}`; + const d3: `abc${'foo' | 'bar' | 'baz'}` = `abc${u}`; + const d4: `abc${T}` = `abc${t}`; +} + +function ft2(s: string) { + return `abc${s}`; +} + +function ft10(s: string) { + const c1 = `abc${s}`; // Widening type `abc${string}` + let v1 = c1; // Type string + const c2 = c1; // Widening type `abc${string}` + let v2 = c2; // Type string + const c3: `abc${string}` = `abc${s}`; + let v3 = c3; // Type `abc${string}` + const c4: `abc${string}` = c1; // Type `abc${string}` + let v4 = c4; // Type `abc${string}` +} + +function ft11(s: string, cond: boolean) { + const c1 = cond ? `foo${s}` : `bar${s}`; // widening `foo${string}` | widening `bar${string}` + const c2: `foo${string}` | `bar${string}` = c1; // `foo${string}` | `bar${string}` + const c3 = cond ? c1 : c2; // `foo${string}` | `bar${string}` + const c4 = cond ? c3 : `baz${s}`; // `foo${string}` | `bar${string}` | widening `baz${string}` + const c5: `foo${string}` | `bar${string}` | `baz${string}` = c4; // `foo${string}` | `bar${string}` | `baz${string}` + let v1 = c1; // string + let v2 = c2; // `foo${string}` | `bar${string}` + let v3 = c3; // `foo${string}` | `bar${string}` + let v4 = c4; // string + let v5 = c5; // `foo${string}` | `bar${string}` | `baz${string}` +} + +function ft12(s: string) { + const c1 = `foo${s}`; + let v1 = c1; + const c2: `foo${string}` = `foo${s}`; + let v2 = c2; + const c3 = `foo${s}` as `foo${string}`; + let v3 = c3; + const c4 = <`foo${string}`>`foo${s}`; + let v4 = c4; + const c5 = `foo${s}` as const; + let v5 = c5; +} + +declare function widening(x: T): T; +declare function nonWidening(x: T): T; + +function ft13(s: string, cond: boolean) { + let x1 = widening(`foo${s}`); + let x2 = widening(cond ? 'a' : `foo${s}`); + let y1 = nonWidening(`foo${s}`); + let y2 = nonWidening(cond ? 'a' : `foo${s}`); +} + +type T0 = string | `${number}px`; + +// Repro from #41631 + +declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown; + +const t1 = takesLiteral("foo.bar.baz"); // "baz" +const id2 = "foo.bar.baz"; +const t2 = takesLiteral(id2); // "baz" + +declare const someString: string; +const t3 = takesLiteral(`foo.bar.${someString}`); // string + +const id4 = `foo.bar.${someString}`; +const t4 = takesLiteral(id4); // string + +declare const someUnion: 'abc' | 'def' | 'ghi'; +const t5 = takesLiteral(`foo.bar.${someUnion}`); // "abc" | "def" | "ghi" + +// Repro from #41732 + +const pixelValue: number = 22; + +type PixelValueType = `${number}px`; + +const pixelString: PixelValueType = `22px`; + +const pixelStringWithTemplate: PixelValueType = `${pixelValue}px`; + + +//// [templateLiteralTypes2.js] +"use strict"; +function ft1(s, n, u, t) { + var c1 = "abc" + s; // `abc${string}` + var c2 = "abc" + n; // `abc${number}` + var c3 = "abc" + u; // "abcfoo" | "abcbar" | "abcbaz" + var c4 = "abc" + t; // `abc${T} + var d1 = "abc" + s; + var d2 = "abc" + n; + var d3 = "abc" + u; + var d4 = "abc" + t; +} +function ft2(s) { + return "abc" + s; +} +function ft10(s) { + var c1 = "abc" + s; // Widening type `abc${string}` + var v1 = c1; // Type string + var c2 = c1; // Widening type `abc${string}` + var v2 = c2; // Type string + var c3 = "abc" + s; + var v3 = c3; // Type `abc${string}` + var c4 = c1; // Type `abc${string}` + var v4 = c4; // Type `abc${string}` +} +function ft11(s, cond) { + var c1 = cond ? "foo" + s : "bar" + s; // widening `foo${string}` | widening `bar${string}` + var c2 = c1; // `foo${string}` | `bar${string}` + var c3 = cond ? c1 : c2; // `foo${string}` | `bar${string}` + var c4 = cond ? c3 : "baz" + s; // `foo${string}` | `bar${string}` | widening `baz${string}` + var c5 = c4; // `foo${string}` | `bar${string}` | `baz${string}` + var v1 = c1; // string + var v2 = c2; // `foo${string}` | `bar${string}` + var v3 = c3; // `foo${string}` | `bar${string}` + var v4 = c4; // string + var v5 = c5; // `foo${string}` | `bar${string}` | `baz${string}` +} +function ft12(s) { + var c1 = "foo" + s; + var v1 = c1; + var c2 = "foo" + s; + var v2 = c2; + var c3 = "foo" + s; + var v3 = c3; + var c4 = "foo" + s; + var v4 = c4; + var c5 = "foo" + s; + var v5 = c5; +} +function ft13(s, cond) { + var x1 = widening("foo" + s); + var x2 = widening(cond ? 'a' : "foo" + s); + var y1 = nonWidening("foo" + s); + var y2 = nonWidening(cond ? 'a' : "foo" + s); +} +var t1 = takesLiteral("foo.bar.baz"); // "baz" +var id2 = "foo.bar.baz"; +var t2 = takesLiteral(id2); // "baz" +var t3 = takesLiteral("foo.bar." + someString); // string +var id4 = "foo.bar." + someString; +var t4 = takesLiteral(id4); // string +var t5 = takesLiteral("foo.bar." + someUnion); // "abc" | "def" | "ghi" +// Repro from #41732 +var pixelValue = 22; +var pixelString = "22px"; +var pixelStringWithTemplate = pixelValue + "px"; + + +//// [templateLiteralTypes2.d.ts] +declare function ft1(s: string, n: number, u: 'foo' | 'bar' | 'baz', t: T): void; +declare function ft2(s: string): `abc${string}`; +declare function ft10(s: string): void; +declare function ft11(s: string, cond: boolean): void; +declare function ft12(s: string): void; +declare function widening(x: T): T; +declare function nonWidening(x: T): T; +declare function ft13(s: string, cond: boolean): void; +declare type T0 = string | `${number}px`; +declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown; +declare const t1: "baz"; +declare const id2 = "foo.bar.baz"; +declare const t2: "baz"; +declare const someString: string; +declare const t3: string; +declare const id4: string; +declare const t4: string; +declare const someUnion: 'abc' | 'def' | 'ghi'; +declare const t5: "abc" | "def" | "ghi"; +declare const pixelValue: number; +declare type PixelValueType = `${number}px`; +declare const pixelString: PixelValueType; +declare const pixelStringWithTemplate: PixelValueType; diff --git a/tests/baselines/reference/templateLiteralTypes2.symbols b/tests/baselines/reference/templateLiteralTypes2.symbols new file mode 100644 index 0000000000000..22c9bb925dac4 --- /dev/null +++ b/tests/baselines/reference/templateLiteralTypes2.symbols @@ -0,0 +1,296 @@ +=== tests/cases/conformance/types/literal/templateLiteralTypes2.ts === +function ft1(s: string, n: number, u: 'foo' | 'bar' | 'baz', t: T) { +>ft1 : Symbol(ft1, Decl(templateLiteralTypes2.ts, 0, 0)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 0, 13)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 0, 31)) +>n : Symbol(n, Decl(templateLiteralTypes2.ts, 0, 41)) +>u : Symbol(u, Decl(templateLiteralTypes2.ts, 0, 52)) +>t : Symbol(t, Decl(templateLiteralTypes2.ts, 0, 78)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 0, 13)) + + const c1 = `abc${s}`; // `abc${string}` +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 1, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 0, 31)) + + const c2 = `abc${n}`; // `abc${number}` +>c2 : Symbol(c2, Decl(templateLiteralTypes2.ts, 2, 9)) +>n : Symbol(n, Decl(templateLiteralTypes2.ts, 0, 41)) + + const c3 = `abc${u}`; // "abcfoo" | "abcbar" | "abcbaz" +>c3 : Symbol(c3, Decl(templateLiteralTypes2.ts, 3, 9)) +>u : Symbol(u, Decl(templateLiteralTypes2.ts, 0, 52)) + + const c4 = `abc${t}`; // `abc${T} +>c4 : Symbol(c4, Decl(templateLiteralTypes2.ts, 4, 9)) +>t : Symbol(t, Decl(templateLiteralTypes2.ts, 0, 78)) + + const d1: `abc${string}` = `abc${s}`; +>d1 : Symbol(d1, Decl(templateLiteralTypes2.ts, 5, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 0, 31)) + + const d2: `abc${number}` = `abc${n}`; +>d2 : Symbol(d2, Decl(templateLiteralTypes2.ts, 6, 9)) +>n : Symbol(n, Decl(templateLiteralTypes2.ts, 0, 41)) + + const d3: `abc${'foo' | 'bar' | 'baz'}` = `abc${u}`; +>d3 : Symbol(d3, Decl(templateLiteralTypes2.ts, 7, 9)) +>u : Symbol(u, Decl(templateLiteralTypes2.ts, 0, 52)) + + const d4: `abc${T}` = `abc${t}`; +>d4 : Symbol(d4, Decl(templateLiteralTypes2.ts, 8, 9)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 0, 13)) +>t : Symbol(t, Decl(templateLiteralTypes2.ts, 0, 78)) +} + +function ft2(s: string) { +>ft2 : Symbol(ft2, Decl(templateLiteralTypes2.ts, 9, 1)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 11, 13)) + + return `abc${s}`; +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 11, 13)) +} + +function ft10(s: string) { +>ft10 : Symbol(ft10, Decl(templateLiteralTypes2.ts, 13, 1)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 15, 14)) + + const c1 = `abc${s}`; // Widening type `abc${string}` +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 16, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 15, 14)) + + let v1 = c1; // Type string +>v1 : Symbol(v1, Decl(templateLiteralTypes2.ts, 17, 7)) +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 16, 9)) + + const c2 = c1; // Widening type `abc${string}` +>c2 : Symbol(c2, Decl(templateLiteralTypes2.ts, 18, 9)) +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 16, 9)) + + let v2 = c2; // Type string +>v2 : Symbol(v2, Decl(templateLiteralTypes2.ts, 19, 7)) +>c2 : Symbol(c2, Decl(templateLiteralTypes2.ts, 18, 9)) + + const c3: `abc${string}` = `abc${s}`; +>c3 : Symbol(c3, Decl(templateLiteralTypes2.ts, 20, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 15, 14)) + + let v3 = c3; // Type `abc${string}` +>v3 : Symbol(v3, Decl(templateLiteralTypes2.ts, 21, 7)) +>c3 : Symbol(c3, Decl(templateLiteralTypes2.ts, 20, 9)) + + const c4: `abc${string}` = c1; // Type `abc${string}` +>c4 : Symbol(c4, Decl(templateLiteralTypes2.ts, 22, 9)) +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 16, 9)) + + let v4 = c4; // Type `abc${string}` +>v4 : Symbol(v4, Decl(templateLiteralTypes2.ts, 23, 7)) +>c4 : Symbol(c4, Decl(templateLiteralTypes2.ts, 22, 9)) +} + +function ft11(s: string, cond: boolean) { +>ft11 : Symbol(ft11, Decl(templateLiteralTypes2.ts, 24, 1)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 26, 14)) +>cond : Symbol(cond, Decl(templateLiteralTypes2.ts, 26, 24)) + + const c1 = cond ? `foo${s}` : `bar${s}`; // widening `foo${string}` | widening `bar${string}` +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 27, 9)) +>cond : Symbol(cond, Decl(templateLiteralTypes2.ts, 26, 24)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 26, 14)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 26, 14)) + + const c2: `foo${string}` | `bar${string}` = c1; // `foo${string}` | `bar${string}` +>c2 : Symbol(c2, Decl(templateLiteralTypes2.ts, 28, 9)) +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 27, 9)) + + const c3 = cond ? c1 : c2; // `foo${string}` | `bar${string}` +>c3 : Symbol(c3, Decl(templateLiteralTypes2.ts, 29, 9)) +>cond : Symbol(cond, Decl(templateLiteralTypes2.ts, 26, 24)) +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 27, 9)) +>c2 : Symbol(c2, Decl(templateLiteralTypes2.ts, 28, 9)) + + const c4 = cond ? c3 : `baz${s}`; // `foo${string}` | `bar${string}` | widening `baz${string}` +>c4 : Symbol(c4, Decl(templateLiteralTypes2.ts, 30, 9)) +>cond : Symbol(cond, Decl(templateLiteralTypes2.ts, 26, 24)) +>c3 : Symbol(c3, Decl(templateLiteralTypes2.ts, 29, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 26, 14)) + + const c5: `foo${string}` | `bar${string}` | `baz${string}` = c4; // `foo${string}` | `bar${string}` | `baz${string}` +>c5 : Symbol(c5, Decl(templateLiteralTypes2.ts, 31, 9)) +>c4 : Symbol(c4, Decl(templateLiteralTypes2.ts, 30, 9)) + + let v1 = c1; // string +>v1 : Symbol(v1, Decl(templateLiteralTypes2.ts, 32, 7)) +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 27, 9)) + + let v2 = c2; // `foo${string}` | `bar${string}` +>v2 : Symbol(v2, Decl(templateLiteralTypes2.ts, 33, 7)) +>c2 : Symbol(c2, Decl(templateLiteralTypes2.ts, 28, 9)) + + let v3 = c3; // `foo${string}` | `bar${string}` +>v3 : Symbol(v3, Decl(templateLiteralTypes2.ts, 34, 7)) +>c3 : Symbol(c3, Decl(templateLiteralTypes2.ts, 29, 9)) + + let v4 = c4; // string +>v4 : Symbol(v4, Decl(templateLiteralTypes2.ts, 35, 7)) +>c4 : Symbol(c4, Decl(templateLiteralTypes2.ts, 30, 9)) + + let v5 = c5; // `foo${string}` | `bar${string}` | `baz${string}` +>v5 : Symbol(v5, Decl(templateLiteralTypes2.ts, 36, 7)) +>c5 : Symbol(c5, Decl(templateLiteralTypes2.ts, 31, 9)) +} + +function ft12(s: string) { +>ft12 : Symbol(ft12, Decl(templateLiteralTypes2.ts, 37, 1)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 39, 14)) + + const c1 = `foo${s}`; +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 40, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 39, 14)) + + let v1 = c1; +>v1 : Symbol(v1, Decl(templateLiteralTypes2.ts, 41, 7)) +>c1 : Symbol(c1, Decl(templateLiteralTypes2.ts, 40, 9)) + + const c2: `foo${string}` = `foo${s}`; +>c2 : Symbol(c2, Decl(templateLiteralTypes2.ts, 42, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 39, 14)) + + let v2 = c2; +>v2 : Symbol(v2, Decl(templateLiteralTypes2.ts, 43, 7)) +>c2 : Symbol(c2, Decl(templateLiteralTypes2.ts, 42, 9)) + + const c3 = `foo${s}` as `foo${string}`; +>c3 : Symbol(c3, Decl(templateLiteralTypes2.ts, 44, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 39, 14)) + + let v3 = c3; +>v3 : Symbol(v3, Decl(templateLiteralTypes2.ts, 45, 7)) +>c3 : Symbol(c3, Decl(templateLiteralTypes2.ts, 44, 9)) + + const c4 = <`foo${string}`>`foo${s}`; +>c4 : Symbol(c4, Decl(templateLiteralTypes2.ts, 46, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 39, 14)) + + let v4 = c4; +>v4 : Symbol(v4, Decl(templateLiteralTypes2.ts, 47, 7)) +>c4 : Symbol(c4, Decl(templateLiteralTypes2.ts, 46, 9)) + + const c5 = `foo${s}` as const; +>c5 : Symbol(c5, Decl(templateLiteralTypes2.ts, 48, 9)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 39, 14)) + + let v5 = c5; +>v5 : Symbol(v5, Decl(templateLiteralTypes2.ts, 49, 7)) +>c5 : Symbol(c5, Decl(templateLiteralTypes2.ts, 48, 9)) +} + +declare function widening(x: T): T; +>widening : Symbol(widening, Decl(templateLiteralTypes2.ts, 50, 1)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 52, 26)) +>x : Symbol(x, Decl(templateLiteralTypes2.ts, 52, 29)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 52, 26)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 52, 26)) + +declare function nonWidening(x: T): T; +>nonWidening : Symbol(nonWidening, Decl(templateLiteralTypes2.ts, 52, 38)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 53, 29)) +>x : Symbol(x, Decl(templateLiteralTypes2.ts, 53, 65)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 53, 29)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 53, 29)) + +function ft13(s: string, cond: boolean) { +>ft13 : Symbol(ft13, Decl(templateLiteralTypes2.ts, 53, 74)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 55, 14)) +>cond : Symbol(cond, Decl(templateLiteralTypes2.ts, 55, 24)) + + let x1 = widening(`foo${s}`); +>x1 : Symbol(x1, Decl(templateLiteralTypes2.ts, 56, 7)) +>widening : Symbol(widening, Decl(templateLiteralTypes2.ts, 50, 1)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 55, 14)) + + let x2 = widening(cond ? 'a' : `foo${s}`); +>x2 : Symbol(x2, Decl(templateLiteralTypes2.ts, 57, 7)) +>widening : Symbol(widening, Decl(templateLiteralTypes2.ts, 50, 1)) +>cond : Symbol(cond, Decl(templateLiteralTypes2.ts, 55, 24)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 55, 14)) + + let y1 = nonWidening(`foo${s}`); +>y1 : Symbol(y1, Decl(templateLiteralTypes2.ts, 58, 7)) +>nonWidening : Symbol(nonWidening, Decl(templateLiteralTypes2.ts, 52, 38)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 55, 14)) + + let y2 = nonWidening(cond ? 'a' : `foo${s}`); +>y2 : Symbol(y2, Decl(templateLiteralTypes2.ts, 59, 7)) +>nonWidening : Symbol(nonWidening, Decl(templateLiteralTypes2.ts, 52, 38)) +>cond : Symbol(cond, Decl(templateLiteralTypes2.ts, 55, 24)) +>s : Symbol(s, Decl(templateLiteralTypes2.ts, 55, 14)) +} + +type T0 = string | `${number}px`; +>T0 : Symbol(T0, Decl(templateLiteralTypes2.ts, 60, 1)) + +// Repro from #41631 + +declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown; +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 66, 30)) +>literal : Symbol(literal, Decl(templateLiteralTypes2.ts, 66, 48)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 66, 30)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 66, 30)) +>R : Symbol(R, Decl(templateLiteralTypes2.ts, 66, 87)) +>R : Symbol(R, Decl(templateLiteralTypes2.ts, 66, 87)) + +const t1 = takesLiteral("foo.bar.baz"); // "baz" +>t1 : Symbol(t1, Decl(templateLiteralTypes2.ts, 68, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) + +const id2 = "foo.bar.baz"; +>id2 : Symbol(id2, Decl(templateLiteralTypes2.ts, 69, 5)) + +const t2 = takesLiteral(id2); // "baz" +>t2 : Symbol(t2, Decl(templateLiteralTypes2.ts, 70, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) +>id2 : Symbol(id2, Decl(templateLiteralTypes2.ts, 69, 5)) + +declare const someString: string; +>someString : Symbol(someString, Decl(templateLiteralTypes2.ts, 72, 13)) + +const t3 = takesLiteral(`foo.bar.${someString}`); // string +>t3 : Symbol(t3, Decl(templateLiteralTypes2.ts, 73, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) +>someString : Symbol(someString, Decl(templateLiteralTypes2.ts, 72, 13)) + +const id4 = `foo.bar.${someString}`; +>id4 : Symbol(id4, Decl(templateLiteralTypes2.ts, 75, 5)) +>someString : Symbol(someString, Decl(templateLiteralTypes2.ts, 72, 13)) + +const t4 = takesLiteral(id4); // string +>t4 : Symbol(t4, Decl(templateLiteralTypes2.ts, 76, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) +>id4 : Symbol(id4, Decl(templateLiteralTypes2.ts, 75, 5)) + +declare const someUnion: 'abc' | 'def' | 'ghi'; +>someUnion : Symbol(someUnion, Decl(templateLiteralTypes2.ts, 78, 13)) + +const t5 = takesLiteral(`foo.bar.${someUnion}`); // "abc" | "def" | "ghi" +>t5 : Symbol(t5, Decl(templateLiteralTypes2.ts, 79, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) +>someUnion : Symbol(someUnion, Decl(templateLiteralTypes2.ts, 78, 13)) + +// Repro from #41732 + +const pixelValue: number = 22; +>pixelValue : Symbol(pixelValue, Decl(templateLiteralTypes2.ts, 83, 5)) + +type PixelValueType = `${number}px`; +>PixelValueType : Symbol(PixelValueType, Decl(templateLiteralTypes2.ts, 83, 30)) + +const pixelString: PixelValueType = `22px`; +>pixelString : Symbol(pixelString, Decl(templateLiteralTypes2.ts, 87, 5)) +>PixelValueType : Symbol(PixelValueType, Decl(templateLiteralTypes2.ts, 83, 30)) + +const pixelStringWithTemplate: PixelValueType = `${pixelValue}px`; +>pixelStringWithTemplate : Symbol(pixelStringWithTemplate, Decl(templateLiteralTypes2.ts, 89, 5)) +>PixelValueType : Symbol(PixelValueType, Decl(templateLiteralTypes2.ts, 83, 30)) +>pixelValue : Symbol(pixelValue, Decl(templateLiteralTypes2.ts, 83, 5)) + diff --git a/tests/baselines/reference/templateLiteralTypes2.types b/tests/baselines/reference/templateLiteralTypes2.types new file mode 100644 index 0000000000000..fcecaeceeb682 --- /dev/null +++ b/tests/baselines/reference/templateLiteralTypes2.types @@ -0,0 +1,330 @@ +=== tests/cases/conformance/types/literal/templateLiteralTypes2.ts === +function ft1(s: string, n: number, u: 'foo' | 'bar' | 'baz', t: T) { +>ft1 : (s: string, n: number, u: 'foo' | 'bar' | 'baz', t: T) => void +>s : string +>n : number +>u : "foo" | "bar" | "baz" +>t : T + + const c1 = `abc${s}`; // `abc${string}` +>c1 : `abc${string}` +>`abc${s}` : `abc${string}` +>s : string + + const c2 = `abc${n}`; // `abc${number}` +>c2 : `abc${number}` +>`abc${n}` : `abc${number}` +>n : number + + const c3 = `abc${u}`; // "abcfoo" | "abcbar" | "abcbaz" +>c3 : "abcfoo" | "abcbar" | "abcbaz" +>`abc${u}` : "abcfoo" | "abcbar" | "abcbaz" +>u : "foo" | "bar" | "baz" + + const c4 = `abc${t}`; // `abc${T} +>c4 : `abc${T}` +>`abc${t}` : `abc${T}` +>t : T + + const d1: `abc${string}` = `abc${s}`; +>d1 : `abc${string}` +>`abc${s}` : `abc${string}` +>s : string + + const d2: `abc${number}` = `abc${n}`; +>d2 : `abc${number}` +>`abc${n}` : `abc${number}` +>n : number + + const d3: `abc${'foo' | 'bar' | 'baz'}` = `abc${u}`; +>d3 : "abcfoo" | "abcbar" | "abcbaz" +>`abc${u}` : "abcfoo" | "abcbar" | "abcbaz" +>u : "foo" | "bar" | "baz" + + const d4: `abc${T}` = `abc${t}`; +>d4 : `abc${T}` +>`abc${t}` : `abc${T}` +>t : T +} + +function ft2(s: string) { +>ft2 : (s: string) => `abc${string}` +>s : string + + return `abc${s}`; +>`abc${s}` : `abc${string}` +>s : string +} + +function ft10(s: string) { +>ft10 : (s: string) => void +>s : string + + const c1 = `abc${s}`; // Widening type `abc${string}` +>c1 : `abc${string}` +>`abc${s}` : `abc${string}` +>s : string + + let v1 = c1; // Type string +>v1 : string +>c1 : `abc${string}` + + const c2 = c1; // Widening type `abc${string}` +>c2 : `abc${string}` +>c1 : `abc${string}` + + let v2 = c2; // Type string +>v2 : string +>c2 : `abc${string}` + + const c3: `abc${string}` = `abc${s}`; +>c3 : `abc${string}` +>`abc${s}` : `abc${string}` +>s : string + + let v3 = c3; // Type `abc${string}` +>v3 : `abc${string}` +>c3 : `abc${string}` + + const c4: `abc${string}` = c1; // Type `abc${string}` +>c4 : `abc${string}` +>c1 : `abc${string}` + + let v4 = c4; // Type `abc${string}` +>v4 : `abc${string}` +>c4 : `abc${string}` +} + +function ft11(s: string, cond: boolean) { +>ft11 : (s: string, cond: boolean) => void +>s : string +>cond : boolean + + const c1 = cond ? `foo${s}` : `bar${s}`; // widening `foo${string}` | widening `bar${string}` +>c1 : `foo${string}` | `bar${string}` +>cond ? `foo${s}` : `bar${s}` : `foo${string}` | `bar${string}` +>cond : boolean +>`foo${s}` : `foo${string}` +>s : string +>`bar${s}` : `bar${string}` +>s : string + + const c2: `foo${string}` | `bar${string}` = c1; // `foo${string}` | `bar${string}` +>c2 : `foo${string}` | `bar${string}` +>c1 : `foo${string}` | `bar${string}` + + const c3 = cond ? c1 : c2; // `foo${string}` | `bar${string}` +>c3 : `foo${string}` | `bar${string}` +>cond ? c1 : c2 : `foo${string}` | `bar${string}` +>cond : boolean +>c1 : `foo${string}` | `bar${string}` +>c2 : `foo${string}` | `bar${string}` + + const c4 = cond ? c3 : `baz${s}`; // `foo${string}` | `bar${string}` | widening `baz${string}` +>c4 : `foo${string}` | `bar${string}` | `baz${string}` +>cond ? c3 : `baz${s}` : `foo${string}` | `bar${string}` | `baz${string}` +>cond : boolean +>c3 : `foo${string}` | `bar${string}` +>`baz${s}` : `baz${string}` +>s : string + + const c5: `foo${string}` | `bar${string}` | `baz${string}` = c4; // `foo${string}` | `bar${string}` | `baz${string}` +>c5 : `foo${string}` | `bar${string}` | `baz${string}` +>c4 : `foo${string}` | `bar${string}` | `baz${string}` + + let v1 = c1; // string +>v1 : string +>c1 : `foo${string}` | `bar${string}` + + let v2 = c2; // `foo${string}` | `bar${string}` +>v2 : `foo${string}` | `bar${string}` +>c2 : `foo${string}` | `bar${string}` + + let v3 = c3; // `foo${string}` | `bar${string}` +>v3 : `foo${string}` | `bar${string}` +>c3 : `foo${string}` | `bar${string}` + + let v4 = c4; // string +>v4 : string +>c4 : `foo${string}` | `bar${string}` | `baz${string}` + + let v5 = c5; // `foo${string}` | `bar${string}` | `baz${string}` +>v5 : `foo${string}` | `bar${string}` | `baz${string}` +>c5 : `foo${string}` | `bar${string}` | `baz${string}` +} + +function ft12(s: string) { +>ft12 : (s: string) => void +>s : string + + const c1 = `foo${s}`; +>c1 : `foo${string}` +>`foo${s}` : `foo${string}` +>s : string + + let v1 = c1; +>v1 : string +>c1 : `foo${string}` + + const c2: `foo${string}` = `foo${s}`; +>c2 : `foo${string}` +>`foo${s}` : `foo${string}` +>s : string + + let v2 = c2; +>v2 : `foo${string}` +>c2 : `foo${string}` + + const c3 = `foo${s}` as `foo${string}`; +>c3 : `foo${string}` +>`foo${s}` as `foo${string}` : `foo${string}` +>`foo${s}` : `foo${string}` +>s : string + + let v3 = c3; +>v3 : `foo${string}` +>c3 : `foo${string}` + + const c4 = <`foo${string}`>`foo${s}`; +>c4 : `foo${string}` +><`foo${string}`>`foo${s}` : `foo${string}` +>`foo${s}` : `foo${string}` +>s : string + + let v4 = c4; +>v4 : `foo${string}` +>c4 : `foo${string}` + + const c5 = `foo${s}` as const; +>c5 : `foo${string}` +>`foo${s}` as const : `foo${string}` +>`foo${s}` : `foo${string}` +>s : string + + let v5 = c5; +>v5 : `foo${string}` +>c5 : `foo${string}` +} + +declare function widening(x: T): T; +>widening : (x: T) => T +>x : T + +declare function nonWidening(x: T): T; +>nonWidening : (x: T) => T +>x : T + +function ft13(s: string, cond: boolean) { +>ft13 : (s: string, cond: boolean) => void +>s : string +>cond : boolean + + let x1 = widening(`foo${s}`); +>x1 : string +>widening(`foo${s}`) : `foo${string}` +>widening : (x: T) => T +>`foo${s}` : `foo${string}` +>s : string + + let x2 = widening(cond ? 'a' : `foo${s}`); +>x2 : string +>widening(cond ? 'a' : `foo${s}`) : `foo${string}` | "a" +>widening : (x: T) => T +>cond ? 'a' : `foo${s}` : `foo${string}` | "a" +>cond : boolean +>'a' : "a" +>`foo${s}` : `foo${string}` +>s : string + + let y1 = nonWidening(`foo${s}`); +>y1 : `foo${string}` +>nonWidening(`foo${s}`) : `foo${string}` +>nonWidening : (x: T) => T +>`foo${s}` : `foo${string}` +>s : string + + let y2 = nonWidening(cond ? 'a' : `foo${s}`); +>y2 : `foo${string}` | "a" +>nonWidening(cond ? 'a' : `foo${s}`) : `foo${string}` | "a" +>nonWidening : (x: T) => T +>cond ? 'a' : `foo${s}` : `foo${string}` | "a" +>cond : boolean +>'a' : "a" +>`foo${s}` : `foo${string}` +>s : string +} + +type T0 = string | `${number}px`; +>T0 : string + +// Repro from #41631 + +declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown; +>takesLiteral : (literal: T) => T extends `foo.bar.${infer R}` ? R : unknown +>literal : T + +const t1 = takesLiteral("foo.bar.baz"); // "baz" +>t1 : "baz" +>takesLiteral("foo.bar.baz") : "baz" +>takesLiteral : (literal: T) => T extends `foo.bar.${infer R}` ? R : unknown +>"foo.bar.baz" : "foo.bar.baz" + +const id2 = "foo.bar.baz"; +>id2 : "foo.bar.baz" +>"foo.bar.baz" : "foo.bar.baz" + +const t2 = takesLiteral(id2); // "baz" +>t2 : "baz" +>takesLiteral(id2) : "baz" +>takesLiteral : (literal: T) => T extends `foo.bar.${infer R}` ? R : unknown +>id2 : "foo.bar.baz" + +declare const someString: string; +>someString : string + +const t3 = takesLiteral(`foo.bar.${someString}`); // string +>t3 : string +>takesLiteral(`foo.bar.${someString}`) : string +>takesLiteral : (literal: T) => T extends `foo.bar.${infer R}` ? R : unknown +>`foo.bar.${someString}` : `foo.bar.${string}` +>someString : string + +const id4 = `foo.bar.${someString}`; +>id4 : `foo.bar.${string}` +>`foo.bar.${someString}` : `foo.bar.${string}` +>someString : string + +const t4 = takesLiteral(id4); // string +>t4 : string +>takesLiteral(id4) : string +>takesLiteral : (literal: T) => T extends `foo.bar.${infer R}` ? R : unknown +>id4 : `foo.bar.${string}` + +declare const someUnion: 'abc' | 'def' | 'ghi'; +>someUnion : "abc" | "def" | "ghi" + +const t5 = takesLiteral(`foo.bar.${someUnion}`); // "abc" | "def" | "ghi" +>t5 : "abc" | "def" | "ghi" +>takesLiteral(`foo.bar.${someUnion}`) : "abc" | "def" | "ghi" +>takesLiteral : (literal: T) => T extends `foo.bar.${infer R}` ? R : unknown +>`foo.bar.${someUnion}` : "foo.bar.abc" | "foo.bar.def" | "foo.bar.ghi" +>someUnion : "abc" | "def" | "ghi" + +// Repro from #41732 + +const pixelValue: number = 22; +>pixelValue : number +>22 : 22 + +type PixelValueType = `${number}px`; +>PixelValueType : `${number}px` + +const pixelString: PixelValueType = `22px`; +>pixelString : `${number}px` +>`22px` : "22px" + +const pixelStringWithTemplate: PixelValueType = `${pixelValue}px`; +>pixelStringWithTemplate : `${number}px` +>`${pixelValue}px` : `${number}px` +>pixelValue : number + From afcfd9ce03d5c843e2915352909af065c381e3cb Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 9 Dec 2020 06:20:44 -1000 Subject: [PATCH 08/11] Make new TypeFlags internal --- src/compiler/types.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b5da057c0f1c7..cc5880589818e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4894,7 +4894,9 @@ namespace ts { Literal = StringLiteral | NumberLiteral | BigIntLiteral | BooleanLiteral, Unit = Literal | UniqueESSymbol | Nullable, StringOrNumberLiteral = StringLiteral | NumberLiteral, + /* @internal */ StringLikeLiteral = StringLiteral | TemplateLiteral, + /* @internal */ FreshableLiteral = Literal | TemplateLiteral, /* @internal */ StringOrNumberLiteralOrUnique = StringLiteral | NumberLiteral | UniqueESSymbol, From 96885c337e4c0de38a7dfd23cbfaa022e947ce8c Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 9 Dec 2020 06:28:17 -1000 Subject: [PATCH 09/11] Accept new API baselines --- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 -- tests/baselines/reference/api/typescript.d.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 17d7af1a8bb41..7a7948b4e30fe 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2484,8 +2484,6 @@ declare namespace ts { Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, - StringLikeLiteral = 134217856, - FreshableLiteral = 134220672, PossiblyFalsy = 117724, StringLike = 402653316, NumberLike = 296, diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index a2fabe6574d24..fb84daf5bcbec 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2484,8 +2484,6 @@ declare namespace ts { Literal = 2944, Unit = 109440, StringOrNumberLiteral = 384, - StringLikeLiteral = 134217856, - FreshableLiteral = 134220672, PossiblyFalsy = 117724, StringLike = 402653316, NumberLike = 296, From b3cdbf31c8bdd509f2d5b3bc3a6614e0604cfb6e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 9 Dec 2020 10:55:43 -1000 Subject: [PATCH 10/11] Ensure template literals assignable to String, Object, {}, etc. --- src/compiler/checker.ts | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ab7f0a0b0b882..f4c4f12f78076 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -17616,17 +17616,20 @@ namespace ts { } } else if (source.flags & TypeFlags.TemplateLiteral) { - if (target.flags & TypeFlags.TemplateLiteral && - (source as TemplateLiteralType).texts.length === (target as TemplateLiteralType).texts.length && - (source as TemplateLiteralType).types.length === (target as TemplateLiteralType).types.length && - every((source as TemplateLiteralType).texts, (t, i) => t === (target as TemplateLiteralType).texts[i]) && - every((instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)) as TemplateLiteralType).types, (t, i) => !!((target as TemplateLiteralType).types[i].flags & (TypeFlags.Any | TypeFlags.String)) || !!isRelatedTo(t, (target as TemplateLiteralType).types[i], /*reportErrors*/ false))) { - return Ternary.True; + if (target.flags & TypeFlags.TemplateLiteral) { + if ((source as TemplateLiteralType).texts.length === (target as TemplateLiteralType).texts.length && + (source as TemplateLiteralType).types.length === (target as TemplateLiteralType).types.length && + every((source as TemplateLiteralType).texts, (t, i) => t === (target as TemplateLiteralType).texts[i]) && + every((instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers)) as TemplateLiteralType).types, (t, i) => !!((target as TemplateLiteralType).types[i].flags & (TypeFlags.Any | TypeFlags.String)) || !!isRelatedTo(t, (target as TemplateLiteralType).types[i], /*reportErrors*/ false))) { + return Ternary.True; + } } - const constraint = getBaseConstraintOfType(source); - if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, reportErrors))) { - resetErrorInfo(saveErrorInfo); - return result; + else { + const constraint = getBaseConstraintOfType(source); + if (result = isRelatedTo(constraint && constraint !== source ? constraint : stringType, target, reportErrors)) { + resetErrorInfo(saveErrorInfo); + return result; + } } } else if (source.flags & TypeFlags.StringMapping) { From 5cf670b69c7b85f1453550e8ef52214b8f968da8 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 9 Dec 2020 11:02:15 -1000 Subject: [PATCH 11/11] Add tests --- .../reference/templateLiteralTypes2.js | 16 ++++ .../reference/templateLiteralTypes2.symbols | 94 ++++++++++++------- .../reference/templateLiteralTypes2.types | 26 +++++ .../types/literal/templateLiteralTypes2.ts | 8 ++ 4 files changed, 111 insertions(+), 33 deletions(-) diff --git a/tests/baselines/reference/templateLiteralTypes2.js b/tests/baselines/reference/templateLiteralTypes2.js index 8b36bee5f7ff9..ce87e6b5869fb 100644 --- a/tests/baselines/reference/templateLiteralTypes2.js +++ b/tests/baselines/reference/templateLiteralTypes2.js @@ -63,6 +63,14 @@ function ft13(s: string, cond: boolean) { type T0 = string | `${number}px`; +function ft14(t: `foo${number}`) { + let x1: string = t; + let x2: String = t; + let x3: Object = t; + let x4: {} = t; + let x6: { length: number } = t; +} + // Repro from #41631 declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown; @@ -146,6 +154,13 @@ function ft13(s, cond) { var y1 = nonWidening("foo" + s); var y2 = nonWidening(cond ? 'a' : "foo" + s); } +function ft14(t) { + var x1 = t; + var x2 = t; + var x3 = t; + var x4 = t; + var x6 = t; +} var t1 = takesLiteral("foo.bar.baz"); // "baz" var id2 = "foo.bar.baz"; var t2 = takesLiteral(id2); // "baz" @@ -169,6 +184,7 @@ declare function widening(x: T): T; declare function nonWidening(x: T): T; declare function ft13(s: string, cond: boolean): void; declare type T0 = string | `${number}px`; +declare function ft14(t: `foo${number}`): void; declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown; declare const t1: "baz"; declare const id2 = "foo.bar.baz"; diff --git a/tests/baselines/reference/templateLiteralTypes2.symbols b/tests/baselines/reference/templateLiteralTypes2.symbols index 22c9bb925dac4..71dd7f21f4476 100644 --- a/tests/baselines/reference/templateLiteralTypes2.symbols +++ b/tests/baselines/reference/templateLiteralTypes2.symbols @@ -229,68 +229,96 @@ function ft13(s: string, cond: boolean) { type T0 = string | `${number}px`; >T0 : Symbol(T0, Decl(templateLiteralTypes2.ts, 60, 1)) +function ft14(t: `foo${number}`) { +>ft14 : Symbol(ft14, Decl(templateLiteralTypes2.ts, 62, 33)) +>t : Symbol(t, Decl(templateLiteralTypes2.ts, 64, 14)) + + let x1: string = t; +>x1 : Symbol(x1, Decl(templateLiteralTypes2.ts, 65, 7)) +>t : Symbol(t, Decl(templateLiteralTypes2.ts, 64, 14)) + + let x2: String = t; +>x2 : Symbol(x2, Decl(templateLiteralTypes2.ts, 66, 7)) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>t : Symbol(t, Decl(templateLiteralTypes2.ts, 64, 14)) + + let x3: Object = t; +>x3 : Symbol(x3, Decl(templateLiteralTypes2.ts, 67, 7)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>t : Symbol(t, Decl(templateLiteralTypes2.ts, 64, 14)) + + let x4: {} = t; +>x4 : Symbol(x4, Decl(templateLiteralTypes2.ts, 68, 7)) +>t : Symbol(t, Decl(templateLiteralTypes2.ts, 64, 14)) + + let x6: { length: number } = t; +>x6 : Symbol(x6, Decl(templateLiteralTypes2.ts, 69, 7)) +>length : Symbol(length, Decl(templateLiteralTypes2.ts, 69, 13)) +>t : Symbol(t, Decl(templateLiteralTypes2.ts, 64, 14)) +} + // Repro from #41631 declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown; ->takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) ->T : Symbol(T, Decl(templateLiteralTypes2.ts, 66, 30)) ->literal : Symbol(literal, Decl(templateLiteralTypes2.ts, 66, 48)) ->T : Symbol(T, Decl(templateLiteralTypes2.ts, 66, 30)) ->T : Symbol(T, Decl(templateLiteralTypes2.ts, 66, 30)) ->R : Symbol(R, Decl(templateLiteralTypes2.ts, 66, 87)) ->R : Symbol(R, Decl(templateLiteralTypes2.ts, 66, 87)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 70, 1)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 74, 30)) +>literal : Symbol(literal, Decl(templateLiteralTypes2.ts, 74, 48)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 74, 30)) +>T : Symbol(T, Decl(templateLiteralTypes2.ts, 74, 30)) +>R : Symbol(R, Decl(templateLiteralTypes2.ts, 74, 87)) +>R : Symbol(R, Decl(templateLiteralTypes2.ts, 74, 87)) const t1 = takesLiteral("foo.bar.baz"); // "baz" ->t1 : Symbol(t1, Decl(templateLiteralTypes2.ts, 68, 5)) ->takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) +>t1 : Symbol(t1, Decl(templateLiteralTypes2.ts, 76, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 70, 1)) const id2 = "foo.bar.baz"; ->id2 : Symbol(id2, Decl(templateLiteralTypes2.ts, 69, 5)) +>id2 : Symbol(id2, Decl(templateLiteralTypes2.ts, 77, 5)) const t2 = takesLiteral(id2); // "baz" ->t2 : Symbol(t2, Decl(templateLiteralTypes2.ts, 70, 5)) ->takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) ->id2 : Symbol(id2, Decl(templateLiteralTypes2.ts, 69, 5)) +>t2 : Symbol(t2, Decl(templateLiteralTypes2.ts, 78, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 70, 1)) +>id2 : Symbol(id2, Decl(templateLiteralTypes2.ts, 77, 5)) declare const someString: string; ->someString : Symbol(someString, Decl(templateLiteralTypes2.ts, 72, 13)) +>someString : Symbol(someString, Decl(templateLiteralTypes2.ts, 80, 13)) const t3 = takesLiteral(`foo.bar.${someString}`); // string ->t3 : Symbol(t3, Decl(templateLiteralTypes2.ts, 73, 5)) ->takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) ->someString : Symbol(someString, Decl(templateLiteralTypes2.ts, 72, 13)) +>t3 : Symbol(t3, Decl(templateLiteralTypes2.ts, 81, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 70, 1)) +>someString : Symbol(someString, Decl(templateLiteralTypes2.ts, 80, 13)) const id4 = `foo.bar.${someString}`; ->id4 : Symbol(id4, Decl(templateLiteralTypes2.ts, 75, 5)) ->someString : Symbol(someString, Decl(templateLiteralTypes2.ts, 72, 13)) +>id4 : Symbol(id4, Decl(templateLiteralTypes2.ts, 83, 5)) +>someString : Symbol(someString, Decl(templateLiteralTypes2.ts, 80, 13)) const t4 = takesLiteral(id4); // string ->t4 : Symbol(t4, Decl(templateLiteralTypes2.ts, 76, 5)) ->takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) ->id4 : Symbol(id4, Decl(templateLiteralTypes2.ts, 75, 5)) +>t4 : Symbol(t4, Decl(templateLiteralTypes2.ts, 84, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 70, 1)) +>id4 : Symbol(id4, Decl(templateLiteralTypes2.ts, 83, 5)) declare const someUnion: 'abc' | 'def' | 'ghi'; ->someUnion : Symbol(someUnion, Decl(templateLiteralTypes2.ts, 78, 13)) +>someUnion : Symbol(someUnion, Decl(templateLiteralTypes2.ts, 86, 13)) const t5 = takesLiteral(`foo.bar.${someUnion}`); // "abc" | "def" | "ghi" ->t5 : Symbol(t5, Decl(templateLiteralTypes2.ts, 79, 5)) ->takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 62, 33)) ->someUnion : Symbol(someUnion, Decl(templateLiteralTypes2.ts, 78, 13)) +>t5 : Symbol(t5, Decl(templateLiteralTypes2.ts, 87, 5)) +>takesLiteral : Symbol(takesLiteral, Decl(templateLiteralTypes2.ts, 70, 1)) +>someUnion : Symbol(someUnion, Decl(templateLiteralTypes2.ts, 86, 13)) // Repro from #41732 const pixelValue: number = 22; ->pixelValue : Symbol(pixelValue, Decl(templateLiteralTypes2.ts, 83, 5)) +>pixelValue : Symbol(pixelValue, Decl(templateLiteralTypes2.ts, 91, 5)) type PixelValueType = `${number}px`; ->PixelValueType : Symbol(PixelValueType, Decl(templateLiteralTypes2.ts, 83, 30)) +>PixelValueType : Symbol(PixelValueType, Decl(templateLiteralTypes2.ts, 91, 30)) const pixelString: PixelValueType = `22px`; ->pixelString : Symbol(pixelString, Decl(templateLiteralTypes2.ts, 87, 5)) ->PixelValueType : Symbol(PixelValueType, Decl(templateLiteralTypes2.ts, 83, 30)) +>pixelString : Symbol(pixelString, Decl(templateLiteralTypes2.ts, 95, 5)) +>PixelValueType : Symbol(PixelValueType, Decl(templateLiteralTypes2.ts, 91, 30)) const pixelStringWithTemplate: PixelValueType = `${pixelValue}px`; ->pixelStringWithTemplate : Symbol(pixelStringWithTemplate, Decl(templateLiteralTypes2.ts, 89, 5)) ->PixelValueType : Symbol(PixelValueType, Decl(templateLiteralTypes2.ts, 83, 30)) ->pixelValue : Symbol(pixelValue, Decl(templateLiteralTypes2.ts, 83, 5)) +>pixelStringWithTemplate : Symbol(pixelStringWithTemplate, Decl(templateLiteralTypes2.ts, 97, 5)) +>PixelValueType : Symbol(PixelValueType, Decl(templateLiteralTypes2.ts, 91, 30)) +>pixelValue : Symbol(pixelValue, Decl(templateLiteralTypes2.ts, 91, 5)) diff --git a/tests/baselines/reference/templateLiteralTypes2.types b/tests/baselines/reference/templateLiteralTypes2.types index fcecaeceeb682..1013a43a7b402 100644 --- a/tests/baselines/reference/templateLiteralTypes2.types +++ b/tests/baselines/reference/templateLiteralTypes2.types @@ -257,6 +257,32 @@ function ft13(s: string, cond: boolean) { type T0 = string | `${number}px`; >T0 : string +function ft14(t: `foo${number}`) { +>ft14 : (t: `foo${number}`) => void +>t : `foo${number}` + + let x1: string = t; +>x1 : string +>t : `foo${number}` + + let x2: String = t; +>x2 : String +>t : `foo${number}` + + let x3: Object = t; +>x3 : Object +>t : `foo${number}` + + let x4: {} = t; +>x4 : {} +>t : `foo${number}` + + let x6: { length: number } = t; +>x6 : { length: number; } +>length : number +>t : `foo${number}` +} + // Repro from #41631 declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown; diff --git a/tests/cases/conformance/types/literal/templateLiteralTypes2.ts b/tests/cases/conformance/types/literal/templateLiteralTypes2.ts index 22e5413cd8579..248e0e5539a77 100644 --- a/tests/cases/conformance/types/literal/templateLiteralTypes2.ts +++ b/tests/cases/conformance/types/literal/templateLiteralTypes2.ts @@ -65,6 +65,14 @@ function ft13(s: string, cond: boolean) { type T0 = string | `${number}px`; +function ft14(t: `foo${number}`) { + let x1: string = t; + let x2: String = t; + let x3: Object = t; + let x4: {} = t; + let x6: { length: number } = t; +} + // Repro from #41631 declare function takesLiteral(literal: T): T extends `foo.bar.${infer R}` ? R : unknown;