Sorry for non-descriptive title. Typelevel computation are not too common theme in the internet to establish precise terms.
I tried to use typelevel computations and suddenly get spurious errors every here and there. I just could not comprehend why so little difference matters. I managed to forge another concise example:
trait Sample {
type X
type DX[I <: X] <: Nothing
type EX[I <: X] = Nothing
}
type Aux[I] = Sample {type X = I}
type U1 = Aux[Int]#DX[Int] // ok
type U2 = Aux[Int]#EX[Int] // fails
The error message is:
error: type arguments [Int] do not conform to type EX's type parameter bounds [I <: Sample.this.X]
type U2 = Aux[Int]#EX[Int]
^
But the EX
and DX
had the same type parameter bounds. Why it is right in one case and wrong in the another?