blob: 34c02c3062e7453be53d92db368aae8613b25b81 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
case class B(var x: Int) {
def succ(): Unit = {
x = x + 1
}
}
object Test {
def main(args: Array[String]): Unit = {
val b = B(0)
b match {
case B(x) =>
//println(x)
b.succ()
println(x)
}
}
}
|