This will get you a compiler crash in every version of Scala 2.x. I'm surprised I never noticed this before. Is there a ticket for this already? trait X { type Z } trait Y { type Z } type A = X { type Z = Int } type B = Y { type Z = Char } implicitly[A with B =:= B with A]
-
-
Given a value of type `A & B`, you can prove its Z member is equal to Int and to Char. It's fine because there are no such values. Without type projections (which are known to be unsound in general): (x: A & B) => implicitly[x.Z =:= Int] But you can't call that function.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.