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
This improves the completeness of capture checking in the following case:
```scala
def run(io: IO^)(op: Op^{io}): Unit = ???
val myIO: IO^ = ???
val myOp: Op^{myIO} = ???
run(myIO)(myOp)
```
The last line previously won't work because when substitute the parameter `io`
to `myIO` in the type `(op: Op^{io}): Unit` the type `Op^{io}` get approximated
into `Nothing` contravariantly. This is an overshot since the substitution [io
:= myIO] is exact (or precise) and the approximation (or avoidance) is
unnecessary.
This commit resolves this issue by checking whether the `to` only contains
`CaptureRef` in `SubstParamsMap`. If this condition is met, then it is an exact
substitution and we can apply it on the capture set without approximations.
0 commit comments