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
Avoid infinite loop in type variable instantiation
Rename `checkNonCyclic` to `occursAtToplevel` and refactor it to return
a boolean, use it in `ConstraintHandling#instanceType` to make sure we
do not introduce a cycle when instantiating a type variable.
Some alternatives I considered:
- Run `widenInferred` inside frozen constraints: this prevents
`Set[A] | Set[Int]` to be widened to `Set[Int]` after instantiating
`A := Int`
- Run `widenInferred` with the upper bound of `param` instead of `param`
itself as a bound: I think this is still not safe because the upper
bound of `param` might recursively refer to `param`, it also breaks
type inference of one expression in ZIO.
0 commit comments