Closed
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 3.2
Search Terms: NoSubstitutionTemplateLiteral, generic parameter, string type, string literal type
Code
const x: Promise<`hi`>Expected behavior:
No error.
Actual behavior:
There are errors as it doesn't accept the string literal as a type param for the generic class.
Playground Link: link
Related Issues:
This idea was touched on by #17704, but this use case was missed.
Reacted by Felix Edelmann, Avi Nerenberg and Tyler Murphy
Reacted by Avi Nerenberg
Reacted by Avi Nerenberg
Reacted by Avi Nerenberg
Reacted by Avi Nerenberg
Metadata
Metadata
Assignees
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Activity
[-]Generic parameter string literal type errors when using NoSubstitutionTemplateLiteral[/-][+]Permit using template strings as literal types[/+][-]Permit using template strings as literal types[/-][+]Permit using template strings for string literal types[/+]ericbf commentedon Nov 1, 2022
This seems to be working now. Dunno when it was fixed—marking this as done.