You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typePrefixes="foo"|"bar";// Create a type which is an set of stringstypeAllPrefixData="foo:baz"|"bar:baz";// Then create a generic type that generates a compliant member of that settypePrefixData<PextendsPrefixes>= `${P}:baz`;// Create an interface with a generic that expects E to extend AllPrefixData.// However, even though PrefixData<P> is a valid member of AllPrefixData,// it will be rejected in 4.3.0.interfaceITest<PextendsPrefixes,EextendsAllPrefixData=PrefixData<P>>{blah: string}
π Actual behavior
TypeScript 4.3.0-dev rejects the assignment with the following nonsense error:
Type '`${P}:baz`' does not satisfy the constraint 'AllPrefixData'.
Type '`${P}:baz`' is not assignable to type '"bar:baz"'.
'E' is declared but its value is never read.
π Expected behavior
This should be a legal assignment, and was until 4.3.0-dev.
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
Template Literal Generic
Template Literal Discrimination
Template Literal Resolution
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
TypeScript 4.3.0-dev rejects the assignment with the following nonsense error:
π Expected behavior
This should be a legal assignment, and was until 4.3.0-dev.
The text was updated successfully, but these errors were encountered: