-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
π Search Terms
"string literal is not assignable to parameter of type", "generic string literal argument"
π Version & Regression Information
- This changed between versions 5.1.6 and 5.2.2
β― Playground Link
π» Code
function fn<T>(arg: T): T {
return arg;
}
const a = '1';
const b = a + ' 2';
fn(`${b} 3`);
π Actual behavior
Argument of type '`${string} 3`' is not assignable to parameter of type '"1 2 3"'.
π Expected behavior
No errors are expected
Additional information about the issue
No response
fatcerberus, jcalz and whzx5byb
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue