diff options
author | odersky <odersky@gmail.com> | 2014-03-14 10:36:09 +0100 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2014-03-14 10:36:09 +0100 |
commit | 8be53e728408f6d546a7fe990af9cd5e99db6250 (patch) | |
tree | c4f697db440f432a062c743e7b6848c48fa439d8 /tests/pos | |
parent | f28d7a9423948626f6314b8c6d928b3048433efd (diff) | |
parent | 722661c0bada3a8e64512bda2ac7501b1c02ec10 (diff) | |
download | dotty-8be53e728408f6d546a7fe990af9cd5e99db6250.tar.gz dotty-8be53e728408f6d546a7fe990af9cd5e99db6250.tar.bz2 dotty-8be53e728408f6d546a7fe990af9cd5e99db6250.zip |
Merge pull request #70 from odersky/fix/annotations-in-patterns
Fixed two problems with annotated types in patterns
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/Patterns.scala | 12 |
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 { |