From d6816e01433d88b474bbd0a7290bdc96890b9f37 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 19 Jan 2011 03:53:44 +0000 Subject: Moved and removed a bunch of tests from pending. --- test/files/pos/t0644.scala | 12 ++++++++++++ test/files/run/bug3530.check | 1 + test/files/run/bug3530.scala | 9 +++++++++ test/pending/neg/t796.scala | 20 ++++++++++++++++++++ test/pending/pos/t0576.scala | 9 --------- test/pending/pos/t0644.scala | 11 ----------- test/pending/pos/t0756.scala | 8 -------- test/pending/pos/t0805.scala | 9 --------- test/pending/pos/t1003.scala | 3 --- test/pending/pos/t1004.scala | 6 ------ test/pending/pos/t1024.scala | 4 ---- test/pending/pos/t2099.scala | 27 --------------------------- test/pending/pos/t2173.scala | 25 ++++++++++--------------- test/pending/pos/t2625.scala | 9 --------- test/pending/pos/t425variant.scala | 10 ---------- test/pending/pos/t796.scala | 20 -------------------- 16 files changed, 52 insertions(+), 131 deletions(-) create mode 100644 test/files/pos/t0644.scala create mode 100644 test/files/run/bug3530.check create mode 100644 test/files/run/bug3530.scala create mode 100644 test/pending/neg/t796.scala delete mode 100644 test/pending/pos/t0576.scala delete mode 100644 test/pending/pos/t0644.scala delete mode 100644 test/pending/pos/t0756.scala delete mode 100644 test/pending/pos/t0805.scala delete mode 100644 test/pending/pos/t1003.scala delete mode 100644 test/pending/pos/t1004.scala delete mode 100644 test/pending/pos/t1024.scala delete mode 100644 test/pending/pos/t2099.scala delete mode 100644 test/pending/pos/t2625.scala delete mode 100644 test/pending/pos/t425variant.scala delete mode 100644 test/pending/pos/t796.scala (limited to 'test') diff --git a/test/files/pos/t0644.scala b/test/files/pos/t0644.scala new file mode 100644 index 0000000000..a92e2abb53 --- /dev/null +++ b/test/files/pos/t0644.scala @@ -0,0 +1,12 @@ +class A { + def apply(): Int = 0 + def update(n: Int) {} +} + +class B extends A { + this() + this()=1 + // 644 is wontfix so this is what should work. + super.apply() + super.update(1) +} diff --git a/test/files/run/bug3530.check b/test/files/run/bug3530.check new file mode 100644 index 0000000000..633c15d9d7 --- /dev/null +++ b/test/files/run/bug3530.check @@ -0,0 +1 @@ +Some List diff --git a/test/files/run/bug3530.scala b/test/files/run/bug3530.scala new file mode 100644 index 0000000000..f2c0034691 --- /dev/null +++ b/test/files/run/bug3530.scala @@ -0,0 +1,9 @@ +object Test { + def main(args: Array[String]) { + val list = List(1,2,3) + list match { + case List(_, _) => println("List with two elements") + case List(_*) => println("Some List") + } + } +} \ No newline at end of file diff --git a/test/pending/neg/t796.scala b/test/pending/neg/t796.scala new file mode 100644 index 0000000000..c013f49686 --- /dev/null +++ b/test/pending/neg/t796.scala @@ -0,0 +1,20 @@ +case class CaseClass( value: Int ); + +object PatternMatchBug { + def matcher( a: AnyRef, b: Any ) { + (a, b) match { + case ( instance: CaseClass, instance.value ) => + System.out.println( "Match succeeded!" ); + case _ => + System.out.println( "Match failed!" ); + } + } + + def main( args : Array[String] ) { + val caseClassInstance = CaseClass( 42 ) + + matcher( caseClassInstance, 13 ) + matcher( caseClassInstance, 42 ) + } +} + diff --git a/test/pending/pos/t0576.scala b/test/pending/pos/t0576.scala deleted file mode 100644 index 669806826d..0000000000 --- a/test/pending/pos/t0576.scala +++ /dev/null @@ -1,9 +0,0 @@ -class Test { - new Object { self => - def f(other: Any): Boolean = - other match { - case that: self.type => true - case _ => false - } - } -} diff --git a/test/pending/pos/t0644.scala b/test/pending/pos/t0644.scala deleted file mode 100644 index 5ad12c3632..0000000000 --- a/test/pending/pos/t0644.scala +++ /dev/null @@ -1,11 +0,0 @@ -class A { - def appply(): Int = 0 - def update(n: Int) {} -} - -class B extends A { - this() - this()=1 - super() - super()=1 -} diff --git a/test/pending/pos/t0756.scala b/test/pending/pos/t0756.scala deleted file mode 100644 index a778bd63d0..0000000000 --- a/test/pending/pos/t0756.scala +++ /dev/null @@ -1,8 +0,0 @@ -object Test { - for { - n <- Some(42) - - _ - m <- Some(24) - } yield n -} diff --git a/test/pending/pos/t0805.scala b/test/pending/pos/t0805.scala deleted file mode 100644 index 565a2a6527..0000000000 --- a/test/pending/pos/t0805.scala +++ /dev/null @@ -1,9 +0,0 @@ -package fr.up5.mi.noel.scala -object Test { - def make(t: Test) : Test = TestList(t.args.toList) -} -case class TestList[T](elements: List[T])(implicit f: T => Test) - -class Test { - val args: Array[Test] -} diff --git a/test/pending/pos/t1003.scala b/test/pending/pos/t1003.scala deleted file mode 100644 index 27becdb10f..0000000000 --- a/test/pending/pos/t1003.scala +++ /dev/null @@ -1,3 +0,0 @@ -object A { - classOf[String].getMethod("equals", "") -} diff --git a/test/pending/pos/t1004.scala b/test/pending/pos/t1004.scala deleted file mode 100644 index e86631acea..0000000000 --- a/test/pending/pos/t1004.scala +++ /dev/null @@ -1,6 +0,0 @@ -object A { - def main(args: Array[String]) = { - val x = new { def copy(a : this.type) = a }; - x.copy(x) - } -} diff --git a/test/pending/pos/t1024.scala b/test/pending/pos/t1024.scala deleted file mode 100644 index 0bd5b026a5..0000000000 --- a/test/pending/pos/t1024.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test { - trait T { trait U { val x = 3 } } - val x = new AnyRef with T#U { } -} diff --git a/test/pending/pos/t2099.scala b/test/pending/pos/t2099.scala deleted file mode 100644 index 934b6691a7..0000000000 --- a/test/pending/pos/t2099.scala +++ /dev/null @@ -1,27 +0,0 @@ -// nice to have, not terribly urgent, maybe? - -I have a trait: - -trait Vis[+T] - -and an object/class pair: - -object VisImpl? { def apply() = new VisImpl? } class VisImpl? extends Vis[Missing] - -Where Missing is some class of mine. In a separate project (where Vis and VisImpl? are on the classpath but Missing is not), if I do: - -object Test extends Application { - - val v = VisImpl?() println(v) - -} - -This causes a Scala compiler error (using 2.7.5 compiler). The error is: - -"Caused by java.lang.RuntimeException?: malformed Scala signature of VisImpl? at 3634; reference value data of package mypack refers to nonexisting symbol" - -Where mypack is the root package of the Missing class. This is not a helpful error as all my classes share the same root package and the problem is not in the VisImpl? declaration in any case. - -I would expect to see an error of the form: - -" Type parameter not found 'Missing': VisImpl? extends Vis[Missing] at Test: #4: val v = VisImpl?() " diff --git a/test/pending/pos/t2173.scala b/test/pending/pos/t2173.scala index 9a9a2edce4..bbcca39826 100644 --- a/test/pending/pos/t2173.scala +++ b/test/pending/pos/t2173.scala @@ -1,17 +1,12 @@ - - -This (somewhat convoluted) code fails to compile - -class A[+U>:Null] { - - type R[+X>:Null] = X type O[+X] = A[R[X]] - +class A[+U >: Null] { + type R[+X >: Null] = X + type O[+X] = A[R[X]] } -with the following error: - -type arguments [A.this.R[X]] do not conform to class A's type parameter bounds [+U >: Null] - -However, because type R[+X>:Null] is identical to X, it should carry X bounds and R[X] lower bound should be known to be X's lower bound, i.e. Null. - -The same problem occurs with upper bounds. +// with the following error: +// +// type arguments [A.this.R[X]] do not conform to class A's type parameter bounds [+U >: Null] +// +// However, because type R[+X>:Null] is identical to X, it should carry X bounds and R[X] lower bound should be known to be X's lower bound, i.e. Null. +// +// The same problem occurs with upper bounds. diff --git a/test/pending/pos/t2625.scala b/test/pending/pos/t2625.scala deleted file mode 100644 index 94240cb6c6..0000000000 --- a/test/pending/pos/t2625.scala +++ /dev/null @@ -1,9 +0,0 @@ -package t - -object T { - case class A(x: Int)(x: Int) - - def A(x: Boolean): Int = 34 - - A(23) -} \ No newline at end of file diff --git a/test/pending/pos/t425variant.scala b/test/pending/pos/t425variant.scala deleted file mode 100644 index 458f3b9da8..0000000000 --- a/test/pending/pos/t425variant.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Temp{ - case class A(x: Int) - case class B(override val x: Int, y: Double) extends A(x) - - B(5, 3.3) match { - case B(x, y) => Console.println(y) - case A(x) => Console.println(x) - } -} - diff --git a/test/pending/pos/t796.scala b/test/pending/pos/t796.scala deleted file mode 100644 index c013f49686..0000000000 --- a/test/pending/pos/t796.scala +++ /dev/null @@ -1,20 +0,0 @@ -case class CaseClass( value: Int ); - -object PatternMatchBug { - def matcher( a: AnyRef, b: Any ) { - (a, b) match { - case ( instance: CaseClass, instance.value ) => - System.out.println( "Match succeeded!" ); - case _ => - System.out.println( "Match failed!" ); - } - } - - def main( args : Array[String] ) { - val caseClassInstance = CaseClass( 42 ) - - matcher( caseClassInstance, 13 ) - matcher( caseClassInstance, 42 ) - } -} - -- cgit v1.2.3