mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge pull request #22251 from jack-williams/jack-williams/no-implicit-symbol-to-string
Fix #19666: Check for symbol types in template expressions
This commit is contained in:
@@ -19684,7 +19684,9 @@ namespace ts {
|
||||
// A place where we actually *are* concerned with the expressions' types are
|
||||
// in tagged templates.
|
||||
forEach(node.templateSpans, templateSpan => {
|
||||
checkExpression(templateSpan.expression);
|
||||
if (maybeTypeOfKind(checkExpression(templateSpan.expression), TypeFlags.ESSymbolLike)) {
|
||||
error(templateSpan.expression, Diagnostics.Type_0_cannot_be_converted_to_type_1, typeToString(esSymbolType), typeToString(stringType));
|
||||
}
|
||||
});
|
||||
|
||||
return stringType;
|
||||
|
||||
Reference in New Issue
Block a user