blob: 7aa24f459947f49d6d65a5a154c54831f121df37 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
class Casey1(val a: Int) {
def isDefined: Boolean = true
def isDefined(x: Int): Boolean = ???
def get: Int = a
def get(x: Int): String = ???
}
object Casey1 { def unapply(a: Casey1) = a }
object Test {
def main(args: Array[String]): Unit = {
val c @ Casey1(x) = new Casey1(0)
assert(x == c.get)
}
}
|