Closed
Description
Compiler version
main
Minimized code
import language.experimental.captureChecking
trait Resource
def id[X](x: X): x.type = x
def foo[M <: Resource](r: M^) = id(r)
Output
-- [E007] Type Mismatch Error: issues/cc-setup-impure-classes.scala:5:35 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
5 |def foo[M <: Resource](r: M^) = id(r)
| ^
| Found: (r : M^)
| Required: M
|
| longer explanation available when compiling with `-explain`
1 error found
Expectation
It should work.