-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Unmapped type from capture checking with levels #18554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
area:experimental:cc
Capture checking related
Comments
Explicitly declaring the self type of -- [E007] Type Mismatch Error: tests/pos-special/stdlib/collection/MapView.scala:46:93 ---------------------------------
46 | override def filterKeys(p: K => Boolean): MapView[K, V]^{this, p} = new MapView.FilterKeys(this, p)
| ^^^^
| Found: (MapView.this : scala.collection.MapView[K, V]^{cap[MapView]})
| Required: scala.collection.MapOps[box K^?, box V^?, scala.collection.MapView.SomeIterableConstr, ?]^
|--------------------------------------------------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
| Tree: this
| I tried to show that
| (MapView.this : scala.collection.MapView[K, V]^{cap[MapView]})
| conforms to
| scala.collection.MapOps[box K^?, box V^?, scala.collection.MapView.SomeIterableConstr, ?]^
| but the comparison trace ended with `false`:
|
| ==> (MapView.this : scala.collection.MapView[K, V]^{cap[MapView]}) <: scala.collection.MapOps[box K^?, box V^?, scala.collection.MapView.SomeIterableConstr, ?]^
| ==> subcaptures {MapView.this} <:< {cap}
| <== subcaptures {MapView.this} <:< {cap} = {cap}
| ==> scala.collection.MapView[K, V]^{MapView.this} <: scala.collection.MapOps[box K^?, box V^?, scala.collection.MapView.SomeIterableConstr, ?]^ (left is approximated)
| ==> subcaptures {MapView.this} <:< {cap}
| <== subcaptures {MapView.this} <:< {cap} = {cap}
| ==> subcaptures {MapView.this} <:< {cap}
| <== subcaptures {MapView.this} <:< {cap} = {cap}
| <== scala.collection.MapView[K, V]^{MapView.this} <: scala.collection.MapOps[box K^?, box V^?, scala.collection.MapView.SomeIterableConstr, ?]^ (left is approximated) = false
| <== (MapView.this : scala.collection.MapView[K, V]^{cap[MapView]}) <: scala.collection.MapOps[box K^?, box V^?, scala.collection.MapView.SomeIterableConstr, ?]^ = false
|
| The tests were made under the empty constraint
-------------------------------------------------------------------------------------------------------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:I still expected it to conform, but I am not familiar with the new changes using levels.
The text was updated successfully, but these errors were encountered: