aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/Patterns.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/Patterns.scala')
-rw-r--r--tests/pos/Patterns.scala12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/pos/Patterns.scala b/tests/pos/Patterns.scala
index fbcdc4c30..4470eb232 100644
--- a/tests/pos/Patterns.scala
+++ b/tests/pos/Patterns.scala
@@ -10,17 +10,23 @@ object Patterns {
case (digit, str) => true
case _ => false
}
-
+
+ (xs: Any) match {
+ case x: Int @unchecked => true
+ case xs: List[Int @ unchecked] => true
+ case _ => false
+ }
+
def sum(xs: List[Int]): Int = xs match {
case Nil => 0
case x :: xs1 => x + sum(xs1)
}
-
+
def len[T](xs: List[T]): Int = xs match {
case _ :: xs1 => 1 + len(xs1)
case Nil => 0
}
-
+
final def sameLength[T](xs: List[T], ys: List[T]): Boolean = xs match {
case _ :: xs1 =>
ys match {