summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2010-09-01 09:43:36 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2010-09-01 09:43:36 +0000
commit58882f89e76fd1cf824dfd9c537cadf153064860 (patch)
treef61511b071df41d79413a7d2d468ccf945a35524 /test/files/neg
parentcc57d03af8a97c4b9a6162acbc3a727384bb8a86 (diff)
downloadscala-58882f89e76fd1cf824dfd9c537cadf153064860.tar.gz
scala-58882f89e76fd1cf824dfd9c537cadf153064860.tar.bz2
scala-58882f89e76fd1cf824dfd9c537cadf153064860.zip
Undid all commits between 22566 and 22597 included
in the 2.8.x branch, restoring the status to 2.8.0 final release, in preparation for 2.8.1.
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/abstract-vars.check21
-rw-r--r--test/files/neg/abstract-vars.scala29
-rw-r--r--test/files/neg/bug1275.check8
-rw-r--r--test/files/neg/bug1275.scala26
-rw-r--r--test/files/neg/bug1845.check4
-rw-r--r--test/files/neg/bug1845.scala10
-rw-r--r--test/files/neg/bug3209.check4
-rw-r--r--test/files/neg/bug3209.scala2
-rw-r--r--test/files/neg/bug3631.check4
-rw-r--r--test/files/neg/bug3631.scala3
-rw-r--r--test/files/neg/bug882.check2
-rw-r--r--test/files/neg/names-defaults-neg.check13
-rw-r--r--test/files/neg/names-defaults-neg.scala5
-rw-r--r--test/files/neg/t2416.check10
-rw-r--r--test/files/neg/t2416.scala14
-rw-r--r--test/files/neg/t3399.check4
-rw-r--r--test/files/neg/t3399.scala24
-rw-r--r--test/files/neg/t3507.check4
-rw-r--r--test/files/neg/t3507.scala15
-rw-r--r--test/files/neg/t3604.check7
-rw-r--r--test/files/neg/t3604.scala6
-rw-r--r--test/files/neg/t3653.check7
-rw-r--r--test/files/neg/t3653.scala4
-rw-r--r--test/files/neg/t742.check5
-rw-r--r--test/files/neg/t742.scala8
-rw-r--r--test/files/neg/tailrec-2.check4
-rw-r--r--test/files/neg/tailrec-2.scala26
27 files changed, 23 insertions, 246 deletions
diff --git a/test/files/neg/abstract-vars.check b/test/files/neg/abstract-vars.check
deleted file mode 100644
index 8aa47745f6..0000000000
--- a/test/files/neg/abstract-vars.check
+++ /dev/null
@@ -1,21 +0,0 @@
-abstract-vars.scala:5: error: class Fail1 needs to be abstract, since variable x is not defined
-(Note that variables need to be initialized to be defined)
-class Fail1 extends A {
- ^
-abstract-vars.scala:9: error: class Fail2 needs to be abstract, since variable x in class A of type Int is not defined
-(Note that variables need to be initialized to be defined)
-class Fail2 extends A { }
- ^
-abstract-vars.scala:11: error: class Fail3 needs to be abstract, since variable x in class A of type Int is not defined
-(Note that an abstract var requires a setter in addition to the getter)
-class Fail3 extends A {
- ^
-abstract-vars.scala:14: error: class Fail4 needs to be abstract, since variable x in class A of type Int is not defined
-(Note that an abstract var requires a setter in addition to the getter)
-class Fail4 extends A {
- ^
-abstract-vars.scala:18: error: class Fail5 needs to be abstract, since variable x in class A of type Int is not defined
-(Note that an abstract var requires a getter in addition to the setter)
-class Fail5 extends A {
- ^
-5 errors found
diff --git a/test/files/neg/abstract-vars.scala b/test/files/neg/abstract-vars.scala
deleted file mode 100644
index df6109d3a8..0000000000
--- a/test/files/neg/abstract-vars.scala
+++ /dev/null
@@ -1,29 +0,0 @@
-abstract class A {
- var x: Int
-}
-
-class Fail1 extends A {
- var x: Int
-}
-
-class Fail2 extends A { }
-
-class Fail3 extends A {
- val x: Int = 5
-}
-class Fail4 extends A {
- def x: Int = 5
-}
-
-class Fail5 extends A {
- def x_=(y: Int) = ()
-}
-
-class Success1 extends A {
- val x: Int = 5
- def x_=(y: Int) = ()
-}
-
-class Success2 extends A {
- var x: Int = 5
-}
diff --git a/test/files/neg/bug1275.check b/test/files/neg/bug1275.check
index 40c5d79d27..9f806c0689 100644
--- a/test/files/neg/bug1275.check
+++ b/test/files/neg/bug1275.check
@@ -1,6 +1,4 @@
-bug1275.scala:8: error: type mismatch;
- found : xs.MyType[a]
- required: s
- = xs f // xs: s <: Seq[a]{type MyType <: s }
- ^
+bug1275.scala:13: error: The kind of type MyType does not conform to the expected kind of type MyType[+t] <: TestCovariance.Seq[t] in trait Seq.
+ def span[a, s <: Seq[a] { type MyType <: s } ](xs: s): s = xs f
+ ^
one error found
diff --git a/test/files/neg/bug1275.scala b/test/files/neg/bug1275.scala
index 769156fff2..e9be13c763 100644
--- a/test/files/neg/bug1275.scala
+++ b/test/files/neg/bug1275.scala
@@ -1,12 +1,14 @@
-object Test {
- trait Seq[+t] {
- type MyType[+t] <: Seq[t]
- def f: MyType[t]
- }
-
- def span[a, s <: Seq[a] { type MyType <: s } ](xs: s): s
- = xs f // xs: s <: Seq[a]{type MyType <: s }
- // xs.f : xs.MyType[a] <: Seq[a]
- // ill-formed type in bound for s: Seq[a] { type MyType <: s }
- // refinements aren't checked -- should they?
-} \ No newline at end of file
+// tested using Scala compiler version 2.6.0-RC1 -- (c) 2002-2010 LAMP/EPFL
+
+// prompted by "Covariant return types" mailing list question
+object TestCovariance {
+
+ // see Type constructor polymorphism in http://www.scala-lang.org/docu/changelog.html
+ trait Seq[+t] {
+ type MyType[+t] <: Seq[t]
+
+ def f: MyType[t]
+ }
+
+ def span[a, s <: Seq[a] { type MyType <: s } ](xs: s): s = xs f
+}
diff --git a/test/files/neg/bug1845.check b/test/files/neg/bug1845.check
deleted file mode 100644
index 164f3f60c1..0000000000
--- a/test/files/neg/bug1845.check
+++ /dev/null
@@ -1,4 +0,0 @@
-bug1845.scala:9: error: illegal cyclic reference involving value <import>
- val lexical = new StdLexical
- ^
-one error found
diff --git a/test/files/neg/bug1845.scala b/test/files/neg/bug1845.scala
deleted file mode 100644
index ceb43a0552..0000000000
--- a/test/files/neg/bug1845.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-import scala.util.parsing.combinator.syntactical.TokenParsers
-import scala.util.parsing.combinator.lexical.StdLexical
-import scala.util.parsing.syntax.StdTokens
-
-class MyTokenParsers extends TokenParsers {
- import lexical._
- type Tokens = StdTokens
- type Elem = lexical.Token
- val lexical = new StdLexical
-}
diff --git a/test/files/neg/bug3209.check b/test/files/neg/bug3209.check
deleted file mode 100644
index fa50f4ce1d..0000000000
--- a/test/files/neg/bug3209.check
+++ /dev/null
@@ -1,4 +0,0 @@
-bug3209.scala:2: error: expected start of definition
-package test
-^
-one error found
diff --git a/test/files/neg/bug3209.scala b/test/files/neg/bug3209.scala
deleted file mode 100644
index d893726659..0000000000
--- a/test/files/neg/bug3209.scala
+++ /dev/null
@@ -1,2 +0,0 @@
-@javax.annotation.Generated(Array("test"))
-package test \ No newline at end of file
diff --git a/test/files/neg/bug3631.check b/test/files/neg/bug3631.check
deleted file mode 100644
index 12d94aa4dc..0000000000
--- a/test/files/neg/bug3631.check
+++ /dev/null
@@ -1,4 +0,0 @@
-bug3631.scala:3: error: Implementation restriction: case classes cannot have more than 22 parameters.
-case class X23(x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int, x23: Int) { }
- ^
-one error found
diff --git a/test/files/neg/bug3631.scala b/test/files/neg/bug3631.scala
deleted file mode 100644
index bcf91619ee..0000000000
--- a/test/files/neg/bug3631.scala
+++ /dev/null
@@ -1,3 +0,0 @@
-case class X22(x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int) { }
-
-case class X23(x1: Int, x2: Int, x3: Int, x4: Int, x5: Int, x6: Int, x7: Int, x8: Int, x9: Int, x10: Int, x11: Int, x12: Int, x13: Int, x14: Int, x15: Int, x16: Int, x17: Int, x18: Int, x19: Int, x20: Int, x21: Int, x22: Int, x23: Int) { } \ No newline at end of file
diff --git a/test/files/neg/bug882.check b/test/files/neg/bug882.check
index 4e3e6d0860..8f47fefd9b 100644
--- a/test/files/neg/bug882.check
+++ b/test/files/neg/bug882.check
@@ -1,4 +1,4 @@
-bug882.scala:2: error: traits cannot have type parameters with context bounds `: ...' nor view bounds `<% ...'
+bug882.scala:2: error: traits cannot have type parameters with context bounds `: ...'
trait SortedSet[A <% Ordered[A]] {
^
one error found
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index b2b00b7050..38bacc0888 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -104,20 +104,17 @@ names-defaults-neg.scala:82: error: type mismatch;
Error occurred in an application involving default arguments.
new A2[String]()
^
-names-defaults-neg.scala:86: error: module extending its companion class cannot use default constructor arguments
- object C extends C()
- ^
-names-defaults-neg.scala:120: error: reference to var2 is ambiguous; it is both, a parameter
+names-defaults-neg.scala:115: error: reference to var2 is ambiguous; it is both, a parameter
name of the method and the name of a variable currently in scope.
delay(var2 = 40)
^
-names-defaults-neg.scala:123: error: missing parameter type for expanded function ((x$1) => a = x$1)
+names-defaults-neg.scala:118: error: missing parameter type for expanded function ((x$1) => a = x$1)
val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
^
-names-defaults-neg.scala:124: error: parameter specified twice: a
+names-defaults-neg.scala:119: error: parameter specified twice: a
val taf3 = testAnnFun(b = _: String, a = get(8))
^
-names-defaults-neg.scala:125: error: wrong number of parameters; expected = 2
+names-defaults-neg.scala:120: error: wrong number of parameters; expected = 2
val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
^
-29 errors found
+28 errors found
diff --git a/test/files/neg/names-defaults-neg.scala b/test/files/neg/names-defaults-neg.scala
index 43883540a0..e73dc71c9b 100644
--- a/test/files/neg/names-defaults-neg.scala
+++ b/test/files/neg/names-defaults-neg.scala
@@ -81,11 +81,6 @@ object Test extends Application {
// correct error message
new A2[String]()
- object t3648 {
- class C(val s: String = "")
- object C extends C()
- }
-
// DEFINITIONS
def test1(a: Int, b: String) = a +": "+ b
def test2(x: Unit) = println("test2")
diff --git a/test/files/neg/t2416.check b/test/files/neg/t2416.check
deleted file mode 100644
index 0899ad09d5..0000000000
--- a/test/files/neg/t2416.check
+++ /dev/null
@@ -1,10 +0,0 @@
-t2416.scala:3: error: type arguments [Int] do not conform to trait A's type parameter bounds [X <: Double]
- def x : A[Int]#B = 10 // no you won't
- ^
-t2416.scala:8: error: type arguments [Boolean] do not conform to type B's type parameter bounds [Y <: Double]
- def x : A#B[Boolean] = 10 // seriously?
- ^
-t2416.scala:13: error: type arguments [String] do not conform to type B's type parameter bounds [Z <: Double]
- type C[Z <: A] = Z#B[String] // nuh-uh!
- ^
-three errors found
diff --git a/test/files/neg/t2416.scala b/test/files/neg/t2416.scala
deleted file mode 100644
index 6bb57a984b..0000000000
--- a/test/files/neg/t2416.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-object t2416a {
- trait A[X <: Double] { type B = X }
- def x : A[Int]#B = 10 // no you won't
-}
-
-object t2416b {
- trait A{type B[Y <: Double] = Int}
- def x : A#B[Boolean] = 10 // seriously?
-}
-
-object t2416c {
- trait A{type B[Z <: Double] = Int}
- type C[Z <: A] = Z#B[String] // nuh-uh!
-} \ No newline at end of file
diff --git a/test/files/neg/t3399.check b/test/files/neg/t3399.check
deleted file mode 100644
index eb6c679704..0000000000
--- a/test/files/neg/t3399.check
+++ /dev/null
@@ -1,4 +0,0 @@
-t3399.scala:23: error: could not find implicit value for parameter e: =:=[Nats.Add[Nats._1,Nats._1],Nats._1]
- implicitly[ Add[_1, _1] =:= _1]
- ^
-one error found
diff --git a/test/files/neg/t3399.scala b/test/files/neg/t3399.scala
deleted file mode 100644
index 3edaa0724f..0000000000
--- a/test/files/neg/t3399.scala
+++ /dev/null
@@ -1,24 +0,0 @@
-object Nats {
- sealed trait Nat {
- // fold right on N, N-1, ..., 1
- type FoldR[Init <: Type, Type, F <: Fold[Nat, Type]] <: Type
- }
- sealed trait _0 extends Nat {
- type FoldR[Init <: Type, Type, F <: Fold[Nat, Type]] = Init
- }
- sealed trait Succ[N <: Nat] extends Nat {
- type FoldR[Init <: Type, Type, F <: Fold[Nat, Type]] =
- F#Apply[Succ[N], N#FoldR[Init, Type, F]]
- }
-
- type Add[A <: Nat, B <: Nat] = A#FoldR[B, Nat, Inc]
- trait Fold[-Elem, Value] {
- type Apply[N <: Elem, Acc <: Value] <: Value
- }
- type Inc = Fold[Any, Nat] {
- type Apply[N <: Any, Acc <: Nat] = Succ[Acc]
- }
-
- type _1 = Succ[_0]
- implicitly[ Add[_1, _1] =:= _1]
-} \ No newline at end of file
diff --git a/test/files/neg/t3507.check b/test/files/neg/t3507.check
deleted file mode 100644
index 1246a20d09..0000000000
--- a/test/files/neg/t3507.check
+++ /dev/null
@@ -1,4 +0,0 @@
-t3507.scala:13: error: could not find implicit value for evidence parameter of type Manifest[object _1.b.c]
- mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier
- ^
-one error found
diff --git a/test/files/neg/t3507.scala b/test/files/neg/t3507.scala
deleted file mode 100644
index 9a8c7c5462..0000000000
--- a/test/files/neg/t3507.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-class A {
- object b {
- object c
- }
- def m = b.c
-}
-
-object Test {
- var a: A = new A // mutable
- val c /*: object _1.b.c forSome { val _1: A } */ = a.m // widening using existential
-
- def mani[T: Manifest](x: T) = ()
- mani/*[object _1.b.c]*/(c) // kaboom in manifestOfType / TreeGen.mkAttributedQualifier
- // --> _1 is not in scope here
-} \ No newline at end of file
diff --git a/test/files/neg/t3604.check b/test/files/neg/t3604.check
deleted file mode 100644
index b07c5c9c71..0000000000
--- a/test/files/neg/t3604.check
+++ /dev/null
@@ -1,7 +0,0 @@
-t3604.scala:3: error: in XML literal: expected closing tag of abbr
- <abbr></div>
- ^
-t3604.scala:3: error: start tag was here: abbr>
- <abbr></div>
- ^
-two errors found
diff --git a/test/files/neg/t3604.scala b/test/files/neg/t3604.scala
deleted file mode 100644
index f890a58e58..0000000000
--- a/test/files/neg/t3604.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-object Main {
- <div>
- <abbr></div>
- { "..." }
- </div>
-}
diff --git a/test/files/neg/t3653.check b/test/files/neg/t3653.check
deleted file mode 100644
index ac6e2ca9dc..0000000000
--- a/test/files/neg/t3653.check
+++ /dev/null
@@ -1,7 +0,0 @@
-t3653.scala:3: error: double definition:
-method x:(implicit x: Int)Int and
-method x:(i: Int)Int at line 2
-have same type after erasure: (x: Int)Int
- def x(implicit x: Int) = 5
- ^
-one error found
diff --git a/test/files/neg/t3653.scala b/test/files/neg/t3653.scala
deleted file mode 100644
index 96cf96008a..0000000000
--- a/test/files/neg/t3653.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-class B {
- def x(i: Int) = 3
- def x(implicit x: Int) = 5
-} \ No newline at end of file
diff --git a/test/files/neg/t742.check b/test/files/neg/t742.check
deleted file mode 100644
index f587948ef1..0000000000
--- a/test/files/neg/t742.check
+++ /dev/null
@@ -1,5 +0,0 @@
-t742.scala:5: error: kinds of the type arguments (Crash._1,Crash._2,Any) do not conform to the expected kinds of the type parameters (type m,type n,type z).
-Crash._1's type parameters do not match type m's expected parameters: type s1 has one type parameter, but type n has two
- type p = mul[_1, _2, Any] // mul[_1, _1, Any] needs -Yrecursion
- ^
-one error found
diff --git a/test/files/neg/t742.scala b/test/files/neg/t742.scala
deleted file mode 100644
index bb1c2f85ea..0000000000
--- a/test/files/neg/t742.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-object Crash {
- type mul[m[n[s[_], z], z], n[s[_], z], z] = m[n, z]
- type _1[s1[_], z1] = s1[z1]
- type _2[s1[_], z1] = s1[z1]
- type p = mul[_1, _2, Any] // mul[_1, _1, Any] needs -Yrecursion
- // _1[_2, Zero]
- // _2[Zero]
-} \ No newline at end of file
diff --git a/test/files/neg/tailrec-2.check b/test/files/neg/tailrec-2.check
deleted file mode 100644
index ab6733946d..0000000000
--- a/test/files/neg/tailrec-2.check
+++ /dev/null
@@ -1,4 +0,0 @@
-tailrec-2.scala:6: error: could not optimize @tailrec annotated method: it contains a recursive call targetting a supertype
- @annotation.tailrec final def f[B >: A](mem: List[B]): List[B] = (null: Super[A]).f(mem)
- ^
-one error found
diff --git a/test/files/neg/tailrec-2.scala b/test/files/neg/tailrec-2.scala
deleted file mode 100644
index 4388815a06..0000000000
--- a/test/files/neg/tailrec-2.scala
+++ /dev/null
@@ -1,26 +0,0 @@
-sealed abstract class Super[+A] {
- def f[B >: A](mem: List[B]) : List[B]
-}
-// This one should fail, target is a supertype
-class Bop1[+A](val element: A) extends Super[A] {
- @annotation.tailrec final def f[B >: A](mem: List[B]): List[B] = (null: Super[A]).f(mem)
-}
-// These succeed
-class Bop2[+A](val element: A) extends Super[A] {
- @annotation.tailrec final def f[B >: A](mem: List[B]): List[B] = (null: Bop2[A]).f(mem)
-}
-object Bop3 extends Super[Nothing] {
- @annotation.tailrec final def f[B](mem: List[B]): List[B] = (null: Bop3.type).f(mem)
-}
-class Bop4[+A](val element: A) extends Super[A] {
- @annotation.tailrec final def f[B >: A](mem: List[B]): List[B] = Other.f[A].f(mem)
-}
-
-object Other {
- def f[T] : Bop4[T] = error("")
-}
-
-object Bop {
- def m1[A] : Super[A] = error("")
- def m2[A] : Bop2[A] = error("")
-} \ No newline at end of file