From b6778be91900b8161e705dc2598ef7af86842b0b Mon Sep 17 00:00:00 2001 From: Hubert Plociniczak Date: Wed, 2 Nov 2011 14:34:35 +0000 Subject: Begone t1737... --- test/files/neg/abstract-class-2.scala | 4 ++-- test/files/neg/abstract-inaccessible.scala | 2 +- test/files/neg/accesses.scala | 2 +- test/files/neg/array-not-seq.scala | 4 ++-- test/files/neg/check-dead.scala | 12 ++++++------ test/files/neg/checksensible.scala | 24 ++++++++++++------------ test/files/neg/choices.scala | 2 +- test/files/neg/exhausting.scala | 8 ++++---- test/files/neg/forward.scala | 8 ++++---- test/files/neg/found-req-variance.scala | 14 +++++++------- test/files/neg/gadts1.check | 2 +- test/files/neg/gadts1.scala | 4 ++-- test/files/neg/implicits.scala | 8 ++++---- test/files/neg/java-access-neg/J.java | 4 ++-- test/files/neg/java-access-neg/S2.scala | 8 ++++---- test/files/neg/lazy-override.scala | 2 +- test/files/neg/lazyvals.scala | 4 ++-- test/files/neg/lubs.scala | 2 +- test/files/neg/migration28.scala | 6 +++--- test/files/neg/null-unsoundness.scala | 2 +- test/files/neg/object-not-a-value.scala | 2 +- test/files/neg/overload-msg.scala | 2 +- test/files/neg/overloaded-implicit.scala | 8 ++++---- test/files/neg/override-object-no.scala | 2 +- test/files/neg/pat_unreachable.scala | 2 +- test/files/neg/patmat-type-check.scala | 12 ++++++------ test/files/neg/patmatexhaust.scala | 22 +++++++++++----------- test/files/neg/patternalts.scala | 2 +- test/files/neg/protected-constructors.scala | 2 +- test/files/neg/saito.scala | 4 ++-- test/files/neg/sensitive.scala | 6 +++--- test/files/neg/spec-overrides.scala | 2 +- test/files/neg/structural.scala | 28 ++++++++++++++-------------- test/files/neg/switch.scala | 16 ++++++++-------- test/files/neg/t0117.scala | 2 +- test/files/neg/t0152.scala | 2 +- test/files/neg/t0218.check | 2 +- test/files/neg/t0218.scala | 4 ++-- test/files/neg/t0503.scala | 2 +- test/files/neg/t0764.scala | 2 +- test/files/neg/t0816.scala | 2 +- test/files/neg/t1011.scala | 2 +- test/files/neg/t1112.scala | 6 +++--- test/files/neg/t112706A.check | 2 +- test/files/neg/t112706A.scala | 2 +- test/files/neg/t1183.scala | 4 ++-- test/files/neg/t1477.scala | 2 +- test/files/neg/t1523.scala | 4 ++-- test/files/neg/t1623.scala | 4 ++-- test/files/neg/t1705.scala | 2 +- test/files/neg/t1878.scala | 8 ++++---- test/files/neg/t2148.scala | 4 ++-- test/files/neg/t2421b.scala | 2 +- test/files/neg/t2441.scala | 4 ++-- test/files/neg/t2641.scala | 6 +++--- test/files/neg/t2870.check | 2 +- test/files/neg/t2870.scala | 6 +++--- test/files/neg/t2910.scala | 4 ++-- test/files/neg/t2918.check | 6 +++--- test/files/neg/t2918.scala | 2 +- test/files/neg/t3015.check | 4 ++-- test/files/neg/t3015.scala | 2 +- test/files/neg/t3118.scala | 4 ++-- test/files/neg/t3224.scala | 18 +++++++++--------- test/files/neg/t3399.scala | 4 ++-- test/files/neg/t3453.scala | 6 +++--- test/files/neg/t3507.scala | 2 +- test/files/neg/t3683b.scala | 2 +- test/files/neg/t3714-neg.scala | 2 +- test/files/neg/t3736.scala | 4 ++-- test/files/neg/t3757/B.scala | 2 +- test/files/neg/t3776.check | 2 +- test/files/neg/t3776.scala | 2 +- test/files/neg/t3816.scala | 6 +++--- test/files/neg/t3987.scala | 2 +- test/files/neg/t4079/t4079_1.scala | 6 +++--- test/files/neg/t4174.scala | 2 +- test/files/neg/t4196.scala | 4 ++-- test/files/neg/t4217.check | 2 +- test/files/neg/t4217.scala | 2 +- test/files/neg/t4221.scala | 2 +- test/files/neg/t4417.scala | 4 ++-- test/files/neg/t4431.scala | 2 +- test/files/neg/t4457_1.scala | 2 +- test/files/neg/t4457_2.scala | 2 +- test/files/neg/t4851/J.java | 6 +++--- test/files/neg/t4851/J2.java | 4 ++-- test/files/neg/t4851/S.scala | 4 ++-- test/files/neg/t4877.scala | 2 +- test/files/neg/t5120.scala | 2 +- test/files/neg/t520.scala | 2 +- test/files/neg/t558.scala | 2 +- test/files/neg/t563.scala | 2 +- test/files/neg/t576.scala | 8 ++++---- test/files/neg/t588.scala | 8 ++++---- test/files/neg/t591.scala | 22 +++++++++++----------- test/files/neg/t608.scala | 2 +- test/files/neg/t692.check | 2 +- test/files/neg/t692.scala | 6 +++--- test/files/neg/t693.check | 2 +- test/files/neg/t693.scala | 2 +- test/files/neg/t715.scala | 2 +- test/files/neg/t783.scala | 2 +- test/files/neg/t798.scala | 2 +- test/files/neg/t836.scala | 2 +- test/files/neg/t856.scala | 2 +- test/files/neg/t876.scala | 6 +++--- test/files/neg/t877.scala | 2 +- test/files/neg/t944.scala | 6 +++--- test/files/neg/tailrec.scala | 16 ++++++++-------- test/files/neg/tcpoly_infer_ticket1162.scala | 4 ++-- test/files/neg/tcpoly_ticket2101.scala | 8 ++++---- test/files/neg/tcpoly_typealias.scala | 6 +++--- test/files/neg/tcpoly_variance_enforce.scala | 16 ++++++++-------- test/files/neg/type-diagnostics.scala | 4 ++-- test/files/neg/unit-returns-value.scala | 2 +- test/files/neg/varargs.scala | 12 ++++++------ test/files/neg/variances.check | 4 ++-- test/files/neg/variances.scala | 14 +++++++------- test/files/neg/viewtest.scala | 6 +++--- 120 files changed, 301 insertions(+), 301 deletions(-) (limited to 'test/files/neg') diff --git a/test/files/neg/abstract-class-2.scala b/test/files/neg/abstract-class-2.scala index 19f74f3da6..be45a09343 100644 --- a/test/files/neg/abstract-class-2.scala +++ b/test/files/neg/abstract-class-2.scala @@ -1,7 +1,7 @@ class P { trait S1 val p = new P - + trait S2 { def f(x: p.S1): Int } @@ -10,5 +10,5 @@ class P { class P2 extends P { object O2 extends S2 { def f(x: S1) = 5 - } + } } diff --git a/test/files/neg/abstract-inaccessible.scala b/test/files/neg/abstract-inaccessible.scala index 3c80f30522..7eaaf2d620 100644 --- a/test/files/neg/abstract-inaccessible.scala +++ b/test/files/neg/abstract-inaccessible.scala @@ -1,6 +1,6 @@ package foo { private[foo] trait Bippy { } - + trait YourTrait { def implementMe(f: Int => (String, Bippy)): Unit def overrideMe[T <: Bippy](x: T): T = x diff --git a/test/files/neg/accesses.scala b/test/files/neg/accesses.scala index b1df6c0e6c..290291586c 100644 --- a/test/files/neg/accesses.scala +++ b/test/files/neg/accesses.scala @@ -6,7 +6,7 @@ abstract class A { private[p1] def f4(): Unit protected[p1] def f5(): Unit } - + abstract class OK1 extends A { private[p1] def f2(): Unit protected[p2] def f3(): Unit diff --git a/test/files/neg/array-not-seq.scala b/test/files/neg/array-not-seq.scala index 07a2898d88..5f367bdd85 100644 --- a/test/files/neg/array-not-seq.scala +++ b/test/files/neg/array-not-seq.scala @@ -9,9 +9,9 @@ object Test { case _: Array[_] => true case _ => false } - + def f4(x: Any) = x.isInstanceOf[Traversable[_]] - + def f5(x1: Any, x2: Any, x3: AnyRef) = (x1, x2, x3) match { case (Some(_: Seq[_]), Nil, _) => 1 case (None, List(_: List[_], _), _) => 2 diff --git a/test/files/neg/check-dead.scala b/test/files/neg/check-dead.scala index 2d5bccb21d..aadd788814 100644 --- a/test/files/neg/check-dead.scala +++ b/test/files/neg/check-dead.scala @@ -5,11 +5,11 @@ object Other { class NoDeads { def y1(arg: Any) = println("foo") def z1 = y1(throw new Exception) // should warn - + def y2[T](arg: T) = println("foo") def z2 = y2(throw new Exception) // should warn - - def y3[T](arg: => T) = println("foo") + + def y3[T](arg: => T) = println("foo") def z3 = y3(throw new Exception) // should not warn: by name arg def nowarn1 = synchronized { throw new Exception } // should not warn: synchronized should be by name @@ -22,9 +22,9 @@ class NoDeads { val i = 10 + 2 i } - + def nowarn4: String = Other.oops("don't warn about me") // should not warn - + def yeswarn1 = synchronized { throw new Exception // should warn 5 * 5 @@ -32,6 +32,6 @@ class NoDeads { def yeswarn2: Int = synchronized { throw new Exception // should warn return 5 - } + } } diff --git a/test/files/neg/checksensible.scala b/test/files/neg/checksensible.scala index b6083f75e4..27ee908153 100644 --- a/test/files/neg/checksensible.scala +++ b/test/files/neg/checksensible.scala @@ -9,7 +9,7 @@ final class Zing { // 7 warnings class RefEqTest { object Shmoopie - + (new AnyRef) eq (new AnyRef) (new AnyRef) ne (new AnyRef) Shmoopie eq (new AnyRef) @@ -22,10 +22,10 @@ class RefEqTest { // 13 warnings class EqEqValTest { var c = 0 - + (c = 1) == 0 0 == (c = 1) - + 1 == "abc" 1 == ("abc": Any) // doesn't warn because an Any may be a boxed Int 1 == (1: Any) // as above @@ -34,12 +34,12 @@ class EqEqValTest { true == new java.lang.Boolean(true) // none of these should warn new java.lang.Boolean(true) == true - + new AnyRef == 1 1 == new AnyRef // doesn't warn because it could be... 1 == (new java.lang.Integer(1)) // ...something like this 1 == (new java.lang.Boolean(true)) - + 1 != true () == true () == () @@ -47,13 +47,13 @@ class EqEqValTest { () == scala.runtime.BoxedUnit.UNIT // these should warn for always being true/false scala.runtime.BoxedUnit.UNIT != () (scala.runtime.BoxedUnit.UNIT: java.io.Serializable) != () // shouldn't warn - + (1 != println) (1 != 'sym) } // 12 warnings -class EqEqRefTest { +class EqEqRefTest { val ref = new Bop ((x: Int) => x + 1) == null Bep == ((_: Int) + 1) @@ -67,9 +67,9 @@ class EqEqRefTest { // final classes with default equals val x1 = new Bip - val x2 = new Bop + val x2 = new Bop (x1 == x2) - + class C1 { } class C2 extends C1 { } final class Z1 extends C2 { } @@ -84,14 +84,14 @@ class EqEqRefTest { c3 != "abc" // this should warn when feeling chatty c3 != z1 - + // non-warners (null: AnyRef) == (null: AnyRef) (x1 <= x2) - + def main(args: Array[String]) = { val in = new java.io.FileInputStream(args(0)) - var c = 0 + var c = 0 while ((c = in.read) != -1) print(c.toChar) diff --git a/test/files/neg/choices.scala b/test/files/neg/choices.scala index 8827494874..fe9236f10f 100644 --- a/test/files/neg/choices.scala +++ b/test/files/neg/choices.scala @@ -1,5 +1,5 @@ object Test { def main(args: Array[String]): Unit = { - + } } diff --git a/test/files/neg/exhausting.scala b/test/files/neg/exhausting.scala index 0741d7467b..14b05695aa 100644 --- a/test/files/neg/exhausting.scala +++ b/test/files/neg/exhausting.scala @@ -3,7 +3,7 @@ object Test { case object Bar1 extends Foo[Int] case object Bar2 extends Foo[String] case object Bar3 extends Foo[Any] - + def ex1[T](xs: List[T]) = xs match { case ys: List[_] => "ok" } @@ -16,7 +16,7 @@ object Test { def ex3[T](xx: (Foo[T], Foo[T])) = xx match { case (_: Foo[_], _: Foo[_]) => () } - + def fail1[T](xs: List[T]) = xs match { case Nil => "ok" case x :: y :: Nil => "ok" @@ -38,8 +38,8 @@ object Test { case (Bar2, Bar3) => () case (Bar3, _) => () } - + def main(args: Array[String]): Unit = { - + } } diff --git a/test/files/neg/forward.scala b/test/files/neg/forward.scala index d5c0851f09..3774fa838f 100644 --- a/test/files/neg/forward.scala +++ b/test/files/neg/forward.scala @@ -5,20 +5,20 @@ object Test { { def f: Int = x; val x: Int = f; - } + } { def f: Int = g; val x: Int = f; def g: Int = x; - } + } { def f: Int = g; var x: Int = f; def g: Int = x; - } + } { def f: Int = g; Console.println("foo"); def g: Int = f; - } + } } diff --git a/test/files/neg/found-req-variance.scala b/test/files/neg/found-req-variance.scala index 024b24c367..fd3b11160e 100644 --- a/test/files/neg/found-req-variance.scala +++ b/test/files/neg/found-req-variance.scala @@ -27,7 +27,7 @@ object Test { def f7 = Set[Inv[C]]() + new Inv[A] def f8 = Set[Inv[C]]() + new Inv[B] def f9 = Set[Inv[C]]() + new Inv[C] - + def g1 = Set[Multi[A, B, C]]() + new MultiCov[A] def g2 = Set[Multi[A, B, C]]() + new MultiCov[B] def g3 = Set[Multi[A, B, C]]() + new MultiCov[C] @@ -43,12 +43,12 @@ object Functions { object Set1 { def f[T, R](x: FF1[T, R]) = () def h[T, R] : FF1[T, R] = sys.error("") - + def ff1 = f[B, B](h[A, A]) // fail def ff2 = f[B, B](h[B, A]) // fail def ff3 = f[B, B](h[C, A]) // fail def ff4 = f[B, B](h[A, B]) // suggest - def ff5 = f[B, B](h[B, B]) // ok + def ff5 = f[B, B](h[B, B]) // ok def ff6 = f[B, B](h[C, B]) // suggest def ff7 = f[B, B](h[A, C]) // suggest def ff8 = f[B, B](h[B, C]) // ok @@ -57,7 +57,7 @@ object Functions { object Set2 { def f[T, R](x: FF2[T, R]) = () def h[T, R] : FF2[T, R] = sys.error("") - + def ff1 = f[B, B](h[A, A]) // suggest def ff2 = f[B, B](h[B, A]) // suggest def ff3 = f[B, B](h[C, A]) // fail @@ -74,7 +74,7 @@ object Functions { // object TypeAlias { // type LL[T] = List[T] // val LL = List -// +// // def f1 = Set[LL[B]]() + LL[A](new A) // def f2 = Set[LL[B]]() + LL[C](new C) // } @@ -82,12 +82,12 @@ object Functions { object Javas { def f[T](x: java.util.List[T]) = () def g[T](x: java.util.Comparator[T]) = () - + def g1 = f[AnyRef](new java.util.ArrayList[String] { }) def g2 = g[String](Ordering.fromLessThan[AnyRef](_.toString < _.toString)) } -object Misc { +object Misc { // original motivation class Data[A <: AnyVal] class MyData extends Data[Int] { } diff --git a/test/files/neg/gadts1.check b/test/files/neg/gadts1.check index f19b58c5db..44d2b114d6 100644 --- a/test/files/neg/gadts1.check +++ b/test/files/neg/gadts1.check @@ -1,7 +1,7 @@ gadts1.scala:15: error: type mismatch; found : Test.Double required: a - case NumTerm(n) => c.x = Double(1.0) + case NumTerm(n) => c.x = Double(1.0) ^ gadts1.scala:20: error: class Cell of type Test.Cell does not take type parameters. case Cell[a](x: Int) => c.x = 5 diff --git a/test/files/neg/gadts1.scala b/test/files/neg/gadts1.scala index 08403e6eec..1fb6e57e2d 100644 --- a/test/files/neg/gadts1.scala +++ b/test/files/neg/gadts1.scala @@ -11,8 +11,8 @@ class IntTerm(n: Int) extends NumTerm(n) with Term[Int] def f[a](t:Term[a], c:Cell[a]): Unit = { - t match { - case NumTerm(n) => c.x = Double(1.0) + t match { + case NumTerm(n) => c.x = Double(1.0) } t match { // presently testing that this gets past the parser: eventually diff --git a/test/files/neg/implicits.scala b/test/files/neg/implicits.scala index 846591e22d..e908fb03e8 100644 --- a/test/files/neg/implicits.scala +++ b/test/files/neg/implicits.scala @@ -4,14 +4,14 @@ class Super object Super { implicit def pos2int(p: Pos): Int = 0 -} +} object Sub extends Super { class Plus(x: Any) { def +(y: String): String = x.toString + y } implicit def any2plus(x: Any): Plus = new Plus(x) -} +} object Test { import Super._ @@ -33,7 +33,7 @@ object test2 { val set = HEmpty + 3 + "3" implicit def select[T](t: HSome[T,_]) = t.head implicit def selectTail[L](t: HSome[_,L]) = t.tail - + def foo(x: Int) = 3 foo(set) } @@ -55,4 +55,4 @@ class Mxml { } -} +} diff --git a/test/files/neg/java-access-neg/J.java b/test/files/neg/java-access-neg/J.java index b6bc3363a1..4f2024673c 100644 --- a/test/files/neg/java-access-neg/J.java +++ b/test/files/neg/java-access-neg/J.java @@ -4,11 +4,11 @@ public abstract class J { public J() { } J(int x1) { } protected J(int x1, int x2) { } - + abstract void packageAbstract(); protected abstract void protectedAbstract(); public abstract void publicAbstract(); - + void packageConcrete() { return; } protected void protectedConcrete() { return; } public void publicConcrete() { return; } diff --git a/test/files/neg/java-access-neg/S2.scala b/test/files/neg/java-access-neg/S2.scala index b082bb7174..dd0af8d39d 100644 --- a/test/files/neg/java-access-neg/S2.scala +++ b/test/files/neg/java-access-neg/S2.scala @@ -12,7 +12,7 @@ class S1 extends J { override private[b] def packageAbstract() = () // fail override protected[b] def protectedAbstract() = () override def publicAbstract() = () - + override private[b] def packageConcrete() = () // fail override protected[b] def protectedConcrete() = () override def publicConcrete() = () @@ -32,7 +32,7 @@ class S3 extends J { protected[b] def packageAbstract() = () // fail protected[b] def protectedAbstract() = () def publicAbstract() = () - + override protected[b] def packageConcrete() = () // fail override protected[b] def protectedConcrete() = () override def publicConcrete() = () @@ -43,7 +43,7 @@ class S4 extends J { private[a] def packageAbstract() = () // fail protected[a] def protectedAbstract() = () def publicAbstract() = () - + override private[a] def packageConcrete() = () // fail override protected[a] def protectedConcrete() = () override def publicConcrete() = () @@ -54,7 +54,7 @@ class S5 extends J { def packageAbstract() = () // fail def protectedAbstract() = () def publicAbstract() = () - + override def packageConcrete() = () // fail override def protectedConcrete() = () override def publicConcrete() = () diff --git a/test/files/neg/lazy-override.scala b/test/files/neg/lazy-override.scala index f41d7f038b..a0f6e3bd73 100644 --- a/test/files/neg/lazy-override.scala +++ b/test/files/neg/lazy-override.scala @@ -5,7 +5,7 @@ lazy val y: Int = { print("/*A.y*/"); 2 } } - + class B extends A { // lazy overrides strict val override lazy val x: Int = { print("/*B.x*/"); 3 } diff --git a/test/files/neg/lazyvals.scala b/test/files/neg/lazyvals.scala index f92534f506..bbc4fe114a 100644 --- a/test/files/neg/lazyvals.scala +++ b/test/files/neg/lazyvals.scala @@ -1,7 +1,7 @@ /** Test which should fail compilation */ class Lazy { - + // no abstract lazy values lazy val t: Int @@ -31,7 +31,7 @@ object T2 { lazy val y: Int = { print("/*A.y*/"); 2 } } - + class B extends A { // lazy overrides strict val override lazy val x: Int = { print("/*B.x*/"); 3 } diff --git a/test/files/neg/lubs.scala b/test/files/neg/lubs.scala index 3524fa4d87..639117f7bf 100644 --- a/test/files/neg/lubs.scala +++ b/test/files/neg/lubs.scala @@ -18,7 +18,7 @@ object test2 { class D extends A { type T = D } def f = if (1 == 2) new C else new D - + val x1: A { type T } = f val x2: A { type T >: Null <: A } = f val x3: A { type T >: Null <: A { type T >: Null <: A } } = f diff --git a/test/files/neg/migration28.scala b/test/files/neg/migration28.scala index facc9b36d2..ba73eea436 100644 --- a/test/files/neg/migration28.scala +++ b/test/files/neg/migration28.scala @@ -1,9 +1,9 @@ object Test { import scala.collection.mutable._ - + List(1,2,3,4,5).scanRight(0)(_+_) - + def main(args: Array[String]): Unit = { - + } } diff --git a/test/files/neg/null-unsoundness.scala b/test/files/neg/null-unsoundness.scala index dbb8744597..3f7e42fe17 100644 --- a/test/files/neg/null-unsoundness.scala +++ b/test/files/neg/null-unsoundness.scala @@ -12,4 +12,4 @@ object Test extends A with App { type A = C y = 42 } - + diff --git a/test/files/neg/object-not-a-value.scala b/test/files/neg/object-not-a-value.scala index 207b271df2..2f894a33df 100644 --- a/test/files/neg/object-not-a-value.scala +++ b/test/files/neg/object-not-a-value.scala @@ -1,6 +1,6 @@ object Test { import java.util._ - + def main(args: Array[String]): Unit = { List(1) map (_ + 1) } diff --git a/test/files/neg/overload-msg.scala b/test/files/neg/overload-msg.scala index 8715c156a2..896722262d 100644 --- a/test/files/neg/overload-msg.scala +++ b/test/files/neg/overload-msg.scala @@ -1,4 +1,4 @@ // type parameter shadows actual type, massive overload error confuses. -class A(x: Int) { +class A(x: Int) { def f[Int](y: Int) = x + y } diff --git a/test/files/neg/overloaded-implicit.scala b/test/files/neg/overloaded-implicit.scala index 68b1ceaa30..9ab66cf560 100644 --- a/test/files/neg/overloaded-implicit.scala +++ b/test/files/neg/overloaded-implicit.scala @@ -1,15 +1,15 @@ object Test { implicit def imp1[T](x: List[T]): Map[T, T] = Map() implicit def imp1[T](x: Set[T]): Map[T, T] = Map() - + def f[T <% Map[Int, Int]](x: T): Double = 1.0d // not parameterized, no warning - implicit def imp2(x: List[Int]): String = "a" + implicit def imp2(x: List[Int]): String = "a" implicit def imp2(x: Set[Int]): String = "b" - + def g[T <% String](x: T): Double = 2.0d - + def main(args: Array[String]): Unit = { // println(f(List(1))) println(g(List(1))) diff --git a/test/files/neg/override-object-no.scala b/test/files/neg/override-object-no.scala index 745cdb2332..45961e4fa6 100644 --- a/test/files/neg/override-object-no.scala +++ b/test/files/neg/override-object-no.scala @@ -25,7 +25,7 @@ package case1 { trait Quux4 extends Quux3 { override object Bar } // err } -// type parameter as-seen-from business +// type parameter as-seen-from business package case2 { // invariance (see pos for the covariant case) class Bar[T] diff --git a/test/files/neg/pat_unreachable.scala b/test/files/neg/pat_unreachable.scala index c5f71790a8..fc0fd41920 100644 --- a/test/files/neg/pat_unreachable.scala +++ b/test/files/neg/pat_unreachable.scala @@ -8,7 +8,7 @@ object Test extends App { case Seq(x, y, _*) => x::y::Nil case Seq(x, y) => List(x, y) } - + def not_unreachable(xs:Seq[Char]) = xs match { case Seq(x, y, _*) => x::y::Nil case Seq(x) => List(x) diff --git a/test/files/neg/patmat-type-check.scala b/test/files/neg/patmat-type-check.scala index 26d0409fa0..cc35089430 100644 --- a/test/files/neg/patmat-type-check.scala +++ b/test/files/neg/patmat-type-check.scala @@ -1,15 +1,15 @@ object Test { def s1 = "bob".toList match { case Seq('b', 'o', 'b') => true } // list ok - + // not final, allowed - class Bop + class Bop def s2(x: Bop) = x match { case Seq('b', 'o', 'b') => true } - + // covariance, allowed final class Bop4[+T] def s3[T](x: Bop4[T]) = x match { case Seq('b', 'o', 'b') => true } - + // contravariance, allowed final class Bop5[T, U, -V] def s4[T1, T2](x: Bop5[_, T1, T2]) = x match { case Seq('b', 'o', 'b') => true } @@ -17,7 +17,7 @@ object Test // free type parameter, allowed final class Bop3[T] def f4[T](x: Bop3[T]) = x match { case Seq('b', 'o', 'b') => true } - + // String and Array are final/invariant, disallowed def f1 = "bob".reverse match { case Seq('b', 'o', 'b') => true } // fail def f2 = "bob".toArray match { case Seq('b', 'o', 'b') => true } // fail @@ -25,7 +25,7 @@ object Test // final, no type parameters, should be disallowed final class Bop2 def f3(x: Bop2) = x match { case Seq('b', 'o', 'b') => true } // fail - + // final, invariant type parameter, should be disallowed def f4[T](x: Bop3[Char]) = x match { case Seq('b', 'o', 'b') => true } // fail } diff --git a/test/files/neg/patmatexhaust.scala b/test/files/neg/patmatexhaust.scala index 45aed558da..9297e09d0d 100644 --- a/test/files/neg/patmatexhaust.scala +++ b/test/files/neg/patmatexhaust.scala @@ -22,14 +22,14 @@ class TestSealedExhaustive { // compile only def ma3(x:Mult) = (x,x) match { // not exhaustive case (Kult(_), Qult()) => // Kult missing - //case Pair(Kult(_), Kult(_)) => + //case Pair(Kult(_), Kult(_)) => case (Qult(), Kult(_)) => // Qult missing - //case Pair(Qult(), Qult()) => + //case Pair(Qult(), Qult()) => } def ma3u(x:Mult) = ((x,x) : @unchecked) match { // not exhaustive, but not checked! - case (Kult(_), Qult()) => - case (Qult(), Kult(_)) => + case (Kult(_), Qult()) => + case (Qult(), Kult(_)) => } sealed abstract class Deep @@ -37,22 +37,22 @@ class TestSealedExhaustive { // compile only case object Ga extends Deep sealed class Gp extends Deep case object Gu extends Gp - + def zma3(x:Deep) = x match { // exhaustive! case _ => } def zma4(x:Deep) = x match { // exhaustive! - case Ga => + case Ga => case _ => } def ma4(x:Deep) = x match { // missing cases: Gu, Gp - case Ga => + case Ga => } def ma5(x:Deep) = x match { // Gp case Gu => - case _ if 1 == 0 => + case _ if 1 == 0 => case Ga => } @@ -65,7 +65,7 @@ class TestSealedExhaustive { // compile only case 1::2::Nil => case _ => } - + sealed class B case class B1() extends B case object B2 extends B @@ -76,7 +76,7 @@ class TestSealedExhaustive { // compile only case B1() => true // missing B, which is not abstract so must be included case B2 => true } - + object ob1 { sealed abstract class C sealed abstract class C1 extends C @@ -89,7 +89,7 @@ class TestSealedExhaustive { // compile only case C2 | C4 => true } } - + object ob2 { sealed abstract class C abstract class C1 extends C diff --git a/test/files/neg/patternalts.scala b/test/files/neg/patternalts.scala index 539df43201..56b682b0ec 100644 --- a/test/files/neg/patternalts.scala +++ b/test/files/neg/patternalts.scala @@ -1,5 +1,5 @@ object Test { List(1) match { case List(x) | List() => Console.println(x) - } + } } diff --git a/test/files/neg/protected-constructors.scala b/test/files/neg/protected-constructors.scala index 2838caf09c..f2662ee67c 100644 --- a/test/files/neg/protected-constructors.scala +++ b/test/files/neg/protected-constructors.scala @@ -8,7 +8,7 @@ package dingus { package hungus { import dingus._ - + object P { class Bar1 extends Foo1("abc") class Bar2 extends Foo2("abc") diff --git a/test/files/neg/saito.scala b/test/files/neg/saito.scala index b4fcd598e4..bfabb4edf4 100644 --- a/test/files/neg/saito.scala +++ b/test/files/neg/saito.scala @@ -2,13 +2,13 @@ class B {} class A { self: B => def m(): B = { this - } + } } object Exec{ def main(args: Array[String]): Unit = { val a: A = new A; // should not be allowed - val b: B = a.m(); + val b: B = a.m(); } } diff --git a/test/files/neg/sensitive.scala b/test/files/neg/sensitive.scala index f435a385e1..fa1b940844 100644 --- a/test/files/neg/sensitive.scala +++ b/test/files/neg/sensitive.scala @@ -5,8 +5,8 @@ object Admin extends Certificate; class SecurityViolationException extends Exception object Sensitive { - def makeSensitive(credentials: Certificate): Sensitive = - if (credentials == Admin) new Sensitive() + def makeSensitive(credentials: Certificate): Sensitive = + if (credentials == Admin) new Sensitive() else throw new SecurityViolationException } class Sensitive private () { @@ -16,4 +16,4 @@ object Attacker { val x = Sensitive.makeSensitive(null) val y = new Sensitive() } - + diff --git a/test/files/neg/spec-overrides.scala b/test/files/neg/spec-overrides.scala index 713ce27bd3..f77dadea5d 100644 --- a/test/files/neg/spec-overrides.scala +++ b/test/files/neg/spec-overrides.scala @@ -15,7 +15,7 @@ class FX2 extends P { object Test extends App { val fx = new FX val p = new P - + println(fx.a(3)) println((fx: P).a(3)) println((fx: P).a(3.0)) diff --git a/test/files/neg/structural.scala b/test/files/neg/structural.scala index d783399317..bfca37b22a 100644 --- a/test/files/neg/structural.scala +++ b/test/files/neg/structural.scala @@ -1,54 +1,54 @@ object Test extends App { - + def f(x: { type D; def m: D }): Null = null - + class Tata - + abstract class Toto[A <: Object] { type B <: Object - + def f1[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: A): Object; val x: A }) = x.m[Tata](x.x) //fail def f2[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: B): Object; val x: B }) = x.m[Tata](x.x) //fail def f3[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: C): Object; val x: C }) = x.m[Tata](x.x) //fail def f4[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: D): Object; val x: D }) = x.m[Tata](x.x) //fail def f5[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: E): Object; val x: Tata }) = x.m[Tata](x.x) //suceed - + def f6[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: Object): A }) = x.m[Tata](null) //suceed def f7[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: Object): B }) = x.m[Tata](null) //suceed def f8[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: Object): C }) = x.m[Tata](null) //suceed def f9[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: Object): D }) = x.m[Tata](null) //fail def f0[C <: Object](x: Object{ type D <: Object; def m[E >: Null <: Object](x: Object): E }) = x.m[Tata](null) //suceed - + } - + val tata = new Tata val toto = new Toto[Tata] { type B = Tata } - + //toto.f1[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: Tata): Object = null; val x = tata }) //toto.f2[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: Tata): Object = null; val x = tata }) //toto.f3[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: Tata): Object = null; val x = tata }) //toto.f4[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: D): Object = null; val x = tata }) toto.f5[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: E): Object = null; val x: Test.Tata = tata }) - + toto.f6[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: Object): Tata = null }) toto.f7[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: Object): Tata = null }) toto.f8[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: Object): Tata = null }) //toto.f9[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: Object): D = null }) toto.f0[Tata](new Object{ type D = Tata; def m[E >: Null <: Object](x: Object): E = null }) - + /* Bug #1246 */ type Summable[T] = { def +(v : T) : T } def sum[T <: Summable[T]](xs : List[T]) = xs.reduceLeft[T](_ + _) - + /* Bug #1004 & #967 */ type S1 = { def f(p: this.type): Unit } val s1 = new { def f(p: this.type): Unit = () } - + type S2 = { type T; def f(p: T): Unit } //val s2: S2 = new { type T = A; def f(p: T): Unit = () } - + def s3[U >: Null <: Object](p: { def f(p: U): Unit; def u: U }) = () - + } diff --git a/test/files/neg/switch.scala b/test/files/neg/switch.scala index da7c867ba0..a3dfd869d6 100644 --- a/test/files/neg/switch.scala +++ b/test/files/neg/switch.scala @@ -16,44 +16,44 @@ object Main { case 'f' | 'g' => true case _ => false } - + def succ2(c: Char) = (c: @switch) match { case 'A' | 'B' | 'C' => true case Other.C2 => true case Other.C4 => true case _ => false } - + // has a guard def fail1(c: Char) = (c: @switch) match { case 'A' | 'B' | 'C' => true case x if x == 'A' => true case _ => false } - + // throwing in @unchecked on the next two to make sure // multiple annotations are processed correctly - + // thinks a val in an object is constant... so naive def fail2(c: Char) = (c: @switch @unchecked) match { case 'A' => true case Other.C1 => true case _ => false } - + // more naivete def fail3(c: Char) = (c: @unchecked @switch) match { case 'A' => true case Other.C3 => true case _ => false } - + // guard case done correctly def succ3(c: Char) = (c: @switch) match { case 'A' | 'B' | 'C' => true case x => x == 'A' } - + // some ints just to mix it up a bit def succ4(x: Int, y: Int) = ((x+y): @switch) match { case 1 => 5 @@ -62,5 +62,5 @@ object Main { case 4 => 50 case 5|6|7|8 => 100 case _ => -1 - } + } } diff --git a/test/files/neg/t0117.scala b/test/files/neg/t0117.scala index ec34ac0e4e..c73227d26d 100644 --- a/test/files/neg/t0117.scala +++ b/test/files/neg/t0117.scala @@ -3,4 +3,4 @@ trait B extends A { println(super[A].a) } object Test extends App { new B {} } - + diff --git a/test/files/neg/t0152.scala b/test/files/neg/t0152.scala index d86d59e974..dc77ac31a3 100644 --- a/test/files/neg/t0152.scala +++ b/test/files/neg/t0152.scala @@ -8,6 +8,6 @@ trait PlusOne extends Value[Int] { object Test extends App { object boom extends Value[java.lang.String]("foo") with PlusOne - + println(boom.value) // class cast exception! } diff --git a/test/files/neg/t0218.check b/test/files/neg/t0218.check index a22583d23b..6bb759156f 100644 --- a/test/files/neg/t0218.check +++ b/test/files/neg/t0218.check @@ -1,4 +1,4 @@ t0218.scala:10: error: class type required but APQ.this.P found - List(new PP) + List(new PP) ^ one error found diff --git a/test/files/neg/t0218.scala b/test/files/neg/t0218.scala index 319be82a7a..3d1f52e39a 100644 --- a/test/files/neg/t0218.scala +++ b/test/files/neg/t0218.scala @@ -1,4 +1,4 @@ -trait APQ { +trait APQ { class Placement { } @@ -7,6 +7,6 @@ trait APQ { type PP = P def pq(numQueens: Int, numRows: Int) : List[Placement] = { - List(new PP) + List(new PP) } } diff --git a/test/files/neg/t0503.scala b/test/files/neg/t0503.scala index 322e1ad132..a9b5dcb1dd 100644 --- a/test/files/neg/t0503.scala +++ b/test/files/neg/t0503.scala @@ -1,3 +1,3 @@ val x = new { } with { } -trait A +trait A val y = new { } with A diff --git a/test/files/neg/t0764.scala b/test/files/neg/t0764.scala index daeeb21d91..9aebe04b79 100644 --- a/test/files/neg/t0764.scala +++ b/test/files/neg/t0764.scala @@ -9,6 +9,6 @@ trait Node extends NotNull { outer => class Main[NextType <: Node](value: Node { type T = NextType }) extends Top[Node { type T = NextType }] { - + new Main[AType]( (value: AType).prepend ) } diff --git a/test/files/neg/t0816.scala b/test/files/neg/t0816.scala index 0128a0ad72..738a634166 100644 --- a/test/files/neg/t0816.scala +++ b/test/files/neg/t0816.scala @@ -6,7 +6,7 @@ case class Ctest(override val data: String) extends Btest(data, true) class testCaseClass { def test(x: Atest) = x match { - case Ctest(data) => Console.println("C") + case Ctest(data) => Console.println("C") case Btest(data, b) => Console.println("B") } } diff --git a/test/files/neg/t1011.scala b/test/files/neg/t1011.scala index 7dc3f49469..57a6ad7b45 100644 --- a/test/files/neg/t1011.scala +++ b/test/files/neg/t1011.scala @@ -3,7 +3,7 @@ import scala.xml._; abstract class Test { //val entity : String; - def primitiveHeader : NodeSeq = + def primitiveHeader : NodeSeq = Group({
{Text(entity)} {Text(entity)} diff --git a/test/files/neg/t1112.scala b/test/files/neg/t1112.scala index 1a88629faf..b2a374c785 100644 --- a/test/files/neg/t1112.scala +++ b/test/files/neg/t1112.scala @@ -1,13 +1,13 @@ // checks that error doesn't crash the compiler -// (due to isFunctionType normalizing Type1 to a function type, +// (due to isFunctionType normalizing Type1 to a function type, // but then the code that used that test not using the normalized type for further operations) class Test { type Type1 = () => Unit - + def call(p: Int)(f: => Type1) = { f() } - + def run = { call(0,() => System.out.println("here we are")) } diff --git a/test/files/neg/t112706A.check b/test/files/neg/t112706A.check index ad403ab134..30d0c3ec91 100644 --- a/test/files/neg/t112706A.check +++ b/test/files/neg/t112706A.check @@ -1,6 +1,6 @@ t112706A.scala:5: error: constructor cannot be instantiated to expected type; found : (T1, T2) required: String - case Tuple2(node,_) => + case Tuple2(node,_) => ^ one error found diff --git a/test/files/neg/t112706A.scala b/test/files/neg/t112706A.scala index 11304720bc..b7799af96d 100644 --- a/test/files/neg/t112706A.scala +++ b/test/files/neg/t112706A.scala @@ -2,7 +2,7 @@ package test; trait Test { def foo(p : List[Tuple2[String,String]]) = { for (t <- p) t._1 match { - case Tuple2(node,_) => + case Tuple2(node,_) => } } } diff --git a/test/files/neg/t1183.scala b/test/files/neg/t1183.scala index 23868ab401..024c4abd54 100644 --- a/test/files/neg/t1183.scala +++ b/test/files/neg/t1183.scala @@ -9,7 +9,7 @@ object Test { case class Bar(i:Int) } - + class Test717 { val foo1 = new Foo(1) @@ -27,7 +27,7 @@ object Test { class Baz object Bam object Bar - + def unapply(s : String) : Option[Bar] = Some(new Bar(s)) } diff --git a/test/files/neg/t1477.scala b/test/files/neg/t1477.scala index a9a6d678ca..ab13f14b06 100644 --- a/test/files/neg/t1477.scala +++ b/test/files/neg/t1477.scala @@ -8,7 +8,7 @@ object Test extends App { type V <: D val y: V#T = new B { } } - + trait Middle extends C { type V <: (D with U) } diff --git a/test/files/neg/t1523.scala b/test/files/neg/t1523.scala index 219fb0c060..b8754f4e15 100644 --- a/test/files/neg/t1523.scala +++ b/test/files/neg/t1523.scala @@ -1,5 +1,5 @@ -object test { +object test { def bug(x: Any) = x - + def go() = bug("a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a") } diff --git a/test/files/neg/t1623.scala b/test/files/neg/t1623.scala index f5189aa4ca..d02fc2ed9e 100644 --- a/test/files/neg/t1623.scala +++ b/test/files/neg/t1623.scala @@ -1,7 +1,7 @@ package test -trait A -trait B +trait A +trait B class BImpl extends B { this: A => diff --git a/test/files/neg/t1705.scala b/test/files/neg/t1705.scala index fabdca0ec6..bf1fcea815 100644 --- a/test/files/neg/t1705.scala +++ b/test/files/neg/t1705.scala @@ -17,7 +17,7 @@ object crashing { } } } -/* +/* Infinite loop in Typer.addLocals. Printing all calls to it: diff --git a/test/files/neg/t1878.scala b/test/files/neg/t1878.scala index 683dcb6b41..5278fbb7bd 100644 --- a/test/files/neg/t1878.scala +++ b/test/files/neg/t1878.scala @@ -1,13 +1,13 @@ object Test extends App { - // illegal + // illegal val err1 = "" match { case Seq(f @ _*, ',') => f } - + // no error val List(List(arg1, _*), _) = List(List(1,2,3), List(4,5,6)) - + // illegal val List(List(_*, arg2), _) = List(List(1,2,3), List(4,5,6)) - + // illegal - bug #1764 null match { case

{ _* }

=> diff --git a/test/files/neg/t2148.scala b/test/files/neg/t2148.scala index 25788be84a..c0521d9864 100644 --- a/test/files/neg/t2148.scala +++ b/test/files/neg/t2148.scala @@ -1,6 +1,6 @@ -class A { +class A { var i = 0 - trait A1 extends A { + trait A1 extends A { i += 1 } } diff --git a/test/files/neg/t2421b.scala b/test/files/neg/t2421b.scala index d8159a8c37..a8d22f285e 100644 --- a/test/files/neg/t2421b.scala +++ b/test/files/neg/t2421b.scala @@ -12,6 +12,6 @@ object Test { f } -/* bug: +/* bug: error: type arguments [Test2.A] do not conform to method b's type parameter bounds [X <: Test2.B] */ \ No newline at end of file diff --git a/test/files/neg/t2441.scala b/test/files/neg/t2441.scala index 6784ebb333..a8c9e728a2 100644 --- a/test/files/neg/t2441.scala +++ b/test/files/neg/t2441.scala @@ -1,5 +1,5 @@ trait X -trait A { +trait A { def f: Option[X] def g: Option[X] } @@ -8,7 +8,7 @@ object B { } class B extends A { private class Bippy - + override def f = Some(new B.Y) override def g: Option[X] = Some(new B.Y) } diff --git a/test/files/neg/t2641.scala b/test/files/neg/t2641.scala index bc048e039e..626d5d7852 100644 --- a/test/files/neg/t2641.scala +++ b/test/files/neg/t2641.scala @@ -8,7 +8,7 @@ abstract class ManagedSeqStrict[+A] with GenericTraversableTemplate[A, ManagedSeqStrict] { override def companion: GenericCompanion[ManagedSeqStrict] = null - + override def foreach[U](f: A => U): Unit = () } @@ -17,9 +17,9 @@ trait ManagedSeq[+A, +Coll] with TraversableView[A, ManagedSeqStrict[A]] with TraversableViewLike[A, ManagedSeqStrict[A], ManagedSeq[A]] { self => - + override def underlying = throw new Exception("no underlying") - + //trait Transformed[+B] extends ManagedSeq[B] with super.Transformed[B] trait Transformed[+B] extends ManagedSeq[B, Coll] with super.Transformed[B] diff --git a/test/files/neg/t2870.check b/test/files/neg/t2870.check index 759af53626..6577577d3f 100644 --- a/test/files/neg/t2870.check +++ b/test/files/neg/t2870.check @@ -2,6 +2,6 @@ t2870.scala:1: error: not found: type Jar class Jars(jar: Jar) ^ t2870.scala:6: error: illegal cyclic reference involving value - val scala = fromClasspathString(javaClassPath) + val scala = fromClasspathString(javaClassPath) ^ two errors found diff --git a/test/files/neg/t2870.scala b/test/files/neg/t2870.scala index 4de19242e3..59fba3e76d 100644 --- a/test/files/neg/t2870.scala +++ b/test/files/neg/t2870.scala @@ -1,9 +1,9 @@ class Jars(jar: Jar) -object Jars { +object Jars { import scala.util.Properties.javaClassPath - val scala = fromClasspathString(javaClassPath) - + val scala = fromClasspathString(javaClassPath) + def fromClasspathString(s: String): Jars = null } diff --git a/test/files/neg/t2910.scala b/test/files/neg/t2910.scala index d9a781032c..fa51038dcd 100644 --- a/test/files/neg/t2910.scala +++ b/test/files/neg/t2910.scala @@ -10,7 +10,7 @@ object Junk { val z = 0 lazy val s = "abc" } - + def test4() { lazy val x = { x @@ -35,5 +35,5 @@ object Test { lazy val f: Int = g var x: Int = f lazy val g: Int = x - } + } } diff --git a/test/files/neg/t2918.check b/test/files/neg/t2918.check index aae3045e8a..263beab518 100644 --- a/test/files/neg/t2918.check +++ b/test/files/neg/t2918.check @@ -1,10 +1,10 @@ t2918.scala:2: error: illegal cyclic reference involving type A - def g[X, A[X] <: A[X]](x: A[X]) = x + def g[X, A[X] <: A[X]](x: A[X]) = x ^ t2918.scala:2: error: cyclic aliasing or subtyping involving type A - def g[X, A[X] <: A[X]](x: A[X]) = x + def g[X, A[X] <: A[X]](x: A[X]) = x ^ t2918.scala:2: error: A does not take type parameters - def g[X, A[X] <: A[X]](x: A[X]) = x + def g[X, A[X] <: A[X]](x: A[X]) = x ^ three errors found diff --git a/test/files/neg/t2918.scala b/test/files/neg/t2918.scala index ff2be39ae0..03477ccfbf 100644 --- a/test/files/neg/t2918.scala +++ b/test/files/neg/t2918.scala @@ -1,3 +1,3 @@ object Test { - def g[X, A[X] <: A[X]](x: A[X]) = x + def g[X, A[X] <: A[X]](x: A[X]) = x } diff --git a/test/files/neg/t3015.check b/test/files/neg/t3015.check index 43ce1dc122..0b394e23d6 100644 --- a/test/files/neg/t3015.check +++ b/test/files/neg/t3015.check @@ -1,11 +1,11 @@ t3015.scala:7: error: scrutinee is incompatible with pattern type; found : _$1 where type +_$1 required: String - val b(foo) = "foo" + val b(foo) = "foo" ^ t3015.scala:7: error: type mismatch; found : String with _$1(in object Test) where type +_$1(in object Test) required: (some other)_$1(in object Test) where type +(some other)_$1(in object Test) - val b(foo) = "foo" + val b(foo) = "foo" ^ two errors found diff --git a/test/files/neg/t3015.scala b/test/files/neg/t3015.scala index adfa15b388..9af8f30c65 100644 --- a/test/files/neg/t3015.scala +++ b/test/files/neg/t3015.scala @@ -4,5 +4,5 @@ class UnApp[P] { object Test extends App { val b: UnApp[_] = new UnApp[String] - val b(foo) = "foo" + val b(foo) = "foo" } diff --git a/test/files/neg/t3118.scala b/test/files/neg/t3118.scala index 9be24c1ed4..75f3b8f50c 100644 --- a/test/files/neg/t3118.scala +++ b/test/files/neg/t3118.scala @@ -1,8 +1,8 @@ class O1 { private[this] case class C() - + val x = new O1 - + println(x.C()) // should not be accessible println(new x.C) // is correctly not accessible } diff --git a/test/files/neg/t3224.scala b/test/files/neg/t3224.scala index 589e1db4aa..774de3335a 100644 --- a/test/files/neg/t3224.scala +++ b/test/files/neg/t3224.scala @@ -1,16 +1,16 @@ object Texts{ - def textL[T](list: List[T]) = { - list match{ - case List() => "Empty" - case List(_) => "One" + def textL[T](list: List[T]) = { + list match{ + case List() => "Empty" + case List(_) => "One" case List(_*) => "Many" } } - def textA[T](array: Array[T]) = { - array match{ - case Array() => "Empty" - case Array(_) => "One" + def textA[T](array: Array[T]) = { + array match{ + case Array() => "Empty" + case Array(_) => "One" case Array(_*) => "Many" } } @@ -23,7 +23,7 @@ object Test extends App { array.toList } - + println(Texts textL List()); println(Texts textL List(1)); println(Texts textL List(1, 1)); println(Texts textL Array()); println(Texts textL Array(1)); println(Texts textL Array(1, 1)) diff --git a/test/files/neg/t3399.scala b/test/files/neg/t3399.scala index 3edaa0724f..b1fe4e5ee2 100644 --- a/test/files/neg/t3399.scala +++ b/test/files/neg/t3399.scala @@ -10,7 +10,7 @@ object Nats { 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 @@ -18,7 +18,7 @@ object Nats { 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/t3453.scala b/test/files/neg/t3453.scala index 090b777151..0f1c6e0282 100644 --- a/test/files/neg/t3453.scala +++ b/test/files/neg/t3453.scala @@ -25,7 +25,7 @@ object O { class T2a { import O._ - + def x: B = { val aToB = 3 // ok: doesn't compile, because aToB method requires 'T.this.' prefix @@ -39,7 +39,7 @@ class T2a { class T2b { import O.aToB - + def x: B = { val aToB = 3 // ok: doesn't compile, because aToB method requires 'T.this.' prefix @@ -53,7 +53,7 @@ class T2b { class T3 { implicit def aToB(a: A): B = new B - + def x: B = { val aToB = 3 // ok: doesn't compile, because aToB method requires 'T.this.' prefix diff --git a/test/files/neg/t3507.scala b/test/files/neg/t3507.scala index 9a8c7c5462..32688d3934 100644 --- a/test/files/neg/t3507.scala +++ b/test/files/neg/t3507.scala @@ -8,7 +8,7 @@ class A { 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 diff --git a/test/files/neg/t3683b.scala b/test/files/neg/t3683b.scala index 646e418121..fbf75b6856 100644 --- a/test/files/neg/t3683b.scala +++ b/test/files/neg/t3683b.scala @@ -8,7 +8,7 @@ case class Z[T >: Bar <: Foo]( z1: W[T] ) extends W[T] -object Main { +object Main { // should fail for including X() def f1(w: W[Bar]): Int = { w match { diff --git a/test/files/neg/t3714-neg.scala b/test/files/neg/t3714-neg.scala index 753b367ec0..4b56f9348c 100644 --- a/test/files/neg/t3714-neg.scala +++ b/test/files/neg/t3714-neg.scala @@ -29,7 +29,7 @@ object Test { case BreakImpl(x) => x case _ => -1 } - + def main(args: Array[String]) { val break = BreakImpl(22) assert(f1(break) == 22) diff --git a/test/files/neg/t3736.scala b/test/files/neg/t3736.scala index cf0920912a..1efa397928 100644 --- a/test/files/neg/t3736.scala +++ b/test/files/neg/t3736.scala @@ -7,14 +7,14 @@ object Test { def f5 = super.!=(new AnyRef) def f6 = super.## } - + // Ill-advised overloads to be sure... class B { def ##(x: String) = true def ==(x1: String, xs: List[_]) = true def !=(x1: String, xs: List[_]) = true } - + class C extends B { override def ##(x: String) = super.##(x) override def ==(x1: String, xs: List[_]) = super.==(x1, xs) diff --git a/test/files/neg/t3757/B.scala b/test/files/neg/t3757/B.scala index 7c78fb634e..68766a9f6e 100644 --- a/test/files/neg/t3757/B.scala +++ b/test/files/neg/t3757/B.scala @@ -1,5 +1,5 @@ package b -class B extends a.A { +class B extends a.A { override def foo = "B" } \ No newline at end of file diff --git a/test/files/neg/t3776.check b/test/files/neg/t3776.check index 0dfe129596..4a5284cf0f 100644 --- a/test/files/neg/t3776.check +++ b/test/files/neg/t3776.check @@ -1,4 +1,4 @@ t3776.scala:8: error: value someOperation is not a member of _$1 - def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v + def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v ^ one error found diff --git a/test/files/neg/t3776.scala b/test/files/neg/t3776.scala index 6e368165aa..454f914316 100644 --- a/test/files/neg/t3776.scala +++ b/test/files/neg/t3776.scala @@ -5,6 +5,6 @@ object MyParser extends RegexParsers with PackratParsers { object Test { class ParsedAs(a: String) (implicit pattern: MyParser.Parser[_]) { - def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v + def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v } } diff --git a/test/files/neg/t3816.scala b/test/files/neg/t3816.scala index 31b0825f1d..b7f3fde699 100644 --- a/test/files/neg/t3816.scala +++ b/test/files/neg/t3816.scala @@ -1,7 +1,7 @@ class B { def ::(a: List[Int]) { a match { - case x::xs => + case x::xs => case _ => } } @@ -32,11 +32,11 @@ object Test { } } - var foo = 0 + var foo = 0 def testFail2( x: Any ) = { x match { case Some( `foo` ) => case _ => } - } + } } diff --git a/test/files/neg/t3987.scala b/test/files/neg/t3987.scala index 1226d80228..c97d57b38f 100644 --- a/test/files/neg/t3987.scala +++ b/test/files/neg/t3987.scala @@ -1,7 +1,7 @@ class Gox { object Zed { } class Zed { } -} +} object Test { type GoxZed = t#Zed forSome { type t <: Gox } diff --git a/test/files/neg/t4079/t4079_1.scala b/test/files/neg/t4079/t4079_1.scala index cbae864788..8dc73556c7 100644 --- a/test/files/neg/t4079/t4079_1.scala +++ b/test/files/neg/t4079/t4079_1.scala @@ -9,7 +9,7 @@ trait ComposeT[F[_],G[_]] { case class Compose[F[_],G[_]]() { def Functor(implicit f: Functor[F], g: Functor[G]): Functor[ComposeT[F,G]#Apply] = new Functor[ComposeT[F,G]#Apply] { - def map[A,B](c: ComposeT[F,G]#Apply[A], h: A => B) = + def map[A,B](c: ComposeT[F,G]#Apply[A], h: A => B) = f.map(c, (x:G[A]) => g.map(x,h)) } } @@ -19,10 +19,10 @@ object Cat { } object Functors { - implicit val List = new Functor[List] { + implicit val List = new Functor[List] { def map[A,B](fa: List[A], f: A => B): List[B] = fa map f } - implicit val Option = new Functor[Option] { + implicit val Option = new Functor[Option] { def map[A,B](fa: Option[A], f: A => B): Option[B] = fa map f } } diff --git a/test/files/neg/t4174.scala b/test/files/neg/t4174.scala index b4a5ab29da..f5242950c2 100644 --- a/test/files/neg/t4174.scala +++ b/test/files/neg/t4174.scala @@ -2,7 +2,7 @@ class C object Test { def foo(c: C) = 0 - + def main(args: Array[String]): Unit = { foo(new C { override def bar = 1 }) } diff --git a/test/files/neg/t4196.scala b/test/files/neg/t4196.scala index 06e1f28d54..ac00b19bee 100644 --- a/test/files/neg/t4196.scala +++ b/test/files/neg/t4196.scala @@ -1,6 +1,6 @@ object Weird { - { (s: String) => + { (s: String) => val foo = Some(s); // to illustrate that vals are printed in the error - foo + foo }.apply("first param") ("spurious param") } \ No newline at end of file diff --git a/test/files/neg/t4217.check b/test/files/neg/t4217.check index 6c49ec3354..e8cd5fd69e 100644 --- a/test/files/neg/t4217.check +++ b/test/files/neg/t4217.check @@ -1,4 +1,4 @@ t4217.scala:2: error: 'case' expected but '}' found. - 42 match { } + 42 match { } ^ one error found diff --git a/test/files/neg/t4217.scala b/test/files/neg/t4217.scala index 0817df2cb7..9343a9be54 100644 --- a/test/files/neg/t4217.scala +++ b/test/files/neg/t4217.scala @@ -1,3 +1,3 @@ object A extends App { - 42 match { } + 42 match { } } diff --git a/test/files/neg/t4221.scala b/test/files/neg/t4221.scala index 0a8b8add18..c979f7936e 100644 --- a/test/files/neg/t4221.scala +++ b/test/files/neg/t4221.scala @@ -1,5 +1,5 @@ class Cl { - class Sub[TheSub <: Sub[TheSub]] + class Sub[TheSub <: Sub[TheSub]] } case class Wrapper[T](v: T) diff --git a/test/files/neg/t4417.scala b/test/files/neg/t4417.scala index 3f6ddc8153..7f104e58bf 100644 --- a/test/files/neg/t4417.scala +++ b/test/files/neg/t4417.scala @@ -2,12 +2,12 @@ -class Pixel[@specialized T] protected (var v: T) +class Pixel[@specialized T] protected (var v: T) object Pixel { type Pixel1d = Pixel[Double] - + def apply(v: Double): Pixel1d = new Pixel1d(v) } diff --git a/test/files/neg/t4431.scala b/test/files/neg/t4431.scala index 5fbb239e04..91e4abfe36 100644 --- a/test/files/neg/t4431.scala +++ b/test/files/neg/t4431.scala @@ -7,7 +7,7 @@ object Test { // this earns a VerifyError. trait C { def wait (): Unit } class D { } - + def main(args: Array[String]): Unit = { new B with A { } new BB diff --git a/test/files/neg/t4457_1.scala b/test/files/neg/t4457_1.scala index 11f12379f6..91d9bc9f51 100644 --- a/test/files/neg/t4457_1.scala +++ b/test/files/neg/t4457_1.scala @@ -22,7 +22,7 @@ object ImplicitConvAmbiguity2 { def aFunc[A](a: NQ[A]) = new BB[A] def bFunc[T](e1: N[T]) = {} - + def typeMe1 { val x = aFunc(4F) bFunc(x) diff --git a/test/files/neg/t4457_2.scala b/test/files/neg/t4457_2.scala index f3a170f1f2..b2e7505cf2 100644 --- a/test/files/neg/t4457_2.scala +++ b/test/files/neg/t4457_2.scala @@ -22,7 +22,7 @@ object ImplicitConvAmbiguity2 { def aFunc[A](a: NQ[A]) = new BB[A] def bFunc[T](e1: N[T]) = {} - + def typeMe2 { val x = aFunc(4F) bFunc(x) diff --git a/test/files/neg/t4851/J.java b/test/files/neg/t4851/J.java index 9c35b8a16e..dbf8b8288e 100644 --- a/test/files/neg/t4851/J.java +++ b/test/files/neg/t4851/J.java @@ -1,14 +1,14 @@ public class J { Object x; - + public J(Object x) { this.x = x; } - + public J(int x1, int x2, int x3, int x4, int x5, int x6) { this.x = null; } - + public String toString() { return "J:" + x.getClass(); } diff --git a/test/files/neg/t4851/J2.java b/test/files/neg/t4851/J2.java index 82954d9489..c3a7231315 100644 --- a/test/files/neg/t4851/J2.java +++ b/test/files/neg/t4851/J2.java @@ -1,10 +1,10 @@ public class J2 { T x; - + public J(T x) { this.x = x; } - + public String toString() { return "J2:" + x.getClass(); } diff --git a/test/files/neg/t4851/S.scala b/test/files/neg/t4851/S.scala index deb42980ab..1550892967 100644 --- a/test/files/neg/t4851/S.scala +++ b/test/files/neg/t4851/S.scala @@ -5,7 +5,7 @@ object Test { val y1 = Some(1, 2, 3) val y2 = new Some(1, 2, 3) - + val z1 = new J2 val z2 = new J2() val z3 = new J2(()) @@ -15,7 +15,7 @@ object Test { println(x2) println(x3) println(y1) - + println(z1) println(z2) println(z3) diff --git a/test/files/neg/t4877.scala b/test/files/neg/t4877.scala index 5d97877518..9cad156f84 100644 --- a/test/files/neg/t4877.scala +++ b/test/files/neg/t4877.scala @@ -13,7 +13,7 @@ class B { def bar(x: Int): Mom def bippy(): List[Mom] } - + val x: Bippy = new AnyRef { type Mom = String def bar(x: Int) = 55 diff --git a/test/files/neg/t5120.scala b/test/files/neg/t5120.scala index f28b2cfb4f..c7063b7d15 100644 --- a/test/files/neg/t5120.scala +++ b/test/files/neg/t5120.scala @@ -6,7 +6,7 @@ class Cell[T](x0: T) { object Test { val str: Cell[String] = new Cell("a") val other: Cell[Int] = new Cell(0) - + def main(args: Array[String]): Unit = { List(str, other) foreach (_.x1 = new AnyRef) str.x1.length diff --git a/test/files/neg/t520.scala b/test/files/neg/t520.scala index 076aca3122..949a509518 100644 --- a/test/files/neg/t520.scala +++ b/test/files/neg/t520.scala @@ -4,6 +4,6 @@ object test { assert(keyword != null); } - def verifyKeyword(source : java.io.File, pos : Int) = + def verifyKeyword(source : java.io.File, pos : Int) = verifyKeyword("", source, pos); } diff --git a/test/files/neg/t558.scala b/test/files/neg/t558.scala index 58b030347c..4941a06c3b 100644 --- a/test/files/neg/t558.scala +++ b/test/files/neg/t558.scala @@ -11,7 +11,7 @@ abstract class NewModel { val parent : SymbolURL; final val top = parent.top; final val source = top.file; - + } abstract class RootURL extends SymbolURL { final val top : RootURL = this; diff --git a/test/files/neg/t563.scala b/test/files/neg/t563.scala index 204ad3cbdd..d367e2a73c 100644 --- a/test/files/neg/t563.scala +++ b/test/files/neg/t563.scala @@ -1,6 +1,6 @@ object Test { def map[A,R](a : List[A], f : A => R) : List[R] = a.map(f); - + def split(sn : Iterable[List[Option[Int]]]) : Unit = for (n <- sn) map(n,ptr => Option(ptr.get)); diff --git a/test/files/neg/t576.scala b/test/files/neg/t576.scala index fd83217a45..fa7ee6019f 100644 --- a/test/files/neg/t576.scala +++ b/test/files/neg/t576.scala @@ -4,16 +4,16 @@ abstract class BaseListXXX { type Node <: BaseNode; abstract class BaseNode { } -} +} trait PriorityTreeXXX extends BaseListXXX { type Node <: BasicTreeNode; - + trait BasicTreeNode extends BaseNode { - def sibling: Node; + def sibling: Node; def insert(dir : Int, node : Node) = { if (true) sibling.insert(node); //else insert(node); - + } def insert(node : Node) : Unit = {} } diff --git a/test/files/neg/t588.scala b/test/files/neg/t588.scala index f30937377e..1bc6d2680f 100644 --- a/test/files/neg/t588.scala +++ b/test/files/neg/t588.scala @@ -1,15 +1,15 @@ abstract class Test0 { - def visit(f: Int => Unit): Boolean + def visit(f: Int => Unit): Boolean def visit(f: Int => String): Boolean } trait Test { type TypeA <: TraitA; type TypeB <: TypeA with TraitB; - + def f(node : TypeA) : Unit; def f(brac : TypeB) : Unit; - + trait TraitA; trait TraitB; - + } diff --git a/test/files/neg/t591.scala b/test/files/neg/t591.scala index 0f0b02395c..5f2397e6a9 100644 --- a/test/files/neg/t591.scala +++ b/test/files/neg/t591.scala @@ -1,17 +1,17 @@ abstract class BaseList { type Node <: BaseNode; - - + + abstract class BaseNode { protected def self : Node; private[BaseList] def self00 = self; def dirty : Unit = {} def replaceWith(node : Node) = {} } - + implicit def baseNode2Node(bnode : BaseNode): Node = bnode.self00; - + } @@ -20,22 +20,22 @@ trait BaseFlow extends BaseList { type Flow <: FlowBase; type Output <: OutputBase; type Input <: InputBase; - + abstract class FlowBase { - + } trait OutputBase extends FlowBase { - + } trait InputBase extends FlowBase { - + } - + trait BFNode extends BaseNode { private var input : Input = _; private var output : Output = _; - + def input_=(in : Input) = {} - + } } diff --git a/test/files/neg/t608.scala b/test/files/neg/t608.scala index 34dc4c0352..1f12764dd1 100644 --- a/test/files/neg/t608.scala +++ b/test/files/neg/t608.scala @@ -2,7 +2,7 @@ trait CrashDueToTypeError { def id[a](x :a) :a = x trait Bifunctor { - type a; // content + type a; // content type s <: Bifunctor // uncomment this-vvvvvvvvvvvvvvvvvvvvvvvvvvvv, and it compiles diff --git a/test/files/neg/t692.check b/test/files/neg/t692.check index 25dda7bd1b..12b7d40ba5 100644 --- a/test/files/neg/t692.check +++ b/test/files/neg/t692.check @@ -11,7 +11,7 @@ t692.scala:13: error: class Foo takes type parameters case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType); ^ t692.scala:14: error: class Foo takes type parameters - implicit def typeOfBar[T4 <: Foo](implicit elem : RefType[T4]) : RefType[Bar[T4]] = + implicit def typeOfBar[T4 <: Foo](implicit elem : RefType[T4]) : RefType[Bar[T4]] = ^ t692.scala:15: error: type mismatch; found : test3.this.BarType[T4] diff --git a/test/files/neg/t692.scala b/test/files/neg/t692.scala index 24e1d2fea3..f230a6bacf 100644 --- a/test/files/neg/t692.scala +++ b/test/files/neg/t692.scala @@ -5,15 +5,15 @@ abstract class test3 { abstract class RefType[C <: AnyRef] extends Type[C]; case class ObjectType() extends RefType[AnyRef]; abstract class ClassType[C <: Z, Z <: AnyRef](zuper : RefType[Z]) extends RefType[C]; - + case class FooType() extends ClassType[Foo,AnyRef](ObjectType()); implicit def typeOfFoo = FooType(); case class BarType[T3 <: Foo](tpeT : RefType[T3]) extends ClassType[Bar[T3],Foo](FooType); - implicit def typeOfBar[T4 <: Foo](implicit elem : RefType[T4]) : RefType[Bar[T4]] = + implicit def typeOfBar[T4 <: Foo](implicit elem : RefType[T4]) : RefType[Bar[T4]] = BarType(elem); - + class Foo[A <: AnyRef]; class Bar[A <: Foo](implicit tpeA : Type[A]) extends Foo; diff --git a/test/files/neg/t693.check b/test/files/neg/t693.check index 25bd141501..62325b5c60 100644 --- a/test/files/neg/t693.check +++ b/test/files/neg/t693.check @@ -1,4 +1,4 @@ t693.scala:4: error: x is already defined as value x - val x : Int = 10; + val x : Int = 10; ^ one error found diff --git a/test/files/neg/t693.scala b/test/files/neg/t693.scala index 3a9e6247a8..d2074bee38 100644 --- a/test/files/neg/t693.scala +++ b/test/files/neg/t693.scala @@ -1,5 +1,5 @@ abstract class test4 { trait Type; val x : Type = null; - val x : Int = 10; + val x : Int = 10; } diff --git a/test/files/neg/t715.scala b/test/files/neg/t715.scala index 87b2525a63..a5ccd567f9 100644 --- a/test/files/neg/t715.scala +++ b/test/files/neg/t715.scala @@ -1,4 +1,4 @@ -package test; +package test; trait B { type Node <: NodeImpl; trait NodeImpl { diff --git a/test/files/neg/t783.scala b/test/files/neg/t783.scala index 59f7c7f97d..5d20bc6d24 100644 --- a/test/files/neg/t783.scala +++ b/test/files/neg/t783.scala @@ -18,7 +18,7 @@ object Main extends App { def globalInit : Global; final def globalInit0 = globalInit.asInstanceOf[global.type]; } - + object global0 extends Global { object analyzer extends Analyzer { type Global = global0.type; diff --git a/test/files/neg/t798.scala b/test/files/neg/t798.scala index a2bf66d19b..b4a1939444 100644 --- a/test/files/neg/t798.scala +++ b/test/files/neg/t798.scala @@ -4,5 +4,5 @@ trait Test[Bracks <: Bracks] { class C[T] val bracks : Bracks; val singletons = f(bracks); - + } diff --git a/test/files/neg/t836.scala b/test/files/neg/t836.scala index 3633b816c6..de23cf5387 100644 --- a/test/files/neg/t836.scala +++ b/test/files/neg/t836.scala @@ -10,7 +10,7 @@ abstract class A { } class B extends A { - type MyObj = ObjImpl + type MyObj = ObjImpl val myString: S = "hello" val realString: String = myString // error: type missmatch } diff --git a/test/files/neg/t856.scala b/test/files/neg/t856.scala index fea216bfad..e50084b6bd 100644 --- a/test/files/neg/t856.scala +++ b/test/files/neg/t856.scala @@ -1,4 +1,4 @@ -trait Complex extends Product2[Double,Double] +trait Complex extends Product2[Double,Double] class ComplexRect(val _1:Double, _2:Double) extends Complex { override def toString = "ComplexRect("+_1+","+_2+")" diff --git a/test/files/neg/t876.scala b/test/files/neg/t876.scala index 1f6a90dff3..fb1461a7d3 100644 --- a/test/files/neg/t876.scala +++ b/test/files/neg/t876.scala @@ -11,11 +11,11 @@ object AssertionError extends AnyRef with App class Manager { final class B {} - + val map = new HashMap[A, B] } - - + + def test[T](f: => T) { f } test { diff --git a/test/files/neg/t877.scala b/test/files/neg/t877.scala index 5e132a1dd4..8cb98279db 100644 --- a/test/files/neg/t877.scala +++ b/test/files/neg/t877.scala @@ -1,3 +1,3 @@ -class A +class A trait Foo extends A(22A, Bug!) {} diff --git a/test/files/neg/t944.scala b/test/files/neg/t944.scala index dc80e5f49f..352269a80b 100644 --- a/test/files/neg/t944.scala +++ b/test/files/neg/t944.scala @@ -1,6 +1,6 @@ object TooManyArgsFunction { - val f = (a1:Int, a2:Int, a3:Int, a4:Int, a5:Int, a6:Int, a7:Int, a8:Int, - a9:Int, a10:Int, a11:Int, a12:Int, a13:Int, a14:Int, a15:Int, - a16:Int, a17:Int, a18:Int, a19:Int, a20:Int, a21:Int, a22:Int, + val f = (a1:Int, a2:Int, a3:Int, a4:Int, a5:Int, a6:Int, a7:Int, a8:Int, + a9:Int, a10:Int, a11:Int, a12:Int, a13:Int, a14:Int, a15:Int, + a16:Int, a17:Int, a18:Int, a19:Int, a20:Int, a21:Int, a22:Int, a23:Int) => 1 } diff --git a/test/files/neg/tailrec.scala b/test/files/neg/tailrec.scala index e0ebde9863..5b9018ae89 100644 --- a/test/files/neg/tailrec.scala +++ b/test/files/neg/tailrec.scala @@ -9,21 +9,21 @@ object Winners { @tailrec def loopsucc1(x: Int): Int = loopsucc1(x - 1) @tailrec def loopsucc2[T](x: Int): Int = loopsucc2[T](x - 1) - + def ding() { object dong { @tailrec def loopsucc3(x: Int): Int = loopsucc3(x) } () } - + def inner(q: Int) = { @tailrec def loopsucc4(x: Int): Int = loopsucc4(x + 1) - + loopsucc4(q) } - + object innerBob { @tailrec def loopsucc5(x: Int): Int = loopsucc5(x) } @@ -45,19 +45,19 @@ object Failures { else n * facfail(n - 1) } -class Failures { +class Failures { // not private, not final @tailrec def fail1(x: Int): Int = fail1(x) - + // a typical between-chair-and-keyboard error @tailrec final def fail2[T](xs: List[T]): List[T] = xs match { case Nil => Nil case x :: xs => x :: fail2[T](xs) } - + // unsafe @tailrec final def fail3[T](x: Int): Int = fail3(x - 1) - + // unsafe class Tom[T](x: Int) { @tailrec final def fail4[U](other: Tom[U], x: Int): Int = other.fail4[U](other, x - 1) diff --git a/test/files/neg/tcpoly_infer_ticket1162.scala b/test/files/neg/tcpoly_infer_ticket1162.scala index 0552b42a22..b88bd358d9 100644 --- a/test/files/neg/tcpoly_infer_ticket1162.scala +++ b/test/files/neg/tcpoly_infer_ticket1162.scala @@ -1,8 +1,8 @@ object Test { - trait Expression[A,B] + trait Expression[A,B] case class Lift[A,B,F[_]]() extends Expression[F[A],F[B]] - + def simplify[A,B]: Expression[A,B] = Lift[A,B]() } diff --git a/test/files/neg/tcpoly_ticket2101.scala b/test/files/neg/tcpoly_ticket2101.scala index 68f061ce70..3af07acfac 100644 --- a/test/files/neg/tcpoly_ticket2101.scala +++ b/test/files/neg/tcpoly_ticket2101.scala @@ -4,10 +4,10 @@ class T2[X] extends T[T2, X] // ill-typed // Forall Y. T2[Y] <: T[T2, X] // debugging before fix: -// def isSubType0 --> +// def isSubType0 --> // case (PolyType(tparams1, res1), PolyType(tparams2, res2)) => println("<: p2.info.substSym(tparams2, tparams1) <:< p1.info) && // res1 <:< res2.substSym(tparams2, tparams1)) @@ -22,7 +22,7 @@ class T2[X] extends T[T2, X] // ill-typed // (tparams1.length == tparams2.length && // { // val tpsFresh = cloneSymbols(tparams1) // @M cloneSymbols(tparams2) should be equivalent -- TODO: check -// List.forall2(tparams1, tparams2) +// List.forall2(tparams1, tparams2) // ((p1, p2) => p2.info.substSym(tparams2, tpsFresh) <:< p1.info.substSym(tparams1, tpsFresh)) && -// res1.substSym(tparams1, tpsFresh) <:< res2.substSym(tparams2, tpsFresh) +// res1.substSym(tparams1, tpsFresh) <:< res2.substSym(tparams2, tpsFresh) // }) diff --git a/test/files/neg/tcpoly_typealias.scala b/test/files/neg/tcpoly_typealias.scala index 6c7f80cc0b..96e9349298 100644 --- a/test/files/neg/tcpoly_typealias.scala +++ b/test/files/neg/tcpoly_typealias.scala @@ -12,7 +12,7 @@ trait A3 { trait FooCov[+x] trait FooCon[-x] -trait FooBound[+x <: String] +trait FooBound[+x <: String] trait BOk1 extends A { type m[+x] = FooCov[x] @@ -30,8 +30,8 @@ trait BOk4 extends A3 { type m[+x] = FooCov[x] // weaker variance } -// there are two aspects to check: - // does type alias signature (not considering RHS) correspond to abstract type member in super class +// there are two aspects to check: + // does type alias signature (not considering RHS) correspond to abstract type member in super class // does RHS correspond to the type alias sig trait BInv extends A{ type m[x] = FooCov[x] // error: invariant x in alias def diff --git a/test/files/neg/tcpoly_variance_enforce.scala b/test/files/neg/tcpoly_variance_enforce.scala index ddff0e9f94..0db7b692f8 100644 --- a/test/files/neg/tcpoly_variance_enforce.scala +++ b/test/files/neg/tcpoly_variance_enforce.scala @@ -6,7 +6,7 @@ trait coll3[m[x]] trait coll4[m[x <: y], y] -class FooInvar[x] +class FooInvar[x] class FooContra[-x] class FooCov[+x] class FooString[+x <: String] @@ -15,15 +15,15 @@ object fcollok extends coll[FooCov] object fcollinv extends coll[FooInvar] // error object fcollcon extends coll[FooContra] // error object fcollwb extends coll[FooString] // error - + object fcoll2ok extends coll2[FooCov] // error object fcoll2inv extends coll2[FooInvar] // error -object fcoll2con extends coll2[FooContra] +object fcoll2con extends coll2[FooContra] object fcoll2wb extends coll2[FooString] // error - -object fcoll3ok extends coll3[FooCov] -object fcoll3inv extends coll3[FooInvar] -object fcoll3con extends coll3[FooContra] + +object fcoll3ok extends coll3[FooCov] +object fcoll3inv extends coll3[FooInvar] +object fcoll3con extends coll3[FooContra] object fcoll3wb extends coll3[FooString] // error object fcoll4ok extends coll4[FooString, String] @@ -33,7 +33,7 @@ object fcoll4_2 extends coll4[FooString, Any] // error object test { var ok: coll[FooCov] = _ - + def x: coll[FooInvar] = sys.error("foo") // error def y: coll[FooContra] = sys.error("foo") // error } diff --git a/test/files/neg/type-diagnostics.scala b/test/files/neg/type-diagnostics.scala index c4171328de..de7e7adc3c 100644 --- a/test/files/neg/type-diagnostics.scala +++ b/test/files/neg/type-diagnostics.scala @@ -6,14 +6,14 @@ object SetVsSet { object TParamConfusion { def strings(xs: List[String]) = xs - + def f1[a <% Ordered[a]](x: List[a]) = { def f2[b >: List[a] <% Ordered[b]](x: List[a], y: b): Int = { def f3(xs: List[a], ys: List[a]) = -1 y match { case y1: List[a] => f3(x, y1) } } } - + def f2[String](s: String) = strings(List(s)) } diff --git a/test/files/neg/unit-returns-value.scala b/test/files/neg/unit-returns-value.scala index 27a1111c5b..ecc981f217 100644 --- a/test/files/neg/unit-returns-value.scala +++ b/test/files/neg/unit-returns-value.scala @@ -3,7 +3,7 @@ object Test { var b = false if (b) return 5 } - + // no warning def g { return println("hello") diff --git a/test/files/neg/varargs.scala b/test/files/neg/varargs.scala index be75e9b0a7..657750ec8f 100644 --- a/test/files/neg/varargs.scala +++ b/test/files/neg/varargs.scala @@ -7,21 +7,21 @@ import annotation.varargs // Failing varargs annotation object Test { - + trait A { def v1(a: Int, b: Array[String]) = a } - + trait B extends A { @varargs def v1(a: Int, b: String*) = a + b.length } - + @varargs def nov(a: Int) = 0 @varargs def v(a: Int, b: String*) = a + b.length @varargs def v2(a: Int, b: String*) = 0 def v2(a: Int, b: Array[String]) = 0 - - def main(args: Array[String]) { + + def main(args: Array[String]) { } - + } diff --git a/test/files/neg/variances.check b/test/files/neg/variances.check index b134a9a68c..4eaab56cef 100644 --- a/test/files/neg/variances.check +++ b/test/files/neg/variances.check @@ -1,8 +1,8 @@ variances.scala:4: error: covariant type A occurs in contravariant position in type test.Vector[A] of value x - def append(x: Vector[A]): Vector[A] + def append(x: Vector[A]): Vector[A] ^ variances.scala:14: error: covariant type A occurs in contravariant position in type A of value a - private[this] def setA(a : A) = this.a = a + private[this] def setA(a : A) = this.a = a ^ variances.scala:16: error: covariant type A occurs in invariant position in supertype test.C[A] with ScalaObject of object Baz object Baz extends C[A] diff --git a/test/files/neg/variances.scala b/test/files/neg/variances.scala index f693480d1d..726bc35270 100644 --- a/test/files/neg/variances.scala +++ b/test/files/neg/variances.scala @@ -1,7 +1,7 @@ package test trait Vector[+A] { - def append(x: Vector[A]): Vector[A] + def append(x: Vector[A]): Vector[A] private[this] def append3(x: Vector[A]): Vector[A] = append(x) } @@ -11,8 +11,8 @@ object Covariant { class Foo[+A] { private[this] var a : A = _ def getA : A = a - private[this] def setA(a : A) = this.a = a - + private[this] def setA(a : A) = this.a = a + object Baz extends C[A] trait Convert[B] { def b2a(b : B) : A @@ -22,8 +22,8 @@ object Covariant { class Foo2[+A] { private[this] var a : A = _ def getA : A = a - private[this] def setA(a : A) = this.a = a - + private[this] def setA(a : A) = this.a = a + { trait Convert[B] { def b2a(b : B) : A @@ -35,8 +35,8 @@ object Covariant { class Foo3[+A] { private[this] var a : A = _ def getA : A = a - private[this] def setA(a : A) = this.a = a - + private[this] def setA(a : A) = this.a = a + private[this] trait Convert[B] { def b2a(b : B) : A def doit(b : B) = setA(b2a(b)) diff --git a/test/files/neg/viewtest.scala b/test/files/neg/viewtest.scala index 5e7d624d23..ddb7fa4a3b 100644 --- a/test/files/neg/viewtest.scala +++ b/test/files/neg/viewtest.scala @@ -37,7 +37,7 @@ object O { } } - implicit def view3[a <% Ordered[a]](x: List[a]): Ordered[List[a]] = + implicit def view3[a <% Ordered[a]](x: List[a]): Ordered[List[a]] = new Ordered[List[a]] { def compareTo [b >: List[a] <% Ordered[b]](y: b): Int = y match { case y1: List[a] => compareLists(x, y1) @@ -72,7 +72,7 @@ class Node[a <% Ordered[a]](elem: a, l: Tree[a], r: Tree[a]) extends Tree[a] { if (x == elem) this else if (x < elem) new Node(elem, l insert x, r) else new Node(elem, l, r insert x) - def elements: List[a] = + def elements: List[a] = l.elements ::: List(elem) ::: r.elements } @@ -86,7 +86,7 @@ case class Str(elem: String) extends Ordered[Str] { object Test { import O._ - private def toCharList(s: String): List[Char] = + private def toCharList(s: String): List[Char] = if (s.length() == 0) List() else s.charAt(0) :: toCharList(s.substring(1)) -- cgit v1.2.3