1 2 3 4 5 6 7 8 9 10 11 12 13
trait Elems { sealed class Elem[A] extends Dummy val UnitElement: Elem[Unit] trait Dummy } class BadMatch[A <: Elems](a: A) { private def toLuaValue(eX: a.Elem[_]): String = eX match { case a.UnitElement => "" // type mismatch } }