Open
Description
Adding MapView
to the capture checking standard library tests (here) works fine before using levels for capture escape checking.
However, on the main
branch after #18463, we get the following error:
-- [E007] Type Mismatch Error: tests/pos-special/stdlib/collection/MapView.scala:45:99 ---------------------------------
45 | override def filterKeys(p: K => Boolean): MapView[K, V]^{this, p} = new MapView.FilterKeys(this, p)
| ^
| Found: K ->{p} Boolean
| Required: box K^? => Boolean
|--------------------------------------------------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
| Tree: p
| I tried to show that
| K ->{p} Boolean
| conforms to
| box K^? => Boolean
| but the comparison trace ended with `false`:
|
| ==> K ->{p} Boolean <: box K^? => Boolean
| ==> subcaptures {p} <:< {cap}
| <== subcaptures {p} <:< {cap} = {cap}
| ==> subcaptures {p} <:< {cap}
| <== subcaptures {p} <:< {cap} = {cap}
| <== K ->{p} Boolean <: box K^? => Boolean = false
|
| The tests were made under the empty constraint
--------------------------------------------------------------------------------------------------------------------
I still expected it to conform, but I am not familiar with the new changes using levels.