๐ Search Terms
string literal autocomplete template
๐ Version & Regression Information
- This changed between versions 5.3.2 and 5.3.3
โฏ Playground Link
https://www.typescriptlang.org/play?ts=5.3.3#code/C4TwDgpgBAYg9nKBeKByA9AMwaqAfNLBdALgEsATXAgAyLnQBIBvAZ2ACcyA7AcygBkUZgF8RNAFASAxnG7soAIwCGHEvEQpUqIA
๐ป Code
type Foo = '/foo' | '/foo/:id' | `/foo/${string & {}}`
const bar:Foo = ''
๐ Actual behavior
bar only gives /foo as a suggestion.
๐ Expected behavior
bar gives /foo and /foo/:id as a suggestion.
Additional information about the issue
I understand that the autocomplete is a longer ongoing issue in combination with string literals. However there was a workaround described in (among other places): #29729
This workaround (string & {}) still works as long as it is not inside a template literal. But stopped working inside a template literal since v5.3.3.