subtype: Try removing ill-motivated code-path (#61942)
The code-path I'm removing in this PR doesn't make much sense to me - the comment that goes before it makes a true statement, but this is not the place that should be detecting this. I suspect that this code path was necessary earlier in the life of the type system but was working around a bug that has since been fixed. If there are remaining cases that trigger this, it would be good to find them, since test/subtype.jl doesn't have any. It would be nice to remove it because it's structurally a bit odd - it compares the `ub` and the `lb` from a non-existential typevar, but subtyping doesn't adjust these, so if they are in fact equal, then probably unionall introduction should have figured that out upon introduction, rather than recursing down this path deep in the leaves. Additionally, one of the code paths (but not the other) only triggers on PARAM_INVARIANT, which is not supposed to have a semantic affect outside of the diagonal rule. So let's find out if there is any code that depends on this. If so, we can see if there's a structurally better way to handle this case, if not, we can just merge this. While we're at it, also pull up the lookup into the caller so we don't have to duplicate that work.
K
Keno Fischer committed
9be3e739882a6337405bea4e8d8e393b4eee9ede
Parent: 78abefd
Committed by GitHub <noreply@github.com>
on 5/29/2026, 10:29:08 PM