Why does intellij not accept this scala code

201 Views Asked by At

The following code is compiling just fine with nsc:

trait A {
  type B[+T]
  type C[+T] <: B[T]
  def c: C[Int]
}

object Q {
  val a: A = ???
  val b: a.B[Int] = a.c
}

but intellij doesn't accept it with the error message

expression of type Q.a.C[Int] doesn't conform to expected type Q.a.B[Int]

Why is this the case? Is it defined somewhere what subset of Scala is allowed in IntelliJ?

0

There are 0 best solutions below