TypeScript/tests/baselines/reference/templateLiteralsInTypes.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

15 lines
411 B
TypeScript

//// [templateLiteralsInTypes.ts]
const f = (hdr: string, val: number) => `${hdr}:\t${val}\r\n` as `${string}:\t${number}\r\n`;
f("x").foo;
//// [templateLiteralsInTypes.js]
"use strict";
var f = function (hdr, val) { return "".concat(hdr, ":\t").concat(val, "\r\n"); };
f("x").foo;
//// [templateLiteralsInTypes.d.ts]
declare const f: (hdr: string, val: number) => `${string}:\t${number}\r\n`;