infer R extends
in template literal does not narrow correctly when extending union of literals
#52801
Labels
Duplicate
An existing issue was already created
Bug Report
π Search Terms
template literal infer extends union narrowing
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Type
GetKnownSuffix1
returns the entire extended union ('!' | '?'
) instead of the matching literal ('?'
).π Expected behavior
Type
GetKnownSuffix1
should return just the matching literal ('?'
), the same wayinfer pre extends string
inGetGenericPrefix
returns the literal type'foo'
and not the extended typestring
.The text was updated successfully, but these errors were encountered: