Add test case for taggedTemplate with symbol param and number return
This commit is contained in:
parent
fc08ff5a36
commit
4e5c7be228
4 changed files with 57 additions and 0 deletions
|
@ -0,0 +1,17 @@
|
|||
//// [taggedTemplateStringWithSymbolExpression01.ts]
|
||||
// taggedTemplateStringWithSymbolExpression01.ts
|
||||
|
||||
declare function foo(template: any, val: symbol): number;
|
||||
let x!: symbol;
|
||||
|
||||
let result: number = foo`${x}`;
|
||||
|
||||
|
||||
//// [taggedTemplateStringWithSymbolExpression01.js]
|
||||
// taggedTemplateStringWithSymbolExpression01.ts
|
||||
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
var x;
|
||||
var result = foo(__makeTemplateObject(["", ""], ["", ""]), x);
|
|
@ -0,0 +1,16 @@
|
|||
=== tests/cases/compiler/taggedTemplateStringWithSymbolExpression01.ts ===
|
||||
// taggedTemplateStringWithSymbolExpression01.ts
|
||||
|
||||
declare function foo(template: any, val: symbol): number;
|
||||
>foo : Symbol(foo, Decl(taggedTemplateStringWithSymbolExpression01.ts, 0, 0))
|
||||
>template : Symbol(template, Decl(taggedTemplateStringWithSymbolExpression01.ts, 2, 21))
|
||||
>val : Symbol(val, Decl(taggedTemplateStringWithSymbolExpression01.ts, 2, 35))
|
||||
|
||||
let x!: symbol;
|
||||
>x : Symbol(x, Decl(taggedTemplateStringWithSymbolExpression01.ts, 3, 3))
|
||||
|
||||
let result: number = foo`${x}`;
|
||||
>result : Symbol(result, Decl(taggedTemplateStringWithSymbolExpression01.ts, 5, 3))
|
||||
>foo : Symbol(foo, Decl(taggedTemplateStringWithSymbolExpression01.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(taggedTemplateStringWithSymbolExpression01.ts, 3, 3))
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
=== tests/cases/compiler/taggedTemplateStringWithSymbolExpression01.ts ===
|
||||
// taggedTemplateStringWithSymbolExpression01.ts
|
||||
|
||||
declare function foo(template: any, val: symbol): number;
|
||||
>foo : (template: any, val: symbol) => number
|
||||
>template : any
|
||||
>val : symbol
|
||||
|
||||
let x!: symbol;
|
||||
>x : symbol
|
||||
|
||||
let result: number = foo`${x}`;
|
||||
>result : number
|
||||
>foo`${x}` : number
|
||||
>foo : (template: any, val: symbol) => number
|
||||
>`${x}` : string
|
||||
>x : symbol
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
// taggedTemplateStringWithSymbolExpression01.ts
|
||||
|
||||
declare function foo(template: any, val: symbol): number;
|
||||
let x!: symbol;
|
||||
|
||||
let result: number = foo`${x}`;
|
Loading…
Reference in a new issue