blob: bbd0f2e7ed539de8748af3e4ec64519291a38771 (
plain) (
tree)
|
|
package patmat
abstract class BaseType
case class CaseOne(x: Int, y: List[Int]) extends BaseType
case class CaseTwo(str: String) extends BaseType
class PatMatTests {
def foo(x: BaseType) {
x match {
case CaseOne/*#*/(10, first :: second :: Nil) =>
val tmp = 23
println(first/*#*/)
println(tmp/*#*/)
case CaseTwo/*#*/(mystring) =>
println(mystring/*#*/)
}
}
def multipleAssign() {
val (x, y) = ("abc", "def")
println(x/*#*/, y/*#*/)
}
}
|