TypeScript/tests/baselines/reference/noImplicitSymbolToString.js
LowR cd0434aa76
fix(39744): make template literals more spec compliant (#45304)
* fix(39744): make template literals more spec compliant

* Add evaluation test for template literals

* Add test for template literals with source map
2021-10-13 12:03:31 -07:00

27 lines
736 B
TypeScript

//// [noImplicitSymbolToString.ts]
// Fix #19666
let symbol!: symbol;
let str = "hello ";
const templateStr = `hello ${symbol}`;
const appendStr = "hello " + symbol;
str += symbol;
let symbolUnionNumber!: symbol | number;
let symbolUnionString!: symbol | string;
const templateStrUnion = `union with number ${symbolUnionNumber} and union with string ${symbolUnionString}`;
//// [noImplicitSymbolToString.js]
// Fix #19666
var symbol;
var str = "hello ";
var templateStr = "hello ".concat(symbol);
var appendStr = "hello " + symbol;
str += symbol;
var symbolUnionNumber;
var symbolUnionString;
var templateStrUnion = "union with number ".concat(symbolUnionNumber, " and union with string ").concat(symbolUnionString);