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
{{ message }}
Repository navigation
Experiment short-circuiting of union distribution #47511
Naively, when evaluating M, we need to check if every member of HugeUnion1 is present in HugeUnion2. However, let's say we saw this (in the sorted form):
After evaluating "a", we have a true. After evaluating "q", we have a false. We can skip the rest of the list since no subsequent result will change the answer (because T does not appear in the conditional result)
Moreover, if instead of false we had never, we could immediately stop after seeing true, since true | never is just true
Seems like this would use similar rules as Anders Hejlsberg (@ahejlsberg)'s #46429, right? You can avoid distribution and just map to a set of possibilities for A extends B ? C : D when
The check-type (A) appears in neither branch and
The extends type (B) has no infer positions
With the possibilities never, C, D, C | D, and possibly any (?)
Activity
DanielRosenwasser commentedon Jan 20, 2022
Seems like this would use similar rules as Anders Hejlsberg (@ahejlsberg)'s #46429, right? You can avoid distribution and just map to a set of possibilities for
A extends B ? C : DwhenA) appears in neither branch andB) has noinferpositionsWith the possibilities
never,C,D,C | D, and possiblyany(?)jakebailey commentedon Mar 18, 2023
With #53192 merged, I think that this one is effectively "done"