blob: cae88d3324b55203aa8ada110f6347d827b94b9e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
class Attr { type V ; class Val }
class StrAttr extends Attr { type V = String }
class BoolAttr extends Attr { type V = Boolean }
object Main {
def f(x: Attr) = x match {
case v: StrAttr => new v.Val
case v: BoolAttr => new v.Val
}
}
|