[5.0.2]: const-like inference is not preserved in conditionally requirable intersected object #53320
Labels
Working as Intended
The behavior described is the intended behavior; this is not a bug
Bug Report
π Search Terms
const-like inference, const type parameter, conditionally require
π Version & Regression Information
5.0.2
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Using an extends check to conditionally intersect an object to make a property required or unallowed does or does not preserve const-like inference, depending on the complexity of that check.
If it is a simpler check, such as extending a primitive, const-like inference is used. If it is a check extending a template literal, the inference is lost.
π Expected behavior
The complexity of the check to conditionally intersect the object should not determine whether const-like inference is used.
Potentially related to #53307
The text was updated successfully, but these errors were encountered: