## Compiler version 3.0.0 ## Minimized code ```Scala object X { class CA[A] type C = CA[_] val c: C = ??? def f[A](r: CA[A]) = () // works f(c) // works val x = c.asInstanceOf[C] f(x) // error f(c.asInstanceOf[C]) // works f(c.asInstanceOf[c.type]) } ``` ## Output ``` [error] -- [E007] Type Mismatch Error: a.scala:16:18 [error] 16 | f(c.asInstanceOf[C]) [error] | ^^^^^^^^^^^^^^^^^ [error] | Found: X.C [error] | Required: X.CA[A] [error] | [error] | where: A is a type variable [error] one error found ``` ## Expectation No error.