From ab6766c0dc5f47ef8e5a92c96707d1c3d958f255 Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Fri, 12 Sep 2014 12:10:29 +0200 Subject: Several fixes to patmat. Now patmat passes tests but erasure fails. --- tests/pos/Patterns.scala | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/pos') diff --git a/tests/pos/Patterns.scala b/tests/pos/Patterns.scala index f7994a093..7bb5005f9 100644 --- a/tests/pos/Patterns.scala +++ b/tests/pos/Patterns.scala @@ -1,9 +1,9 @@ -object Patterns {/* - ('1', "1") match { +object Patterns { + /*('1', "1") match { case (digit, str) => true case _ => false } - +*/ object Breakdown { def unapplySeq(x: Int): Some[List[String]] = Some(List("", "there")) } @@ -16,7 +16,7 @@ object Patterns {/* } } - val names = List("a", "b", "c") + /*val names = List("a", "b", "c") object SeqExtractors { val y = names match { case List(x, z) => x @@ -49,14 +49,14 @@ object Patterns {/* 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 { - case _ :: ys1 => sameLength(xs1, ys1) - case _ => false - } - case _ => ys.isEmpty - } + case _ :: xs1 => xs1.isEmpty + // ys match { + // case _ :: ys1 => sameLength(xs1, ys1) + // case _ => false + // } + //case _ => ys.isEmpty + }*/ } -- cgit v1.2.3