Cannot define a matching template literal type to a defined template literal ยท Issue #43143 ยท microsoft/TypeScript (original) (raw)
Bug Report
๐ Search Terms
string, template, literal, type
๐ Version & Regression Information
This is the behavior in every version I tried, including Nightly
โฏ Playground Link
Playground link with relevant code
๐ป Code
function getCardTitle(title: string): test-${string}
{
return test-${title}
;
}
๐ Actual behavior
TS infers the type string
for the returned string, instead of the templated type.
๐ Expected behavior
No error!