diff options
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/hygiene.scala | 12 | ||||
-rw-r--r-- | tests/pos/t0061.scala | 4 | ||||
-rw-r--r-- | tests/pos/t0066.scala | 2 | ||||
-rw-r--r-- | tests/pos/t0069.scala | 7 | ||||
-rw-r--r-- | tests/pos/t0076.scala | 1 | ||||
-rw-r--r-- | tests/pos/t0082.scala | 1 | ||||
-rw-r--r-- | tests/pos/t0091.scala | 2 |
7 files changed, 7 insertions, 22 deletions
diff --git a/tests/pos/hygiene.scala b/tests/pos/hygiene.scala index 25f234959..9bbf73c0f 100644 --- a/tests/pos/hygiene.scala +++ b/tests/pos/hygiene.scala @@ -1,24 +1,16 @@ -// Illustrates a failure with hygiene. +// Illustrates a use case where we need hygiene. object hygiene { class D[T] case class C[T](x: D[T]) -// gives +// without hygiene, this gave // 7: error: wrong number of type arguments for hygiene.C.D, should be 0 // 7: error: constructor C in class C does not take type parameters -// -// The second error message is straightforward to fix using a refTypeTree for C in -// desugar.classDef.classTypeRef, but the first one is much harder. - object C { - class C - -// class D - } val c = C.apply(new D) diff --git a/tests/pos/t0061.scala b/tests/pos/t0061.scala index dd3f94f30..8a3aed7c6 100644 --- a/tests/pos/t0061.scala +++ b/tests/pos/t0061.scala @@ -2,8 +2,8 @@ object O { class testClass ; - case class testA() extends testClass ; // works if you leave away "extends..." - // or if you write TestA + case class testA() extends testClass ; + def ga( x:testClass ) = x match { case testA() => () } diff --git a/tests/pos/t0066.scala b/tests/pos/t0066.scala index 2153264e7..8ac328908 100644 --- a/tests/pos/t0066.scala +++ b/tests/pos/t0066.scala @@ -1,4 +1,4 @@ -class GBTree[A, B] /*with Map[A, B, GBTree[A,B]]*/ { +class GBTree[A, B] { abstract class Tree[A,B]; case class Node[A,B](key:A,value:B,smaller:Node[A,B],bigger:Node[A,B]) extends Tree[A,B]; diff --git a/tests/pos/t0069.scala b/tests/pos/t0069.scala index e4c242c0e..23a25dbec 100644 --- a/tests/pos/t0069.scala +++ b/tests/pos/t0069.scala @@ -1,10 +1,5 @@ object testCQ { - // why does this not work directly - case class Thing( name:String, contains:List[ Thing ] ); - /* ... but this one does? - abstract class T; - case class Thing2( name:String, contains:List[ T ] ) extends T; - */ + case class Thing( name:String, contains:List[ Thing ] ); } diff --git a/tests/pos/t0076.scala b/tests/pos/t0076.scala index 5419cf515..bac26f2ab 100644 --- a/tests/pos/t0076.scala +++ b/tests/pos/t0076.scala @@ -1,4 +1,3 @@ -// This is extracted from a test file => don't add a new test file. object bug { def foo(i: => Int): Int = 0; diff --git a/tests/pos/t0082.scala b/tests/pos/t0082.scala index 2b365ca33..2a9e549b1 100644 --- a/tests/pos/t0082.scala +++ b/tests/pos/t0082.scala @@ -4,7 +4,6 @@ object Main { def min0[A](less: (A, A) => Boolean, xs: List[A]): Option[A] = xs match { case List() => None case List(x) => Some(x) -// case x :: Nil => Some(x) case y :: ys => (min0(less, ys): @unchecked) match { case Some(m) => if (less(y, m)) Some(y) else Some(m) } diff --git a/tests/pos/t0091.scala b/tests/pos/t0091.scala index d491b7cfb..414e2c931 100644 --- a/tests/pos/t0091.scala +++ b/tests/pos/t0091.scala @@ -1,6 +1,6 @@ class Bug { def main(args: Array[String]) = { - var msg: String = null; // no bug if "null" instead of "_" + var msg: String = null; val f: PartialFunction[Any, Unit] = { case 42 => msg = "coucou" }; } } |