trait Expr class Sum(val left : Expr, val right : Expr) : Expr fun evalWhen(e : Expr) : Int = when (e) { is Sum -> e. } // EXIST: left, right