//Split definition: package minimal trait Consts { trait Exp[+T] case class Const[+T](t: T) extends Exp[T] def eval[T](term: Exp[T]): T = term match { case Const(t) => t } } //from example of unsoundness: object Unsound extends Consts { class UnsoundConst(t: String) extends Const[Any](t) with Exp[Boolean] val inst = new UnsoundConst("") //inst: Exp[Boolean] val unsound1 = eval(inst) }