TypL icon indicating copy to clipboard operation
TypL copied to clipboard

Treat tagged template literal as a function call expression

Open getify opened this issue 6 years ago • 1 comments

function foo(x = number) {
   return true;
}

var x = foo`world`;

foo`world` should be validated as a call-expression, including both the template-literal (`world`) being validated as the first argument, as well as the return value type being implied to x.

getify avatar Feb 23 '19 18:02 getify

Actually, template tag functions of course always have an array of strings (str[]) as their first argument... so the foo call-site shape should fail to match the function signature as indicated by that function declaration.

getify avatar Mar 13 '22 22:03 getify