diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7d940cf747ee8..0da577fc9d92e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -29289,6 +29289,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { case SyntaxKind.NumericLiteral: case SyntaxKind.BigIntLiteral: case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.TemplateExpression: case SyntaxKind.TrueKeyword: case SyntaxKind.FalseKeyword: case SyntaxKind.NullKeyword: @@ -37301,7 +37302,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { texts.push(span.literal.text); types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType); } - return isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType(node, /*contextFlags*/ undefined) || unknownType, isTemplateLiteralContextualType) ? getTemplateLiteralType(texts, types) : stringType; + if (isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType(node, /*contextFlags*/ undefined) || unknownType, isTemplateLiteralContextualType)) { + return getTemplateLiteralType(texts, types); + } + const evaluated = node.parent.kind !== SyntaxKind.TaggedTemplateExpression && evaluateTemplateExpression(node); + return evaluated ? getFreshTypeOfLiteralType(getStringLiteralType(evaluated)) : stringType; } function isTemplateLiteralContextualType(type: Type): boolean { @@ -43578,7 +43583,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return value; } - function evaluate(expr: Expression, location: Declaration): string | number | undefined { + function evaluate(expr: Expression, location?: Declaration): string | number | undefined { switch (expr.kind) { case SyntaxKind.PrefixUnaryExpression: const value = evaluate((expr as PrefixUnaryExpression).operand, location); @@ -43635,11 +43640,11 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const symbol = resolveEntityName(expr, SymbolFlags.Value, /*ignoreErrors*/ true); if (symbol) { if (symbol.flags & SymbolFlags.EnumMember) { - return evaluateEnumMember(expr, symbol, location); + return location ? evaluateEnumMember(expr, symbol, location) : getEnumMemberValue(symbol.valueDeclaration as EnumMember); } if (isConstVariable(symbol)) { const declaration = symbol.valueDeclaration as VariableDeclaration | undefined; - if (declaration && !declaration.type && declaration.initializer && declaration !== location && isBlockScopedNameDeclaredBeforeUse(declaration, location)) { + if (declaration && !declaration.type && declaration.initializer && (!location || declaration !== location && isBlockScopedNameDeclaredBeforeUse(declaration, location))) { return evaluate(declaration.initializer, declaration); } } @@ -43654,7 +43659,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { const name = escapeLeadingUnderscores(((expr as ElementAccessExpression).argumentExpression as StringLiteralLike).text); const member = rootSymbol.exports!.get(name); if (member) { - return evaluateEnumMember(expr, member, location); + return location ? evaluateEnumMember(expr, member, location) : getEnumMemberValue(member.valueDeclaration as EnumMember); } } } @@ -43676,7 +43681,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { return getEnumMemberValue(declaration as EnumMember); } - function evaluateTemplateExpression(expr: TemplateExpression, location: Declaration) { + function evaluateTemplateExpression(expr: TemplateExpression, location?: Declaration) { let result = expr.head.text; for (const span of expr.templateSpans) { const value = evaluate(span.expression, location); diff --git a/tests/baselines/reference/asOperator3.types b/tests/baselines/reference/asOperator3.types index e5e319d3caf3a..6a24b3ace3cc5 100644 --- a/tests/baselines/reference/asOperator3.types +++ b/tests/baselines/reference/asOperator3.types @@ -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; diff --git a/tests/baselines/reference/classAttributeInferenceTemplate.types b/tests/baselines/reference/classAttributeInferenceTemplate.types index 90f1f381900ba..9412c449035da 100644 --- a/tests/baselines/reference/classAttributeInferenceTemplate.types +++ b/tests/baselines/reference/classAttributeInferenceTemplate.types @@ -21,16 +21,16 @@ class MyClass { >`foo` : "foo" this.property2 = `foo-${variable}`; // Causes an error ->this.property2 = `foo-${variable}` : string +>this.property2 = `foo-${variable}` : "foo-something" >this.property2 : string >this : this >property2 : string ->`foo-${variable}` : string +>`foo-${variable}` : "foo-something" >variable : "something" const localProperty = `foo-${variable}`; // Correctly inferred as `string` ->localProperty : string ->`foo-${variable}` : string +>localProperty : "foo-something" +>`foo-${variable}` : "foo-something" >variable : "something" } } diff --git a/tests/baselines/reference/classAttributeInferenceTemplateJS.types b/tests/baselines/reference/classAttributeInferenceTemplateJS.types index 29cf5086be358..2123dad801e01 100644 --- a/tests/baselines/reference/classAttributeInferenceTemplateJS.types +++ b/tests/baselines/reference/classAttributeInferenceTemplateJS.types @@ -21,16 +21,16 @@ class MyClass { >`foo` : "foo" this.property2 = `foo-${variable}`; // Causes an error ->this.property2 = `foo-${variable}` : string +>this.property2 = `foo-${variable}` : "foo-something" >this.property2 : string >this : this >property2 : string ->`foo-${variable}` : string +>`foo-${variable}` : "foo-something" >variable : "something" const localProperty = `foo-${variable}`; // Correctly inferred as `string` ->localProperty : string ->`foo-${variable}` : string +>localProperty : "foo-something" +>`foo-${variable}` : "foo-something" >variable : "something" } } diff --git a/tests/baselines/reference/discriminantUsingEvaluatableTemplateExpression.symbols b/tests/baselines/reference/discriminantUsingEvaluatableTemplateExpression.symbols new file mode 100644 index 0000000000000..2802a4ebf47fd --- /dev/null +++ b/tests/baselines/reference/discriminantUsingEvaluatableTemplateExpression.symbols @@ -0,0 +1,37 @@ +=== tests/cases/compiler/discriminantUsingEvaluatableTemplateExpression.ts === +// repro from https://github.com/microsoft/TypeScript/issues/53888 + +type S = { d: "s"; cb: (x: string) => void }; +>S : Symbol(S, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 0, 0)) +>d : Symbol(d, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 2, 10)) +>cb : Symbol(cb, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 2, 18)) +>x : Symbol(x, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 2, 24)) + +type N = { d: "n"; cb: (x: number) => void }; +>N : Symbol(N, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 2, 45)) +>d : Symbol(d, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 3, 10)) +>cb : Symbol(cb, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 3, 18)) +>x : Symbol(x, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 3, 24)) + +declare function foo(foo: S | N): void; +>foo : Symbol(foo, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 3, 45)) +>foo : Symbol(foo, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 5, 21)) +>S : Symbol(S, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 0, 0)) +>N : Symbol(N, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 2, 45)) + +foo({ +>foo : Symbol(foo, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 3, 45)) + + d: `${"s"}`, +>d : Symbol(d, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 7, 5)) + + cb: (x) => { +>cb : Symbol(cb, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 8, 14)) +>x : Symbol(x, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 9, 7)) + + x; // string +>x : Symbol(x, Decl(discriminantUsingEvaluatableTemplateExpression.ts, 9, 7)) + + }, +}); + diff --git a/tests/baselines/reference/discriminantUsingEvaluatableTemplateExpression.types b/tests/baselines/reference/discriminantUsingEvaluatableTemplateExpression.types new file mode 100644 index 0000000000000..8f7059841a469 --- /dev/null +++ b/tests/baselines/reference/discriminantUsingEvaluatableTemplateExpression.types @@ -0,0 +1,40 @@ +=== tests/cases/compiler/discriminantUsingEvaluatableTemplateExpression.ts === +// repro from https://github.com/microsoft/TypeScript/issues/53888 + +type S = { d: "s"; cb: (x: string) => void }; +>S : { d: "s"; cb: (x: string) => void; } +>d : "s" +>cb : (x: string) => void +>x : string + +type N = { d: "n"; cb: (x: number) => void }; +>N : { d: "n"; cb: (x: number) => void; } +>d : "n" +>cb : (x: number) => void +>x : number + +declare function foo(foo: S | N): void; +>foo : (foo: S | N) => void +>foo : S | N + +foo({ +>foo({ d: `${"s"}`, cb: (x) => { x; // string },}) : void +>foo : (foo: S | N) => void +>{ d: `${"s"}`, cb: (x) => { x; // string },} : { d: "s"; cb: (x: string) => void; } + + d: `${"s"}`, +>d : "s" +>`${"s"}` : "s" +>"s" : "s" + + cb: (x) => { +>cb : (x: string) => void +>(x) => { x; // string } : (x: string) => void +>x : string + + x; // string +>x : string + + }, +}); + diff --git a/tests/baselines/reference/enumConstantMemberWithTemplateLiterals.types b/tests/baselines/reference/enumConstantMemberWithTemplateLiterals.types index 361835014450a..e5f913b710780 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.c ->`1${"2"}3` : string +>`1${"2"}3` : "123" >"2" : "2" h = `1`.length 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/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/invalidTaggedTemplateEscapeSequences(target=es2015).types b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).types index 08b1ed6844442..460a665394d13 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).types +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).types @@ -31,8 +31,8 @@ const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uwor >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 : "\\u{hello} 100 \\xtraordinary 200 wonderful 300 \\uworld" +>`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : "\\u{hello} 100 \\xtraordinary 200 wonderful 300 \\uworld" >100 : 100 >200 : 200 >300 : 300 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).types b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).types index 08b1ed6844442..460a665394d13 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).types +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).types @@ -31,8 +31,8 @@ const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uwor >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 : "\\u{hello} 100 \\xtraordinary 200 wonderful 300 \\uworld" +>`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : "\\u{hello} 100 \\xtraordinary 200 wonderful 300 \\uworld" >100 : 100 >200 : 200 >300 : 300 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).types b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).types index 08b1ed6844442..460a665394d13 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).types +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=esnext).types @@ -31,8 +31,8 @@ const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uwor >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 : "\\u{hello} 100 \\xtraordinary 200 wonderful 300 \\uworld" +>`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld` : "\\u{hello} 100 \\xtraordinary 200 wonderful 300 \\uworld" >100 : 100 >200 : 200 >300 : 300 diff --git a/tests/baselines/reference/octalLiteralAndEscapeSequence.types b/tests/baselines/reference/octalLiteralAndEscapeSequence.types index 32ed227ebb0e2..d94e278d7f9d0 100644 --- a/tests/baselines/reference/octalLiteralAndEscapeSequence.types +++ b/tests/baselines/reference/octalLiteralAndEscapeSequence.types @@ -15,43 +15,43 @@ >055 : 45 `0${00}`; ->`0${00}` : string +>`0${00}` : "00" >00 : 0 `0${05}`; ->`0${05}` : string +>`0${05}` : "05" >05 : 5 `0${000}`; ->`0${000}` : string +>`0${000}` : "00" >000 : 0 `0${005}`; ->`0${005}` : string +>`0${005}` : "05" >005 : 5 `0${055}`; ->`0${055}` : string +>`0${055}` : "045" >055 : 45 `${00}0`; ->`${00}0` : string +>`${00}0` : "00" >00 : 0 `${05}0`; ->`${05}0` : string +>`${05}0` : "50" >05 : 5 `${000}0`; ->`${000}0` : string +>`${000}0` : "00" >000 : 0 `${005}0`; ->`${005}0` : string +>`${005}0` : "50" >005 : 5 `${055}0`; ->`${055}0` : string +>`${055}0` : "450" >055 : 45 "\0"; @@ -283,106 +283,106 @@ >`\055` : "-" `${0}\0`; ->`${0}\0` : string +>`${0}\0` : "0\0" >0 : 0 `${0}\5`; ->`${0}\5` : string +>`${0}\5` : "0\u0005" >0 : 0 `${0}\00`; ->`${0}\00` : string +>`${0}\00` : "0\0" >0 : 0 `${0}\05`; ->`${0}\05` : string +>`${0}\05` : "0\u0005" >0 : 0 `${0}\55`; ->`${0}\55` : string +>`${0}\55` : "0-" >0 : 0 `${0}\000`; ->`${0}\000` : string +>`${0}\000` : "0\0" >0 : 0 `${0}\005`; ->`${0}\005` : string +>`${0}\005` : "0\u0005" >0 : 0 `${0}\055`; ->`${0}\055` : string +>`${0}\055` : "0-" >0 : 0 `\0${0}`; ->`\0${0}` : string +>`\0${0}` : "\x000" >0 : 0 `\5${0}`; ->`\5${0}` : string +>`\5${0}` : "\u00050" >0 : 0 `\00${0}`; ->`\00${0}` : string +>`\00${0}` : "\x000" >0 : 0 `\05${0}`; ->`\05${0}` : string +>`\05${0}` : "\u00050" >0 : 0 `\55${0}`; ->`\55${0}` : string +>`\55${0}` : "-0" >0 : 0 `\000${0}`; ->`\000${0}` : string +>`\000${0}` : "\x000" >0 : 0 `\005${0}`; ->`\005${0}` : string +>`\005${0}` : "\u00050" >0 : 0 `\055${0}`; ->`\055${0}` : string +>`\055${0}` : "-0" >0 : 0 `${0}\0${0}`; ->`${0}\0${0}` : string +>`${0}\0${0}` : "0\x000" >0 : 0 >0 : 0 `${0}\5${0}`; ->`${0}\5${0}` : string +>`${0}\5${0}` : "0\u00050" >0 : 0 >0 : 0 `${0}\00${0}`; ->`${0}\00${0}` : string +>`${0}\00${0}` : "0\x000" >0 : 0 >0 : 0 `${0}\05${0}`; ->`${0}\05${0}` : string +>`${0}\05${0}` : "0\u00050" >0 : 0 >0 : 0 `${0}\55${0}`; ->`${0}\55${0}` : string +>`${0}\55${0}` : "0-0" >0 : 0 >0 : 0 `${0}\000${0}`; ->`${0}\000${0}` : string +>`${0}\000${0}` : "0\x000" >0 : 0 >0 : 0 `${0}\005${0}`; ->`${0}\005${0}` : string +>`${0}\005${0}` : "0\u00050" >0 : 0 >0 : 0 `${0}\055${0}`; ->`${0}\055${0}` : string +>`${0}\055${0}` : "0-0" >0 : 0 >0 : 0 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/taggedTemplateStringsWithIncompatibleTypedTags.types b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types index 1e0acac274aec..abc62923d86c9 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTags.types @@ -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..a03e470f7b1a4 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.types @@ -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/taggedTemplateStringsWithTagsTypedAsAny.types b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types index 9bd975bb472ec..ef237754658e8 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAny.types @@ -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..800a95767978e 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTagsTypedAsAnyES6.types @@ -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..7df1c25b2278b 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTags.types @@ -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..5582a60f5dc72 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.types @@ -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/templateExpressionAsPossiblyDiscriminantValue.symbols b/tests/baselines/reference/templateExpressionAsPossiblyDiscriminantValue.symbols new file mode 100644 index 0000000000000..7c008e21cfe55 --- /dev/null +++ b/tests/baselines/reference/templateExpressionAsPossiblyDiscriminantValue.symbols @@ -0,0 +1,51 @@ +=== tests/cases/compiler/templateExpressionAsPossiblyDiscriminantValue.ts === +// repro mentioned in https://github.com/microsoft/TypeScript/issues/53888 + +type BiomePlainLinkProps = { +>BiomePlainLinkProps : Symbol(BiomePlainLinkProps, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 0, 0)) + + href: string; +>href : Symbol(href, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 2, 28)) + + onClick?: (event: string) => void; +>onClick : Symbol(onClick, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 3, 15)) +>event : Symbol(event, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 4, 13)) +} + +type BiomeButtonProps = { +>BiomeButtonProps : Symbol(BiomeButtonProps, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 5, 1)) + + href?: never; +>href : Symbol(href, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 7, 25)) + + onClick?: (event: number) => void; +>onClick : Symbol(onClick, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 8, 15)) +>event : Symbol(event, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 9, 13)) +} + +export type ClickableDiscriminatedUnion = +>ClickableDiscriminatedUnion : Symbol(ClickableDiscriminatedUnion, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 10, 1)) + + | BiomePlainLinkProps +>BiomePlainLinkProps : Symbol(BiomePlainLinkProps, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 0, 0)) + + | BiomeButtonProps; +>BiomeButtonProps : Symbol(BiomeButtonProps, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 5, 1)) + +const p3: ClickableDiscriminatedUnion = { +>p3 : Symbol(p3, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 16, 5)) +>ClickableDiscriminatedUnion : Symbol(ClickableDiscriminatedUnion, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 10, 1)) + + href: `2${undefined}332132`, +>href : Symbol(href, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 16, 41)) +>undefined : Symbol(undefined) + + onClick: (ev) => console.log('@@@@', ev), +>onClick : Symbol(onClick, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 17, 30)) +>ev : Symbol(ev, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 18, 12)) +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>ev : Symbol(ev, Decl(templateExpressionAsPossiblyDiscriminantValue.ts, 18, 12)) +} + diff --git a/tests/baselines/reference/templateExpressionAsPossiblyDiscriminantValue.types b/tests/baselines/reference/templateExpressionAsPossiblyDiscriminantValue.types new file mode 100644 index 0000000000000..fde22b280c4d6 --- /dev/null +++ b/tests/baselines/reference/templateExpressionAsPossiblyDiscriminantValue.types @@ -0,0 +1,52 @@ +=== tests/cases/compiler/templateExpressionAsPossiblyDiscriminantValue.ts === +// repro mentioned in https://github.com/microsoft/TypeScript/issues/53888 + +type BiomePlainLinkProps = { +>BiomePlainLinkProps : { href: string; onClick?: ((event: string) => void) | undefined; } + + href: string; +>href : string + + onClick?: (event: string) => void; +>onClick : ((event: string) => void) | undefined +>event : string +} + +type BiomeButtonProps = { +>BiomeButtonProps : { href?: undefined; onClick?: ((event: number) => void) | undefined; } + + href?: never; +>href : undefined + + onClick?: (event: number) => void; +>onClick : ((event: number) => void) | undefined +>event : number +} + +export type ClickableDiscriminatedUnion = +>ClickableDiscriminatedUnion : BiomePlainLinkProps | BiomeButtonProps + + | BiomePlainLinkProps + | BiomeButtonProps; + +const p3: ClickableDiscriminatedUnion = { +>p3 : ClickableDiscriminatedUnion +>{ href: `2${undefined}332132`, onClick: (ev) => console.log('@@@@', ev),} : { href: string; onClick: (ev: string) => void; } + + href: `2${undefined}332132`, +>href : string +>`2${undefined}332132` : string +>undefined : undefined + + onClick: (ev) => console.log('@@@@', ev), +>onClick : (ev: string) => void +>(ev) => console.log('@@@@', ev) : (ev: string) => void +>ev : string +>console.log('@@@@', ev) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>'@@@@' : "@@@@" +>ev : string +} + diff --git a/tests/baselines/reference/templateLiteralEscapeSequence.types b/tests/baselines/reference/templateLiteralEscapeSequence.types index 958236b577317..608b100ec6d25 100644 --- a/tests/baselines/reference/templateLiteralEscapeSequence.types +++ b/tests/baselines/reference/templateLiteralEscapeSequence.types @@ -35,132 +35,132 @@ declare function tag(template: TemplateStringsArray, ...substitutions: any[]): s >`\x00` : "\0" `${0}\u`; ->`${0}\u` : string +>`${0}\u` : "0\\u" >0 : 0 `${0}\u0`; ->`${0}\u0` : string +>`${0}\u0` : "0\\u0" >0 : 0 `${0}\u00`; ->`${0}\u00` : string +>`${0}\u00` : "0\\u00" >0 : 0 `${0}\u000`; ->`${0}\u000` : string +>`${0}\u000` : "0\\u000" >0 : 0 `${0}\u0000`; ->`${0}\u0000` : string +>`${0}\u0000` : "0\0" >0 : 0 `${0}\u{}`; ->`${0}\u{}` : string +>`${0}\u{}` : "0\\u{}" >0 : 0 `${0}\u{ffffff}`; ->`${0}\u{ffffff}` : string +>`${0}\u{ffffff}` : "0\\u{ffffff}" >0 : 0 `${0}\x`; ->`${0}\x` : string +>`${0}\x` : "0\\x" >0 : 0 `${0}\x0`; ->`${0}\x0` : string +>`${0}\x0` : "0\\x0" >0 : 0 `${0}\x00`; ->`${0}\x00` : string +>`${0}\x00` : "0\0" >0 : 0 `\u${0}`; ->`\u${0}` : string +>`\u${0}` : "\\u0" >0 : 0 `\u0${0}`; ->`\u0${0}` : string +>`\u0${0}` : "\\u00" >0 : 0 `\u00${0}`; ->`\u00${0}` : string +>`\u00${0}` : "\\u000" >0 : 0 `\u000${0}`; ->`\u000${0}` : string +>`\u000${0}` : "\\u0000" >0 : 0 `\u0000${0}`; ->`\u0000${0}` : string +>`\u0000${0}` : "\x000" >0 : 0 `\u{}${0}`; ->`\u{}${0}` : string +>`\u{}${0}` : "\\u{}0" >0 : 0 `\u{ffffff}${0}`; ->`\u{ffffff}${0}` : string +>`\u{ffffff}${0}` : "\\u{ffffff}0" >0 : 0 `\x${0}`; ->`\x${0}` : string +>`\x${0}` : "\\x0" >0 : 0 `\x0${0}`; ->`\x0${0}` : string +>`\x0${0}` : "\\x00" >0 : 0 `\x00${0}`; ->`\x00${0}` : string +>`\x00${0}` : "\x000" >0 : 0 `${0}\u${0}`; ->`${0}\u${0}` : string +>`${0}\u${0}` : "0\\u0" >0 : 0 >0 : 0 `${0}\u0${0}`; ->`${0}\u0${0}` : string +>`${0}\u0${0}` : "0\\u00" >0 : 0 >0 : 0 `${0}\u00${0}`; ->`${0}\u00${0}` : string +>`${0}\u00${0}` : "0\\u000" >0 : 0 >0 : 0 `${0}\u000${0}`; ->`${0}\u000${0}` : string +>`${0}\u000${0}` : "0\\u0000" >0 : 0 >0 : 0 `${0}\u0000${0}`; ->`${0}\u0000${0}` : string +>`${0}\u0000${0}` : "0\x000" >0 : 0 >0 : 0 `${0}\u{}${0}`; ->`${0}\u{}${0}` : string +>`${0}\u{}${0}` : "0\\u{}0" >0 : 0 >0 : 0 `${0}\u{ffffff}${0}`; ->`${0}\u{ffffff}${0}` : string +>`${0}\u{ffffff}${0}` : "0\\u{ffffff}0" >0 : 0 >0 : 0 `${0}\x${0}`; ->`${0}\x${0}` : string +>`${0}\x${0}` : "0\\x0" >0 : 0 >0 : 0 `${0}\x0${0}`; ->`${0}\x0${0}` : string +>`${0}\x0${0}` : "0\\x00" >0 : 0 >0 : 0 `${0}\x00${0}`; ->`${0}\x00${0}` : string +>`${0}\x00${0}` : "0\x000" >0 : 0 >0 : 0 diff --git a/tests/baselines/reference/templateLiteralsSourceMap.types b/tests/baselines/reference/templateLiteralsSourceMap.types index 4233343cbc880..c38ca859a69ce 100644 --- a/tests/baselines/reference/templateLiteralsSourceMap.types +++ b/tests/baselines/reference/templateLiteralsSourceMap.types @@ -1,7 +1,7 @@ === tests/cases/compiler/templateLiteralsSourceMap.ts === const s = `a${0}b${1}c${2}`; ->s : string ->`a${0}b${1}c${2}` : string +>s : "a0b1c2" +>`a${0}b${1}c${2}` : "a0b1c2" >0 : 0 >1 : 1 >2 : 2 diff --git a/tests/baselines/reference/templateStringBinaryOperations.types b/tests/baselines/reference/templateStringBinaryOperations.types index 01d306487ee01..7b8bf51bea3d6 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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >3 & 4 : number >3 : 3 >4 : 4 diff --git a/tests/baselines/reference/templateStringBinaryOperationsES6.types b/tests/baselines/reference/templateStringBinaryOperationsES6.types index 0ac9775a655ab..ad7dee965aa2b 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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >3 & 4 : number >3 : 3 >4 : 4 diff --git a/tests/baselines/reference/templateStringBinaryOperationsES6Invalid.types b/tests/baselines/reference/templateStringBinaryOperationsES6Invalid.types index 8782991b7106c..8cccba1847f53 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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >3 & 4 : number >3 : 3 >4 : 4 diff --git a/tests/baselines/reference/templateStringBinaryOperationsInvalid.types b/tests/baselines/reference/templateStringBinaryOperationsInvalid.types index 37f0149ad74db..671fbc4387924 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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "-1" >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-1" >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` : "-15" >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-15" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "12" >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 }` : "212" >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` : "125" >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` : "2125" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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 }` : "0" >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 }` : "20" >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` : "05" >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` : "205" >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/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..03be2c908f85d --- /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 comparison appears to be unintentional because the types '"abc0abc"' and '"abc"' have no overlap. +tests/cases/conformance/es6/templates/templateStringInEqualityChecks.ts(2,9): error TS2367: This comparison appears to be unintentional because 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 comparison appears to be unintentional because the types '"abc0abc"' and '"abc"' have no overlap. + `abc` !== `abc${0}abc` && + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because 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..adefc92b9fbc8 --- /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 comparison appears to be unintentional because the types '"abc0abc"' and '"abc"' have no overlap. +tests/cases/conformance/es6/templates/templateStringInEqualityChecksES6.ts(2,9): error TS2367: This comparison appears to be unintentional because 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 comparison appears to be unintentional because the types '"abc0abc"' and '"abc"' have no overlap. + `abc` !== `abc${0}abc` && + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2367: This comparison appears to be unintentional because 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 2e38c933e6e93..920a957fea39b 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`] : string ->`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 389d3367a3e62..259117ee48f36 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`] : string ->`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/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/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..2f54a3c7c06bc 100644 --- a/tests/baselines/reference/templateStringInTaggedTemplate.types +++ b/tests/baselines/reference/templateStringInTaggedTemplate.types @@ -2,7 +2,7 @@ `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 +>`${ `TAG` } ` : "TAG " >`TAG` : "TAG" >`I ${ "AM" } THE TEMPLATE PORTION` : string >"AM" : "AM" diff --git a/tests/baselines/reference/templateStringInTaggedTemplateES6.types b/tests/baselines/reference/templateStringInTaggedTemplateES6.types index dd2a4898a906c..74f003aa0c979 100644 --- a/tests/baselines/reference/templateStringInTaggedTemplateES6.types +++ b/tests/baselines/reference/templateStringInTaggedTemplateES6.types @@ -2,7 +2,7 @@ `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 +>`${ `TAG` } ` : "TAG " >`TAG` : "TAG" >`I ${ "AM" } THE TEMPLATE PORTION` : string >"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/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/templateStringWithCommentsInArrowFunction.types b/tests/baselines/reference/templateStringWithCommentsInArrowFunction.types index 7f2b2198c602b..622008fe3d2ce 100644 --- a/tests/baselines/reference/templateStringWithCommentsInArrowFunction.types +++ b/tests/baselines/reference/templateStringWithCommentsInArrowFunction.types @@ -8,7 +8,7 @@ const f1 = () => >() => `${ // a a }a` : () => string `${ ->`${ // a a }a` : string +>`${ // a a }a` : "1a" // a a @@ -21,7 +21,7 @@ const f2 = () => >() => `${ // a a }` : () => string `${ ->`${ // a a }` : string +>`${ // a a }` : "1" // a a diff --git a/tests/baselines/reference/templateStringWithEmbeddedAddition.types b/tests/baselines/reference/templateStringWithEmbeddedAddition.types index 56bc197c37764..26c57f07a3706 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` : "abc20def" >10 + 10 : number >10 : 10 >10 : 10 diff --git a/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types b/tests/baselines/reference/templateStringWithEmbeddedAdditionES6.types index 6ee46c39f57c1..97c54077183cf 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` : "abc20def" >10 + 10 : number >10 : 10 >10 : 10 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/templateStringWithEmbeddedDivision.types b/tests/baselines/reference/templateStringWithEmbeddedDivision.types index 6f8913756246c..e38f52bd4876d 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` : "abc1def" >1 / 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types b/tests/baselines/reference/templateStringWithEmbeddedDivisionES6.types index f91b3a27639ee..27d0f8d0abb45 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` : "abc1def" >1 / 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedModulo.types b/tests/baselines/reference/templateStringWithEmbeddedModulo.types index c471180956327..408f8b8e897fe 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` : "abc0def" >1 % 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types b/tests/baselines/reference/templateStringWithEmbeddedModuloES6.types index 2a1e6b602e2cb..2b14695615e0f 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` : "abc0def" >1 % 1 : number >1 : 1 >1 : 1 diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplication.types index f442ab3165bbc..5dffd546a0995 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` : "abc42def" >7 * 6 : number >7 : 7 >6 : 6 diff --git a/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types b/tests/baselines/reference/templateStringWithEmbeddedMultiplicationES6.types index 3e9f15773efba..9111074ac9f80 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` : "abc42def" >7 * 6 : number >7 : 7 >6 : 6 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/templateStringWithEmbeddedUnaryPlus.types b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlus.types index 9c6c4bc921367..cdfac3875689e 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` : "abcInfinitydef" >+Infinity : number >Infinity : number diff --git a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.types b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.types index 4a957f636e6de..83b9eaf9e0a6b 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` : "abcInfinitydef" >+Infinity : number >Infinity : number 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/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}` : " " diff --git a/tests/cases/compiler/discriminantUsingEvaluatableTemplateExpression.ts b/tests/cases/compiler/discriminantUsingEvaluatableTemplateExpression.ts new file mode 100644 index 0000000000000..17c0be879ebc6 --- /dev/null +++ b/tests/cases/compiler/discriminantUsingEvaluatableTemplateExpression.ts @@ -0,0 +1,16 @@ +// @strict: true +// @noEmit: true + +// repro from https://github.com/microsoft/TypeScript/issues/53888 + +type S = { d: "s"; cb: (x: string) => void }; +type N = { d: "n"; cb: (x: number) => void }; + +declare function foo(foo: S | N): void; + +foo({ + d: `${"s"}`, + cb: (x) => { + x; // string + }, +}); diff --git a/tests/cases/compiler/templateExpressionAsPossiblyDiscriminantValue.ts b/tests/cases/compiler/templateExpressionAsPossiblyDiscriminantValue.ts new file mode 100644 index 0000000000000..d412b84654cae --- /dev/null +++ b/tests/cases/compiler/templateExpressionAsPossiblyDiscriminantValue.ts @@ -0,0 +1,23 @@ +// @strict: true +// @noEmit: true + +// repro mentioned in https://github.com/microsoft/TypeScript/issues/53888 + +type BiomePlainLinkProps = { + href: string; + onClick?: (event: string) => void; +} + +type BiomeButtonProps = { + href?: never; + onClick?: (event: number) => void; +} + +export type ClickableDiscriminatedUnion = + | BiomePlainLinkProps + | BiomeButtonProps; + +const p3: ClickableDiscriminatedUnion = { + href: `2${undefined}332132`, + onClick: (ev) => console.log('@@@@', ev), +}