๐ Search Terms
template literal union distributive conditional type
๐ Version & Regression Information
5.4.5 and Nightly
โฏ Playground Link
https://www.typescriptlang.org/play/?ts=5.4.5#code/C4TwDgpgBAYg9nAclAvFABgMwQEgN4DkAjAAwkFQA+UAFOvgHYCuAtgEYQBOAvulAGRQ83AJS8A3ACgA9NKihIsBMjRZceenmbsuvAUO68ZciAA9IAY2AQAJqigAibHFIkHVDM-ybtHHn0FhXiA
๐ป Code
type FooN = `foo${'100' | (`${number}` & {})}`;
// type FooN = `foo${`${number}` & {}}`
// expected = "foo100" | `foo${`${number}` & {}}`
๐ Actual behavior
'100' and `${number}` & {} are being simplified to `${number}` & {}. FooN does not have autocomplete for 'foo100'
๐ Expected behavior
FooN should be of type "foo100" | `foo${`${number}` & {}} and provide autocomplete for foo100 while allowing foo101 or any other number
Additional information about the issue
No response
๐ Search Terms
template literal union distributive conditional type
๐ Version & Regression Information
5.4.5 and Nightly
โฏ Playground Link
https://www.typescriptlang.org/play/?ts=5.4.5#code/C4TwDgpgBAYg9nAclAvFABgMwQEgN4DkAjAAwkFQA+UAFOvgHYCuAtgEYQBOAvulAGRQ83AJS8A3ACgA9NKihIsBMjRZceenmbsuvAUO68ZciAA9IAY2AQAJqigAibHFIkHVDM-ybtHHn0FhXiA
๐ป Code
๐ Actual behavior
'100'and`${number}` & {}are being simplified to`${number}` & {}.FooNdoes not have autocomplete for'foo100'๐ Expected behavior
FooNshould be of type"foo100" | `foo${`${number}` & {}}and provide autocomplete forfoo100while allowingfoo101or any other numberAdditional information about the issue
No response