Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is to avoid unneeded new LazyRef's. LazyRefs, which are created for recursive types, aren't cacheable, so if you TypeMap an AppliedType with one, it will create a brand new instance. OrderingConstraint#init runs AvoidWildcardsMap on param bounds. So when instDirection compares the constraint bounds and the original param bounds (to calculate the instantiate direction), because they are new instances they won't shortcircuit, leading to a recursion overflow. By forcing, it will eq check and return true. In particular, with i5877, which is a neg test of recursive overflows, the new implementation of interpolateTypeVars does more type comparisons (to calculate the instDirection). If the LazyRefs are kept eq, then the AppliedTypes in the bounds are also eq, and so the subtyping check shortcircuits true, rather than overflowing.
- Loading branch information