diff options
Diffstat (limited to 'test/files/neg')
152 files changed, 342 insertions, 345 deletions
diff --git a/test/files/neg/abstract-class-2.scala b/test/files/neg/abstract-class-2.scala index be45a09343..19f74f3da6 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 7eaaf2d620..3c80f30522 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/abstract-report.check b/test/files/neg/abstract-report.check index bd550f39f4..1ffeac060b 100644 --- a/test/files/neg/abstract-report.check +++ b/test/files/neg/abstract-report.check @@ -7,7 +7,7 @@ it has 12 unimplemented members. def isTraversableAgain: Boolean = ??? def toIterator: Iterator[String] = ??? def toStream: Stream[String] = ??? - + // Members declared in scala.collection.TraversableOnce def copyToArray[B >: String](xs: Array[B],start: Int,len: Int): Unit = ??? def exists(p: String => Boolean): Boolean = ??? diff --git a/test/files/neg/abstract-report2.check b/test/files/neg/abstract-report2.check index 35a99bdd25..6ea949353a 100644 --- a/test/files/neg/abstract-report2.check +++ b/test/files/neg/abstract-report2.check @@ -78,15 +78,15 @@ it has 24 unimplemented members. def retainAll(x$1: java.util.Collection[_]): Boolean = ??? def toArray[T](x$1: Array[T with Object]): Array[T with Object] = ??? def toArray(): Array[Object] = ??? - + // Members declared in scala.collection.GenTraversableOnce def isTraversableAgain: Boolean = ??? def toIterator: Iterator[(Set[Int], String)] = ??? def toStream: Stream[(Set[Int], String)] = ??? - + // Members declared in scala.math.Ordering def compare(x: List[Int],y: List[Int]): Int = ??? - + // Members declared in scala.collection.TraversableOnce def copyToArray[B >: (Set[Int], String)](xs: Array[B],start: Int,len: Int): Unit = ??? def exists(p: ((Set[Int], String)) => Boolean): Boolean = ??? diff --git a/test/files/neg/accesses.scala b/test/files/neg/accesses.scala index 290291586c..b1df6c0e6c 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/anytrait.scala b/test/files/neg/anytrait.scala index 1501486105..e76164f63d 100644 --- a/test/files/neg/anytrait.scala +++ b/test/files/neg/anytrait.scala @@ -1,7 +1,7 @@ trait T extends Any { var x = 1 - + { x += 1 } type T = Int diff --git a/test/files/neg/check-dead.scala b/test/files/neg/check-dead.scala index aadd788814..2d5bccb21d 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 27ee908153..b6083f75e4 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 fe9236f10f..8827494874 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 01c34f7039..c00569c91d 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" } diff --git a/test/files/neg/forward.scala b/test/files/neg/forward.scala index 3774fa838f..d5c0851f09 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 fd3b11160e..024b24c367 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.scala b/test/files/neg/gadts1.scala index 1fb6e57e2d..08403e6eec 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 878d3a7c99..22633a1f35 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,7 +55,7 @@ class Mxml { } -} +} // SI-5316 class Test3 { diff --git a/test/files/neg/java-access-neg/J.java b/test/files/neg/java-access-neg/J.java index 4f2024673c..b6bc3363a1 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 dd0af8d39d..b082bb7174 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 a0f6e3bd73..f41d7f038b 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 bbc4fe114a..f92534f506 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/logImplicits.scala b/test/files/neg/logImplicits.scala index fb5dd8a025..caf827163c 100644 --- a/test/files/neg/logImplicits.scala +++ b/test/files/neg/logImplicits.scala @@ -9,9 +9,9 @@ class B { object C { final val x = "abc" - + implicit def convert(p: x.type): Int = 123 - + math.max(122, x: Int) } diff --git a/test/files/neg/lubs.scala b/test/files/neg/lubs.scala index 639117f7bf..3524fa4d87 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/macro-exception.check b/test/files/neg/macro-exception.check index cee8b32ebd..dca97aebce 100644 --- a/test/files/neg/macro-exception.check +++ b/test/files/neg/macro-exception.check @@ -1,4 +1,4 @@ -Test_2.scala:2: error: exception during macro expansion: +Test_2.scala:2: error: exception during macro expansion: java.lang.Exception at Macros$.impl(Macros_1.scala:6) diff --git a/test/files/neg/migration28.scala b/test/files/neg/migration28.scala index ba73eea436..facc9b36d2 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/nested-fn-print.scala b/test/files/neg/nested-fn-print.scala index 9a4bd162c0..c599a235ab 100644 --- a/test/files/neg/nested-fn-print.scala +++ b/test/files/neg/nested-fn-print.scala @@ -2,7 +2,7 @@ object Test { var x1: Int => Float => Double = _ var x2: (Int => Float) => Double = _ var x3: Int => Double - + def main(args: Array[String]): Unit = { x1 = "a" x2 = "b" diff --git a/test/files/neg/null-unsoundness.scala b/test/files/neg/null-unsoundness.scala index 3f7e42fe17..0f8ed5e314 100644 --- a/test/files/neg/null-unsoundness.scala +++ b/test/files/neg/null-unsoundness.scala @@ -12,4 +12,3 @@ 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 2f894a33df..207b271df2 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 896722262d..8715c156a2 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 9ab66cf560..68b1ceaa30 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 45961e4fa6..745cdb2332 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/patmat-type-check.scala b/test/files/neg/patmat-type-check.scala index cc35089430..26d0409fa0 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.check b/test/files/neg/patmatexhaust.check index 6069dfdaab..2dad608451 100644 --- a/test/files/neg/patmatexhaust.check +++ b/test/files/neg/patmatexhaust.check @@ -15,7 +15,7 @@ It would fail on the following inputs: Gp(), Gu def ma4(x:Deep) = x match { // missing cases: Gu, Gp ^ patmatexhaust.scala:55: warning: unreachable code - case _ if 1 == 0 => + case _ if 1 == 0 => ^ patmatexhaust.scala:53: warning: match may not be exhaustive. It would fail on the following input: Gp() diff --git a/test/files/neg/patmatexhaust.scala b/test/files/neg/patmatexhaust.scala index ceb960ee97..aa7dac7d7d 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 { 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 56b682b0ec..539df43201 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.check b/test/files/neg/protected-constructors.check index e295917050..f44d7db9b9 100644 --- a/test/files/neg/protected-constructors.check +++ b/test/files/neg/protected-constructors.check @@ -3,19 +3,19 @@ protected-constructors.scala:17: error: too many arguments for constructor Foo1: ^ protected-constructors.scala:18: error: constructor Foo2 in class Foo2 cannot be accessed in object P Access to protected constructor Foo2 not permitted because - enclosing object P in package hungus is not a subclass of + enclosing object P in package hungus is not a subclass of class Foo2 in package dingus where target is defined val foo2 = new Foo2("abc") ^ protected-constructors.scala:19: error: class Foo3 in object Ding cannot be accessed in object dingus.Ding Access to protected class Foo3 not permitted because - enclosing object P in package hungus is not a subclass of + enclosing object P in package hungus is not a subclass of object Ding in package dingus where target is defined val foo3 = new Ding.Foo3("abc") ^ protected-constructors.scala:15: error: class Foo3 in object Ding cannot be accessed in object dingus.Ding Access to protected class Foo3 not permitted because - enclosing object P in package hungus is not a subclass of + enclosing object P in package hungus is not a subclass of object Ding in package dingus where target is defined class Bar3 extends Ding.Foo3("abc") ^ diff --git a/test/files/neg/protected-constructors.scala b/test/files/neg/protected-constructors.scala index f2662ee67c..2838caf09c 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/protected-static-fail.check b/test/files/neg/protected-static-fail.check index e149bc016f..9f0bc92e7d 100644 --- a/test/files/neg/protected-static-fail.check +++ b/test/files/neg/protected-static-fail.check @@ -3,13 +3,13 @@ S.scala:5: error: method f in object J cannot be accessed in object bippy.J ^ S.scala:6: error: method f1 in object S1 cannot be accessed in object bippy.S1 Access to protected method f1 not permitted because - enclosing object Test in package bippy is not a subclass of + enclosing object Test in package bippy is not a subclass of object S1 in package bippy where target is defined S1.f1() ^ S.scala:8: error: method f2 in class S2 cannot be accessed in bippy.S2 Access to protected method f2 not permitted because - enclosing object Test in package bippy is not a subclass of + enclosing object Test in package bippy is not a subclass of class S2 in package bippy where target is defined x.f2() ^ diff --git a/test/files/neg/saito.scala b/test/files/neg/saito.scala index bfabb4edf4..b4fcd598e4 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 fa1b940844..a084a0a8ca 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,3 @@ 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 f77dadea5d..713ce27bd3 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/specification-scopes.check b/test/files/neg/specification-scopes.check index 7af9842379..ab986135e5 100644 --- a/test/files/neg/specification-scopes.check +++ b/test/files/neg/specification-scopes.check @@ -1,5 +1,5 @@ P_2.scala:14: error: reference to x is ambiguous; -it is both defined in object C and imported subsequently by +it is both defined in object C and imported subsequently by import Q.X._ println("L14: "+x) // reference to 'x' is ambiguous here ^ diff --git a/test/files/neg/structural.scala b/test/files/neg/structural.scala index bfca37b22a..d783399317 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 198583fe41..a66ed768fa 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, but since SI-5830 that's ok def succ_guard(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 c73227d26d..4cd9ad6ef1 100644 --- a/test/files/neg/t0117.scala +++ b/test/files/neg/t0117.scala @@ -3,4 +3,3 @@ 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 dc77ac31a3..d86d59e974 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 6bb759156f..a22583d23b 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 3d1f52e39a..319be82a7a 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 a9b5dcb1dd..322e1ad132 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/t0816.scala b/test/files/neg/t0816.scala index 738a634166..0128a0ad72 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/t1112.scala b/test/files/neg/t1112.scala index b2a374c785..1a88629faf 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 30d0c3ec91..ad403ab134 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 b7799af96d..11304720bc 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 024c4abd54..23868ab401 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 ab13f14b06..a9a6d678ca 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 b8754f4e15..219fb0c060 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 d02fc2ed9e..f5189aa4ca 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 bf1fcea815..fabdca0ec6 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 99fee48a96..b29186afc0 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)) - + /* see t1878-typer.scala // illegal - bug #1764 null match { diff --git a/test/files/neg/t2148.scala b/test/files/neg/t2148.scala index c0521d9864..25788be84a 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 a8d22f285e..d8159a8c37 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 a8c9e728a2..6784ebb333 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 626d5d7852..bc048e039e 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.scala b/test/files/neg/t2870.scala index 59fba3e76d..4de19242e3 100755 --- 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 fa51038dcd..d9a781032c 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/t3015.check b/test/files/neg/t3015.check index 6948392bb0..729db844e7 100644 --- a/test/files/neg/t3015.check +++ b/test/files/neg/t3015.check @@ -1,6 +1,6 @@ t3015.scala:7: error: scrutinee is incompatible with pattern type; found : _$1 required: String - val b(foo) = "foo" + val b(foo) = "foo" ^ one error found diff --git a/test/files/neg/t3015.scala b/test/files/neg/t3015.scala index 9af8f30c65..adfa15b388 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 75f3b8f50c..9be24c1ed4 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/t3234.scala b/test/files/neg/t3234.scala index 443d0467f0..1553f1fa05 100644 --- a/test/files/neg/t3234.scala +++ b/test/files/neg/t3234.scala @@ -1,6 +1,6 @@ trait Trait1 { // need more work before this one works - // @inline + // @inline def foo2(n: Int) = n*n } diff --git a/test/files/neg/t3399.scala b/test/files/neg/t3399.scala index b1fe4e5ee2..3edaa0724f 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 0f1c6e0282..090b777151 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-old.scala b/test/files/neg/t3507-old.scala index 32688d3934..9a8c7c5462 100644 --- a/test/files/neg/t3507-old.scala +++ b/test/files/neg/t3507-old.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 fbf75b6856..646e418121 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.check b/test/files/neg/t3714-neg.check index 2db0655502..4f29716968 100644 --- a/test/files/neg/t3714-neg.check +++ b/test/files/neg/t3714-neg.check @@ -1,12 +1,12 @@ t3714-neg.scala:17: error: value break in class BreakImpl cannot be accessed in BreakImpl Access to protected value break not permitted because - enclosing object Test is not a subclass of + enclosing object Test is not a subclass of class BreakImpl where target is defined case b: BreakImpl => b.break ^ t3714-neg.scala:25: error: value break in class BreakImpl cannot be accessed in BreakImpl Access to protected value break not permitted because - enclosing object Test is not a subclass of + enclosing object Test is not a subclass of class BreakImpl where target is defined case b: BreakImpl => b.break ^ diff --git a/test/files/neg/t3714-neg.scala b/test/files/neg/t3714-neg.scala index 4b56f9348c..753b367ec0 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 1efa397928..cf0920912a 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 68766a9f6e..7c78fb634e 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 4a5284cf0f..0dfe129596 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 1075816511..e24b2fea63 100644 --- a/test/files/neg/t3776.scala +++ b/test/files/neg/t3776.scala @@ -5,6 +5,6 @@ object MyParser { } 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 b7f3fde699..31b0825f1d 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/t3934.check b/test/files/neg/t3934.check index 405ed2e879..8b06799f0d 100644 --- a/test/files/neg/t3934.check +++ b/test/files/neg/t3934.check @@ -1,6 +1,6 @@ t3934.scala:15: error: method f2 in class J cannot be accessed in test.J Access to protected method f2 not permitted because - enclosing class S1 in package nest is not a subclass of + enclosing class S1 in package nest is not a subclass of class J in package test where target is defined def g2(x: J) = x.f2() ^ diff --git a/test/files/neg/t3987.scala b/test/files/neg/t3987.scala index c97d57b38f..1226d80228 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 8dc73556c7..cbae864788 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/t4098.check b/test/files/neg/t4098.check index 7d69cf151c..232c082ec9 100644 --- a/test/files/neg/t4098.check +++ b/test/files/neg/t4098.check @@ -1,5 +1,5 @@ t4098.scala:3: error: forward reference not allowed from self constructor invocation - this(b) + this(b) ^ t4098.scala:8: error: forward reference not allowed from self constructor invocation this(b) diff --git a/test/files/neg/t4098.scala b/test/files/neg/t4098.scala index 744d6191b5..2e6d167646 100644 --- a/test/files/neg/t4098.scala +++ b/test/files/neg/t4098.scala @@ -1,6 +1,6 @@ -class A(a: Any) { - def this() = { - this(b) +class A(a: Any) { + def this() = { + this(b) def b = new {} } diff --git a/test/files/neg/t4134.scala b/test/files/neg/t4134.scala index 678e4806ef..18f813dd1d 100644 --- a/test/files/neg/t4134.scala +++ b/test/files/neg/t4134.scala @@ -3,16 +3,16 @@ trait T1 { def f: String -} +} trait T2 extends T1 { abstract override def f: String = "goo" def something = super.f // So the "abstract override" is needed -} +} trait Q1 { def f: String = "bippy" -} +} //trait T3 extends Q1 with T2 { trait T3 extends T2 with Q1 { diff --git a/test/files/neg/t4174.scala b/test/files/neg/t4174.scala index f5242950c2..b4a5ab29da 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 ac00b19bee..06e1f28d54 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 e8cd5fd69e..6c49ec3354 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 9343a9be54..0817df2cb7 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 c979f7936e..0a8b8add18 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.check b/test/files/neg/t4417.check index 4e3f6c0b10..dbd0f1df46 100644 --- a/test/files/neg/t4417.check +++ b/test/files/neg/t4417.check @@ -1,6 +1,6 @@ t4417.scala:11: error: constructor Pixel$mcD$sp in class Pixel$mcD$sp cannot be accessed in object Pixel Access to protected constructor Pixel$mcD$sp not permitted because - enclosing object Pixel is not a subclass of + enclosing object Pixel is not a subclass of class Pixel$mcD$sp where target is defined def apply(v: Double): Pixel1d = new Pixel1d(v) ^ diff --git a/test/files/neg/t4417.scala b/test/files/neg/t4417.scala index 7f104e58bf..3f6ddc8153 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 91e4abfe36..5fbb239e04 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 91d9bc9f51..11f12379f6 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 b2e7505cf2..f3a170f1f2 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/t4515.scala b/test/files/neg/t4515.scala index 63049f201d..4efe45f4fb 100644 --- a/test/files/neg/t4515.scala +++ b/test/files/neg/t4515.scala @@ -16,7 +16,7 @@ object Main { ctx: PushEventContext[EventType]): Unit } val handlers = new HashMap[DerivedPushNode[_], HandlerBase[_]] - + object TimerPushService { private val INSTANCE: TimerPushService = new TimerPushService def get: TimerPushService = INSTANCE diff --git a/test/files/neg/t4541b.scala b/test/files/neg/t4541b.scala index 7a21ffc156..ba406cad6d 100644 --- a/test/files/neg/t4541b.scala +++ b/test/files/neg/t4541b.scala @@ -8,7 +8,7 @@ final class SparseArray[@specialized(Int) T](private var data: Array[T]) extends def use(inData: Array[T]) = { data = inData; } - + def set(that: SparseArray[T]) = { use(that.data.clone) } diff --git a/test/files/neg/t4749.check b/test/files/neg/t4749.check index 34eed6e433..63d5c21532 100644 --- a/test/files/neg/t4749.check +++ b/test/files/neg/t4749.check @@ -18,7 +18,7 @@ t4749.scala:16: warning: Fail4 has a main method with parameter type Array[Strin t4749.scala:21: warning: Fail5 has a main method with parameter type Array[String], but bippy.Fail5 will not be a runnable program. Reason: companion contains its own main method, which means no static forwarder can be generated. - object Fail5 extends Fail5 { } + object Fail5 extends Fail5 { } ^ t4749.scala:26: warning: Fail6 has a main method with parameter type Array[String], but bippy.Fail6 will not be a runnable program. Reason: companion contains its own main method (implementation restriction: no main is allowed, regardless of signature), which means no static forwarder can be generated. diff --git a/test/files/neg/t4749.scala b/test/files/neg/t4749.scala index 0973c36097..2c67e2ea96 100644 --- a/test/files/neg/t4749.scala +++ b/test/files/neg/t4749.scala @@ -18,7 +18,7 @@ package bippy { } trait Fail4 { } - object Fail5 extends Fail5 { } + object Fail5 extends Fail5 { } class Fail5 { def main(args: Array[String]): Unit = () } diff --git a/test/files/neg/t4851/J.java b/test/files/neg/t4851/J.java index dbf8b8288e..9c35b8a16e 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 c3a7231315..82954d9489 100644 --- a/test/files/neg/t4851/J2.java +++ b/test/files/neg/t4851/J2.java @@ -1,10 +1,10 @@ public class J2<T> { T x; - + public <T> 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 0a442ac7a9..779ba376b0 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(()) @@ -18,7 +18,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 9cad156f84..5d97877518 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 c7063b7d15..f28b2cfb4f 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/t5152.scala b/test/files/neg/t5152.scala index 5efc76af24..56df31ed41 100644 --- a/test/files/neg/t5152.scala +++ b/test/files/neg/t5152.scala @@ -2,16 +2,16 @@ object Test { new C new C1 new C2 - + class A[E[_]] { } class B[E[_]] extends A[B] { } // B is depth 2 but A requires 1 - class C extends B { } - + class C extends B { } + class A1[E[F[G[_]]]] { } class B1[E[_]] extends A1[B1] // B1 is depth 2 but A1 requires 3 class C1 extends B1 { } - + class A2[E[_]] { } class B2[E] extends A2[B2] { } // this one is correct - class C2 extends B2 { } + class C2 extends B2 { } } diff --git a/test/files/neg/t520.scala b/test/files/neg/t520.scala index 949a509518..076aca3122 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/t5352.check b/test/files/neg/t5352.check index d24b0e8ee1..1675da9e9a 100644 --- a/test/files/neg/t5352.check +++ b/test/files/neg/t5352.check @@ -6,7 +6,7 @@ t5352.scala:11: error: type mismatch; ^ t5352.scala:14: error: method f in class Bar1 cannot be accessed in boop.Bar1 Access to protected method f not permitted because - enclosing object boop is not a subclass of + enclosing object boop is not a subclass of class Bar1 in object boop where target is defined (new Bar1).f ^ diff --git a/test/files/neg/t5352.scala b/test/files/neg/t5352.scala index 6ee41f5680..ed74a840f0 100644 --- a/test/files/neg/t5352.scala +++ b/test/files/neg/t5352.scala @@ -2,7 +2,7 @@ object boop { abstract class Bar { protected def f(): Any } class Bar1 extends Bar { protected def f(): Int = 5 } class Bar2 extends Bar { protected def f(): Int = 5 } - + val xs = List(new Bar1, new Bar2) type BarF = { def f(): Int } diff --git a/test/files/neg/t5357.scala b/test/files/neg/t5357.scala index 369a5568a4..6a52283dd6 100644 --- a/test/files/neg/t5357.scala +++ b/test/files/neg/t5357.scala @@ -1,7 +1,7 @@ trait M case class N() extends M { - def mytest(x: M) = x match { + def mytest(x: M) = x match { case A: N => 1 case _ => 0 } diff --git a/test/files/neg/t5426.scala b/test/files/neg/t5426.scala index f2fb5cc12c..af0f981969 100644 --- a/test/files/neg/t5426.scala +++ b/test/files/neg/t5426.scala @@ -1,10 +1,10 @@ class A { def f1 = Some(5) == 5 def f2 = 5 == Some(5) - + val x1 = 5 val x2 = Some(5) - + (x1 == x2) (x2 == x1) } diff --git a/test/files/neg/t5455.scala b/test/files/neg/t5455.scala index 22d6c442c9..6e54335787 100644 --- a/test/files/neg/t5455.scala +++ b/test/files/neg/t5455.scala @@ -1,13 +1,13 @@ trait Test { def root: Test - + @annotation.tailrec final lazy val bar: Thing[Int] = { if (this eq root) Thing(() => System.identityHashCode(bar)) else root.bar } - + def f = bar.f() } diff --git a/test/files/neg/t5497.check b/test/files/neg/t5497.check index fef6d38da0..4d6d52b519 100644 --- a/test/files/neg/t5497.check +++ b/test/files/neg/t5497.check @@ -1,4 +1,4 @@ t5497.scala:3: error: not found: value sq - case other => println(null.asInstanceOf[sq.Filter].tableName) + case other => println(null.asInstanceOf[sq.Filter].tableName) ^ one error found diff --git a/test/files/neg/t5497.scala b/test/files/neg/t5497.scala index 40d47de12d..c846b1ba57 100644 --- a/test/files/neg/t5497.scala +++ b/test/files/neg/t5497.scala @@ -1,5 +1,5 @@ object TestQueryable extends App{ ({ - case other => println(null.asInstanceOf[sq.Filter].tableName) + case other => println(null.asInstanceOf[sq.Filter].tableName) } : Any => Unit)(null) } diff --git a/test/files/neg/t5572.scala b/test/files/neg/t5572.scala index 2da1209c61..4169df4216 100644 --- a/test/files/neg/t5572.scala +++ b/test/files/neg/t5572.scala @@ -16,7 +16,7 @@ class Test { Z.transf(a, b) match { case sth => run(sth, b) - } + } } def run(x: X, z: B): Unit = () diff --git a/test/files/neg/t558.scala b/test/files/neg/t558.scala index 4941a06c3b..58b030347c 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 d367e2a73c..204ad3cbdd 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 fa7ee6019f..fd83217a45 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 1bc6d2680f..f30937377e 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 5f2397e6a9..0f0b02395c 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/t5969.scala b/test/files/neg/t5969.scala index 62f87fd7ab..d010cacd1b 100644 --- a/test/files/neg/t5969.scala +++ b/test/files/neg/t5969.scala @@ -4,7 +4,7 @@ class A { def f(x: Any) = x def g(x: C1): String = "A" def g(x: C2): String = "B" - + def crash() = f(List[String]() flatMap { x => if (false) List(g(x)) else List[C1]() map g }) diff --git a/test/files/neg/t608.scala b/test/files/neg/t608.scala index 1f12764dd1..34dc4c0352 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/t6323a.check b/test/files/neg/t6323a.check index 4d682e5422..b649cfc86f 100644 --- a/test/files/neg/t6323a.check +++ b/test/files/neg/t6323a.check @@ -5,7 +5,7 @@ t6323a.scala:11: materializing requested reflect.runtime.universe.type.TypeTag[T val value = u.typeOf[Test] ^ t6323a.scala:11: `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because: -failed to typecheck the materialized tag: +failed to typecheck the materialized tag: cannot create a TypeTag referring to local class Test.Test: use WeakTypeTag instead val value = u.typeOf[Test] ^ diff --git a/test/files/neg/t6446-missing.check b/test/files/neg/t6446-missing.check index d4afa9b630..ba5e30dc05 100755 --- a/test/files/neg/t6446-missing.check +++ b/test/files/neg/t6446-missing.check @@ -34,4 +34,4 @@ inlinehandlers 24 optimization: inline exception handlers dce 27 optimization: eliminate dead code jvm 28 generate JVM bytecode terminal 29 the last phase during a compilation run -#partest +#partest diff --git a/test/files/neg/t6666.scala b/test/files/neg/t6666.scala index 1919ea3ca9..58c5be5405 100644 --- a/test/files/neg/t6666.scala +++ b/test/files/neg/t6666.scala @@ -118,4 +118,4 @@ class CEarly(a: Any) extends { object Nested { def xx = x} Nested.xx } -} with AnyRef
\ No newline at end of file +} with AnyRef
\ No newline at end of file diff --git a/test/files/neg/t692.check b/test/files/neg/t692.check index 4149366309..0ca99717d6 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:19: error: class Foo takes type parameters class Bar[A <: Foo](implicit tpeA : Type[A]) extends Foo; diff --git a/test/files/neg/t692.scala b/test/files/neg/t692.scala index f230a6bacf..24e1d2fea3 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 62325b5c60..25bd141501 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 d2074bee38..3a9e6247a8 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/t6963a.scala b/test/files/neg/t6963a.scala index b3366b2557..6808e541bb 100644 --- a/test/files/neg/t6963a.scala +++ b/test/files/neg/t6963a.scala @@ -1,5 +1,5 @@ object Test { import scala.collection.mutable._ - + List(1,2,3,4,5).scanRight(0)(_+_) } diff --git a/test/files/neg/t715.scala b/test/files/neg/t715.scala index a5ccd567f9..87b2525a63 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/t7494-after-terminal/ThePlugin.scala b/test/files/neg/t7494-after-terminal/ThePlugin.scala index 2a4607392f..f3c913086e 100644 --- a/test/files/neg/t7494-after-terminal/ThePlugin.scala +++ b/test/files/neg/t7494-after-terminal/ThePlugin.scala @@ -12,7 +12,7 @@ class ThePlugin(val global: Global) extends Plugin { val name = "afterterminal" val description = "Declares one plugin that wants to be after the terminal phase" val components = List[PluginComponent](thePhase) - + private object thePhase extends PluginComponent { val global = ThePlugin.this.global @@ -20,9 +20,9 @@ class ThePlugin(val global: Global) extends Plugin { val phaseName = ThePlugin.this.name - def newPhase(prev: Phase) = new ThePhase(prev) + def newPhase(prev: Phase) = new ThePhase(prev) } - + private class ThePhase(prev: Phase) extends Phase(prev) { def name = ThePlugin.this.name def run {} diff --git a/test/files/neg/t7494-before-parser/ThePlugin.scala b/test/files/neg/t7494-before-parser/ThePlugin.scala index 7ca896650d..8714a55dc4 100644 --- a/test/files/neg/t7494-before-parser/ThePlugin.scala +++ b/test/files/neg/t7494-before-parser/ThePlugin.scala @@ -12,7 +12,7 @@ class ThePlugin(val global: Global) extends Plugin { val name = "beforeparser" val description = "Declares one plugin that wants to be before the parser phase" val components = List[PluginComponent](thePhase) - + private object thePhase extends PluginComponent { val global = ThePlugin.this.global @@ -21,9 +21,9 @@ class ThePlugin(val global: Global) extends Plugin { val phaseName = ThePlugin.this.name - def newPhase(prev: Phase) = new ThePhase(prev) + def newPhase(prev: Phase) = new ThePhase(prev) } - + private class ThePhase(prev: Phase) extends Phase(prev) { def name = ThePlugin.this.name def run {} diff --git a/test/files/neg/t7494-multi-right-after/ThePlugin.scala b/test/files/neg/t7494-multi-right-after/ThePlugin.scala index 819176fa88..4c761517c1 100644 --- a/test/files/neg/t7494-multi-right-after/ThePlugin.scala +++ b/test/files/neg/t7494-multi-right-after/ThePlugin.scala @@ -12,7 +12,7 @@ class ThePlugin(val global: Global) extends Plugin { val name = "multi-rafter" val description = "" val components = List[PluginComponent](thePhase) - + private object thePhase extends PluginComponent { val global = ThePlugin.this.global @@ -20,9 +20,9 @@ class ThePlugin(val global: Global) extends Plugin { override val runsRightAfter = Some("explicitouter") val phaseName = ThePlugin.this.name - def newPhase(prev: Phase) = new ThePhase(prev) + def newPhase(prev: Phase) = new ThePhase(prev) } - + private class ThePhase(prev: Phase) extends Phase(prev) { def name = ThePlugin.this.name def run {} diff --git a/test/files/neg/t7494-right-after-before/ThePlugin.scala b/test/files/neg/t7494-right-after-before/ThePlugin.scala index 81ba85ae80..c42a914066 100644 --- a/test/files/neg/t7494-right-after-before/ThePlugin.scala +++ b/test/files/neg/t7494-right-after-before/ThePlugin.scala @@ -12,7 +12,7 @@ class ThePlugin(val global: Global) extends Plugin { val name = "rafter-before-1" val description = "" val components = List[PluginComponent](thePhase1) - + private object thePhase1 extends PluginComponent { val global = ThePlugin.this.global @@ -20,9 +20,9 @@ class ThePlugin(val global: Global) extends Plugin { override val runsBefore = List[String]("erasure") val phaseName = ThePlugin.this.name - def newPhase(prev: Phase) = new ThePhase(prev) + def newPhase(prev: Phase) = new ThePhase(prev) } - + private class ThePhase(prev: Phase) extends Phase(prev) { def name = ThePlugin.this.name def run {} diff --git a/test/files/neg/t7494-right-after-terminal/ThePlugin.scala b/test/files/neg/t7494-right-after-terminal/ThePlugin.scala index 9d6d30b327..47dd06ec8a 100644 --- a/test/files/neg/t7494-right-after-terminal/ThePlugin.scala +++ b/test/files/neg/t7494-right-after-terminal/ThePlugin.scala @@ -12,18 +12,18 @@ class ThePlugin(val global: Global) extends Plugin { val name = "rightafterterminal" val description = "Declares one plugin that wants to be right after the terminal phase" val components = List[PluginComponent](thePhase) - + private object thePhase extends PluginComponent { val global = ThePlugin.this.global val runsAfter = List[String]() override val runsRightAfter = Some("terminal") - + val phaseName = ThePlugin.this.name - def newPhase(prev: Phase) = new ThePhase(prev) + def newPhase(prev: Phase) = new ThePhase(prev) } - + private class ThePhase(prev: Phase) extends Phase(prev) { def name = ThePlugin.this.name def run {} diff --git a/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala b/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala index 7a905ae32d..35c0ff8f53 100644 --- a/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala +++ b/test/files/neg/t7622-cyclic-dependency/ThePlugin.scala @@ -12,7 +12,7 @@ class ThePlugin(val global: Global) extends Plugin { val name = "cyclicdependency" val description = "Declares two phases that have a cyclic dependency" val components = List[PluginComponent](thePhase1,thePhase2) - + private object thePhase1 extends PluginComponent { val global = ThePlugin.this.global @@ -22,7 +22,7 @@ class ThePlugin(val global: Global) extends Plugin { def newPhase(prev: Phase) = new ThePhase(prev, phaseName) } - + private object thePhase2 extends PluginComponent { val global = ThePlugin.this.global @@ -32,7 +32,7 @@ class ThePlugin(val global: Global) extends Plugin { def newPhase(prev: Phase) = new ThePhase(prev, phaseName) } - + private class ThePhase(prev: Phase, val name: String) extends Phase(prev) { def run {} } diff --git a/test/files/neg/t7622-missing-dependency/ThePlugin.scala b/test/files/neg/t7622-missing-dependency/ThePlugin.scala index a87cbb8e45..fa634a64c1 100644 --- a/test/files/neg/t7622-missing-dependency/ThePlugin.scala +++ b/test/files/neg/t7622-missing-dependency/ThePlugin.scala @@ -12,7 +12,7 @@ class ThePlugin(val global: Global) extends Plugin { val name = "myplugin" val description = "Declares one plugin with a missing requirement" val components = List[PluginComponent](thePhase) - + private object thePhase extends PluginComponent { val global = ThePlugin.this.global @@ -22,9 +22,9 @@ class ThePlugin(val global: Global) extends Plugin { override val requires = List("missing") - def newPhase(prev: Phase) = new ThePhase(prev) + def newPhase(prev: Phase) = new ThePhase(prev) } - + private class ThePhase(prev: Phase) extends Phase(prev) { def name = thePhase.phaseName def run {} diff --git a/test/files/neg/t7622-multi-followers/ThePlugin.scala b/test/files/neg/t7622-multi-followers/ThePlugin.scala index e7a49a9be6..cbd28d0c23 100644 --- a/test/files/neg/t7622-multi-followers/ThePlugin.scala +++ b/test/files/neg/t7622-multi-followers/ThePlugin.scala @@ -12,7 +12,7 @@ class ThePlugin(val global: Global) extends Plugin { val name = "multi" val description = "Declares two phases that both follow parser" val components = List[PluginComponent](thePhase1,thePhase2) - + private object thePhase1 extends PluginComponent { val global = ThePlugin.this.global @@ -24,7 +24,7 @@ class ThePlugin(val global: Global) extends Plugin { def newPhase(prev: Phase) = new ThePhase(prev, phaseName) } - + private object thePhase2 extends PluginComponent { val global = ThePlugin.this.global @@ -36,7 +36,7 @@ class ThePlugin(val global: Global) extends Plugin { def newPhase(prev: Phase) = new ThePhase(prev, phaseName) } - + private class ThePhase(prev: Phase, val name: String) extends Phase(prev) { def run {} } diff --git a/test/files/neg/t783.scala b/test/files/neg/t783.scala index 5d20bc6d24..59f7c7f97d 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 b4a1939444..a2bf66d19b 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 de23cf5387..3633b816c6 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.check b/test/files/neg/t856.check index 02978e1622..fb93f96d9f 100644 --- a/test/files/neg/t856.check +++ b/test/files/neg/t856.check @@ -5,7 +5,7 @@ it has 2 unimplemented members. */ // Members declared in scala.Equals def canEqual(that: Any): Boolean = ??? - + // Members declared in scala.Product2 def _2: Double = ??? diff --git a/test/files/neg/t856.scala b/test/files/neg/t856.scala index e50084b6bd..fea216bfad 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 fb1461a7d3..1f6a90dff3 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 8cb98279db..5e132a1dd4 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 352269a80b..dc80e5f49f 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 5b9018ae89..e0ebde9863 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 b88bd358d9..0552b42a22 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 3af07acfac..68f061ce70 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("<:<PT: "+((tparams1, res1), (tparams2, res2))) //@MDEBUG // (tparams1.length == tparams2.length && -// List.forall2(tparams1, tparams2) +// List.forall2(tparams1, tparams2) // ((p1, p2) => 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 96e9349298..6c7f80cc0b 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 0db7b692f8..ddff0e9f94 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 de7e7adc3c..c4171328de 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/varargs.scala b/test/files/neg/varargs.scala index 657750ec8f..be75e9b0a7 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/viewtest.scala b/test/files/neg/viewtest.scala index ddb7fa4a3b..5e7d624d23 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)) |