Closed
Description
Compiler version
Latest main
(23469a1)
Minimized code
import language.experimental.captureChecking
import caps.*
trait A
extension (a: A^{cap.rd})
def await = ()
def awaitA[C <: {cap.rd}](a: A^{C}) = a.await
Output
-- [E007] Type Mismatch Error: ../dotty-test/upcast-rd.scala:11:38 -------------
11 |def awaitA[C <: {cap.rd}](a: A^{C}) = a.await
| ^
|Found: (a : test.upcastrd.A^{C})
|Required: test.upcastrd.A^{cap.rd}
|
|where: cap is a fresh root capability created in method awaitA when checking argument to parameter a of method await
|
| longer explanation available when compiling with `-explain`
Expectation
Should compile.