blob: ef25bb2c7ccfd16c742e63bdcf31e46fbfacbccc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
object Test {
val Nil = scala.Nil
val X = 5
object Inner {
val Y = false
}
def foo1a[T](l: List[T]) = l match {
case x::xs => false
}
def foo1b[T](l: List[T]) = l match {
case Nil => true
case x::xs => false
}
def foo1c[T](l: List[T]) = l match {
case Test.Nil => true
case x::xs => false
}
def foo2(b: Boolean) = b match {
case Inner.Y => false
}
def foo3(x: Int) = x match {
case X => 0
}
}
|