Skip to content

Commit e50646c

Browse files
committed
Minor improvements to tests (remove old comments)
1 parent a4516ea commit e50646c

File tree

7 files changed

+7
-22
lines changed

7 files changed

+7
-22
lines changed

tests/pos/hygiene.scala

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
1-
// Illustrates a failure with hygiene.
1+
// Illustrates a use case where we need hygiene.
22

33
object hygiene {
44

55
class D[T]
66

77
case class C[T](x: D[T])
8-
// gives
8+
// without hygiene, this gave
99
// 7: error: wrong number of type arguments for hygiene.C.D, should be 0
1010
// 7: error: constructor C in class C does not take type parameters
11-
//
12-
// The second error message is straightforward to fix using a refTypeTree for C in
13-
// desugar.classDef.classTypeRef, but the first one is much harder.
14-
1511

1612
object C {
17-
1813
class C
19-
20-
// class D
21-
2214
}
2315

2416
val c = C.apply(new D)

tests/pos/t0061.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ object O {
22

33
class testClass ;
44

5-
case class testA() extends testClass ; // works if you leave away "extends..."
6-
// or if you write TestA
5+
case class testA() extends testClass ;
6+
77
def ga( x:testClass ) = x match {
88
case testA() => ()
99
}

tests/pos/t0066.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class GBTree[A, B] /*with Map[A, B, GBTree[A,B]]*/ {
1+
class GBTree[A, B] {
22
abstract class Tree[A,B];
33
case class Node[A,B](key:A,value:B,smaller:Node[A,B],bigger:Node[A,B])
44
extends Tree[A,B];

tests/pos/t0069.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
object testCQ {
2-
// why does this not work directly
3-
case class Thing( name:String, contains:List[ Thing ] );
42

5-
/* ... but this one does?
6-
abstract class T;
7-
case class Thing2( name:String, contains:List[ T ] ) extends T;
8-
*/
3+
case class Thing( name:String, contains:List[ Thing ] );
94

105
}

tests/pos/t0076.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// This is extracted from a test file => don't add a new test file.
21
object bug {
32
def foo(i: => Int): Int = 0;
43

tests/pos/t0082.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ object Main {
44
def min0[A](less: (A, A) => Boolean, xs: List[A]): Option[A] = xs match {
55
case List() => None
66
case List(x) => Some(x)
7-
// case x :: Nil => Some(x)
87
case y :: ys => (min0(less, ys): @unchecked) match {
98
case Some(m) => if (less(y, m)) Some(y) else Some(m)
109
}

tests/pos/t0091.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class Bug {
22
def main(args: Array[String]) = {
3-
var msg: String = null; // no bug if "null" instead of "_"
3+
var msg: String = null;
44
val f: PartialFunction[Any, Unit] = { case 42 => msg = "coucou" };
55
}
66
}

0 commit comments

Comments
 (0)