diff options
Diffstat (limited to 'test/files/pos')
263 files changed, 590 insertions, 604 deletions
diff --git a/test/files/pos/MailBox.scala b/test/files/pos/MailBox.scala index 2a3f02df0b..8e27bd362d 100644 --- a/test/files/pos/MailBox.scala +++ b/test/files/pos/MailBox.scala @@ -24,7 +24,7 @@ class MailBox { private val sent = new LinkedList[Any]; private var lastSent = sent; private val receivers = new LinkedList[Receiver]; - private var lastReceiver = receivers; + private var lastReceiver = receivers; def send(msg: Any): Unit = synchronized { var r = receivers; @@ -59,7 +59,7 @@ class MailBox { } f(msg) } - + def receiveWithin[a](msec: Long)(f: PartialFunction[Any, a]): a = { val msg: Any = synchronized { var s = sent; diff --git a/test/files/pos/SI-7638.scala b/test/files/pos/SI-7638.scala index da16e0bd2c..831475d005 100644 --- a/test/files/pos/SI-7638.scala +++ b/test/files/pos/SI-7638.scala @@ -9,7 +9,7 @@ trait ArrayVectorOrder[@specialized(Int) A] extends Ordering[A] { } object vectorOrder { - implicit def arrayOrder[@specialized(Int) A]() = + implicit def arrayOrder[@specialized(Int) A]() = /* * Before applying patch: * @@ -17,8 +17,8 @@ object vectorOrder { * during phase: mixin * library version: version 2.10.3-20130625-164027-d22e8d282c * compiler version: version 2.10.3-20130627-153946-54cb6af7db - * reconstructed args: - * + * reconstructed args: + * * last tree to typer: TypeTree(class Array) * symbol: class Array in package scala (flags: final) * symbol definition: final class Array[T >: ? <: ?] extends Object @@ -27,12 +27,12 @@ object vectorOrder { * context owners: anonymous class anon$1 -> package compile * * == Expanded type of tree == - * + * * TypeRef( * TypeSymbol(final class Array[T >: ? <: ?] extends Object) * args = List(TypeRef(TypeSymbol(final abstract class Int extends ))) * ) - * + * * unhandled exception while transforming SI-7638.scala * error: uncaught exception during compilation: java.lang.UnsupportedOperationException * error: java.lang.UnsupportedOperationException: tail of empty list diff --git a/test/files/pos/Transactions.scala b/test/files/pos/Transactions.scala index 525eff7514..32889f8180 100644 --- a/test/files/pos/Transactions.scala +++ b/test/files/pos/Transactions.scala @@ -28,7 +28,7 @@ class Transaction { var next: Transaction = null def this(hd: Transaction, tl: Transaction) = { this(); this.head = head; this.next = next } - + def makeAbort() = synchronized { while (status != Transaction.Aborted && status != Transaction.Committed) { status = Transaction.Abortable @@ -48,7 +48,7 @@ class Transaction { case ex: AbortException => abort(); None case ex: Throwable => abort(); throw ex } - + } trait Transactional { @@ -58,7 +58,7 @@ trait Transactional { /** copy back snapshot */ def rollBack(): Unit - + var readers: Transaction var writer: Transaction @@ -66,11 +66,11 @@ trait Transactional { if (writer == null) null else if (writer.status == Transaction.Running) writer else { - if (writer.status != Transaction.Committed) rollBack(); - writer = null; - null + if (writer.status != Transaction.Committed) rollBack(); + writer = null; + null } - + def getter(thisTrans: Transaction) { if (writer == thisTrans) return var r = readers @@ -96,7 +96,7 @@ trait Transactional { synchronized { val w = currentWriter() if (w != null) - if (thisTrans.id < w.id) { w.makeAbort(); rollBack() } + if (thisTrans.id < w.id) { w.makeAbort(); rollBack() } else throw new AbortException var r = readers while (r != null && r.head.status != Transaction.Running) { r = r.next; readers = r } @@ -111,4 +111,3 @@ trait Transactional { } } } - diff --git a/test/files/pos/array-interfaces.scala b/test/files/pos/array-interfaces.scala index 4955911078..70cafd2bb1 100644 --- a/test/files/pos/array-interfaces.scala +++ b/test/files/pos/array-interfaces.scala @@ -1,7 +1,7 @@ object s { def f(x: Cloneable) = () def g(x: java.io.Serializable) = () - + def main(args: Array[String]): Unit = { f(args) g(args) diff --git a/test/files/pos/arrays2.scala b/test/files/pos/arrays2.scala index 2d5409cbb8..795c486e37 100644 --- a/test/files/pos/arrays2.scala +++ b/test/files/pos/arrays2.scala @@ -11,8 +11,8 @@ object arrays2 { // #2422 object arrays4 { - val args = Array[String]("World") - "Hello %1$s".format(args: _*) + val args = Array[String]("World") + "Hello %1$s".format(args: _*) } // #2461 diff --git a/test/files/pos/builders.scala b/test/files/pos/builders.scala index 51d8af88f8..0b620769c0 100644 --- a/test/files/pos/builders.scala +++ b/test/files/pos/builders.scala @@ -18,16 +18,16 @@ object builders { def += (elem: B) { buf += elem } def result: List[B] = buf.toList } -/* +/* def fill[A, Dim1, Dim2, Coll](n1: Int, n2: Int, elem: A)(implicit b1: Builder[Coll, Dim1, A], b2: Builder[Coll, Dim2, Dim1]) = { for (i <- 0 until n1) { for (j <- 0 until n2) { b1 += elem - } + } b2 += b1.result } b2.result - } + } */ /* implicit def arrayBuilder[A, B] = new Builder[Array[A], Array[B], B] { @@ -35,7 +35,7 @@ object builders { private val buf = new scala.collection.mutable.ListBuffer[B] def += (elem: B) { buf += elem } def result: Array[B] = buf.toArray - } + } */ class Iter[A, C](elems: List[A]) { def ++ [B >: A, D](xs: Iterable[B])(implicit b: Builder[C, D, B]): D = { @@ -48,7 +48,7 @@ object builders { b.result } } - + def main(args : Array[String]) : Unit = { val x1 = new Iter[Int, List[Int]](List(1, 2, 3)) // val x2 = new Iter[Int, Array[Int]](List(1, 2, 3)) diff --git a/test/files/pos/channels.scala b/test/files/pos/channels.scala index 0a2274c47a..b2f0cdc321 100644 --- a/test/files/pos/channels.scala +++ b/test/files/pos/channels.scala @@ -6,7 +6,7 @@ case class ![a](chan: Channel[a], data: a) /* object Bang { - def unapply[a](x: ![a]): Option[{Channel[a], a}] = + def unapply[a](x: ![a]): Option[{Channel[a], a}] = Some(x.chan, x.data) } @@ -14,7 +14,7 @@ object Bang { object Test extends App { object IC extends Channel[Int] def f[b](x: ![b]): Int = x match { - case send: ![c] => + case send: ![c] => send.chan match { case IC => send.data } @@ -27,4 +27,3 @@ object Test2 extends App { case IC ! x => x } } - diff --git a/test/files/pos/clsrefine.scala b/test/files/pos/clsrefine.scala index b29c01db8b..0a016dec07 100644 --- a/test/files/pos/clsrefine.scala +++ b/test/files/pos/clsrefine.scala @@ -25,9 +25,9 @@ object test { val y1, y2 = 1; } val a: A { type X1 = Int; type X2 = Int } = b; - val a1 = new A { + val a1 = new A { type X1 = Int; - type X2 = String; + type X2 = String; val x1 = 1; val x2 = "hello" } diff --git a/test/files/pos/collectGenericCC.scala b/test/files/pos/collectGenericCC.scala index 8201c6a271..5c51a50d71 100644 --- a/test/files/pos/collectGenericCC.scala +++ b/test/files/pos/collectGenericCC.scala @@ -7,8 +7,8 @@ object Test { r foreach ((a: A) => b += a) b.result } - - collect[Int, Vector[Int]](List(1,2,3,4)) + + collect[Int, Vector[Int]](List(1,2,3,4)) collect[Char, String](List('1','2','3','4')) - collect[Char, Array[Char]](List('1','2','3','4')) + collect[Char, Array[Char]](List('1','2','3','4')) }
\ No newline at end of file diff --git a/test/files/pos/context.scala b/test/files/pos/context.scala index 13f6bb43c5..4e11d07eb4 100644 --- a/test/files/pos/context.scala +++ b/test/files/pos/context.scala @@ -12,10 +12,10 @@ class Context { abstract class SymbolWrapper { val context: Context; import context._; - + class Symbols { self: context.symbols.type => - + abstract class Symbol { def typ: types.Type; def sym: Symbol = typ.sym; @@ -29,7 +29,7 @@ abstract class TypeWrapper { class Types { self: context.types.type => - + abstract class Type { def sym: symbols.Symbol; def typ: Type = sym.typ; diff --git a/test/files/pos/cyclics-pos.scala b/test/files/pos/cyclics-pos.scala index 051bdd6ed8..395e88815a 100644 --- a/test/files/pos/cyclics-pos.scala +++ b/test/files/pos/cyclics-pos.scala @@ -1,26 +1,26 @@ trait Param[T] trait Abs { type T } trait Cyclic1[A <: Param[A]] // works -trait Cyclic2[A <: Abs { type T <: A }] -trait Cyclic3 { type A <: Abs { type T = A } } +trait Cyclic2[A <: Abs { type T <: A }] +trait Cyclic3 { type A <: Abs { type T = A } } trait Cyclic4 { type A <: Param[A] } // works -trait Cyclic5 { type AA <: Abs; type A <: AA { type T = A } } +trait Cyclic5 { type AA <: Abs; type A <: AA { type T = A } } trait IterableTemplate { type Elem type Constr <: IterableTemplate type ConstrOf[A] = Constr { type Elem = A } - + def iterator: Iterator[Elem] - + def map [B] (f: Elem => B): ConstrOf[B] - + def foreach(f: Elem => Unit) = iterator.foreach(f) } trait Iterable[A] extends IterableTemplate { self => - type Elem + type Elem type Constr <: Iterable[A] { type Constr <: Iterable.this.Constr } } diff --git a/test/files/pos/depmet_implicit_oopsla_session.scala b/test/files/pos/depmet_implicit_oopsla_session.scala index e2c67d7c32..21588a56ad 100644 --- a/test/files/pos/depmet_implicit_oopsla_session.scala +++ b/test/files/pos/depmet_implicit_oopsla_session.scala @@ -11,19 +11,19 @@ object Sessions { def run(p: Stop, dp: Stop): Unit = {} } - implicit def InDual[A, B](implicit sessionDIn: Session[B]) = + implicit def InDual[A, B](implicit sessionDIn: Session[B]) = new Session[In[A, B]] { type Dual = Out[A, sessionDIn.Dual] - def run(p: In[A, B], dp: Dual): Unit = + def run(p: In[A, B], dp: Dual): Unit = sessionDIn.run(p.func(dp.x), dp.y) } - implicit def OutDual[A, B](implicit sessionDOut: Session[B]) = + implicit def OutDual[A, B](implicit sessionDOut: Session[B]) = new Session[Out[A, B]] { type Dual = In[A, sessionDOut.Dual] - def run(p: Out[A, B], dp: Dual): Unit = + def run(p: Out[A, B], dp: Dual): Unit = sessionDOut.run(p.y, dp.func(p.x)) } @@ -32,7 +32,7 @@ object Sessions { sealed case class Out[+A, +B](x: A, y: B) def addServer = - In{x: Int => + In{x: Int => In{y: Int => System.out.println("Thinking") Out(x+y, Stop())}} @@ -48,7 +48,7 @@ object Sessions { // def runSession[S, D](p: S, dp: D)(implicit s: Session[S]#HasDual[D]) = // s.run(p, dp) - // + // // def runSession[S, D](p: S, dp: D)(implicit s: Session[S]{type Dual=D}) = // s.run(p, dp) diff --git a/test/files/pos/depmet_implicit_oopsla_session_2.scala b/test/files/pos/depmet_implicit_oopsla_session_2.scala index 8d7daa6dc6..5c3b78e3f5 100644 --- a/test/files/pos/depmet_implicit_oopsla_session_2.scala +++ b/test/files/pos/depmet_implicit_oopsla_session_2.scala @@ -36,7 +36,7 @@ object Sessions { implicit def InDual[Data, Cont](implicit cont: Session[Cont]) = new Session[In[Data, Cont]] { type Dual = Out[Data, cont.Dual] - def run(self: Self, dual: Dual): Unit = + def run(self: Self, dual: Dual): Unit = cont.run(self.recv(dual.data), dual.cont) } @@ -46,13 +46,13 @@ object Sessions { implicit def OutDual[Data, Cont](implicit cont: Session[Cont]) = new Session[Out[Data, Cont]] { type Dual = In[Data, cont.Dual] - def run(self: Self, dual: Dual): Unit = + def run(self: Self, dual: Dual): Unit = cont.run(self.cont, dual.recv(self.data)) } // a concrete session def addServer = - In{x: Int => + In{x: Int => In{y: Int => System.out.println("Thinking") Out(x+y, Stop())}} @@ -71,7 +71,7 @@ object Sessions { // def runSession[S, D](p: S, dp: D)(implicit s: Session[S]#HasDual[D]) = // s.run(p, dp) - // + // // def runSession[S, D](p: S, dp: D)(implicit s: Session[S]{type Dual=D}) = // s.run(p, dp) diff --git a/test/files/pos/depmet_implicit_oopsla_session_simpler.scala b/test/files/pos/depmet_implicit_oopsla_session_simpler.scala index 7c9af66611..04b8f94e64 100644 --- a/test/files/pos/depmet_implicit_oopsla_session_simpler.scala +++ b/test/files/pos/depmet_implicit_oopsla_session_simpler.scala @@ -14,7 +14,7 @@ object Sessions { // can't write B <: Session{type Dual = BDual} due to limitations in type inference algorithm // (type variables cannot occur on both sides of <:) // using B#Dual instead of BDual is too imprecise, since it is disconnected from the actual argument that is passed for B - // would be nice if we could introduce a universal quantification over BDual that is not part of the + // would be nice if we could introduce a universal quantification over BDual that is not part of the // type parameter list sealed case class In[A, B <: Session, BDual <: Session](recv: A => B)(implicit dual: B <:< Session{type Dual=BDual}) extends Session { type Dual = Out[A, BDual] @@ -29,7 +29,7 @@ object Sessions { } def addServer = - In{x: Int => + In{x: Int => In{y: Int => System.out.println("Thinking") Out(x+y, Stop())}} diff --git a/test/files/pos/depmet_implicit_oopsla_zipwith.scala b/test/files/pos/depmet_implicit_oopsla_zipwith.scala index fe69802d26..c76d02c1ae 100644 --- a/test/files/pos/depmet_implicit_oopsla_zipwith.scala +++ b/test/files/pos/depmet_implicit_oopsla_zipwith.scala @@ -15,7 +15,7 @@ object ZipWith { def manyApp = n => xs => xs } - implicit def SuccZipWith[N, S, R](implicit zw: ZipWith[N, R]) = + implicit def SuccZipWith[N, S, R](implicit zw: ZipWith[N, R]) = new ZipWith[Succ[N],S => R] { type T = Stream[S] => zw.T @@ -33,12 +33,12 @@ object ZipWith { object Test { def zWith[N, S](n: N, s: S)(implicit zw: ZipWith[N, S]): zw.T = zw.zipWith(n)(s) - def zipWith0: Stream[Int] = zWith(Zero(),0) + def zipWith0: Stream[Int] = zWith(Zero(),0) // (Stream[A]) => java.lang.Object with ZipWith[Zero,B]{type T = Stream[B]}#T // should normalise to: Stream[A] => Stream[B] def map[A, B](f: A => B) = zWith(Succ(Zero()),f) - + def zipWith3[A, B, C, D](f: A => B => C => D) = //: Stream[A] => Stream[B] => Stream[C] => Stream[D] = // BUG why do we need a return type? zWith(Succ(Succ(Succ(Zero()))),f) }
\ No newline at end of file diff --git a/test/files/pos/depmet_implicit_tpbetareduce.scala b/test/files/pos/depmet_implicit_tpbetareduce.scala index c0b9b4e8e4..35d260683b 100644 --- a/test/files/pos/depmet_implicit_tpbetareduce.scala +++ b/test/files/pos/depmet_implicit_tpbetareduce.scala @@ -1,10 +1,10 @@ trait HOSeq { trait Accumulator[+coll[x], elT] trait Iterable[+t] { - type m[+x] + type m[+x] def accumulator[t]: Accumulator[m, t] } - implicit def listAccumulator[elT]: Accumulator[List, elT] = new Accumulator[List, elT] {} + implicit def listAccumulator[elT]: Accumulator[List, elT] = new Accumulator[List, elT] {} trait List[+t] extends Iterable[t] { type m[+x] = List[x] def accumulator[t]: Accumulator[List, t] = listAccumulator[t] diff --git a/test/files/pos/elidable-tparams.scala b/test/files/pos/elidable-tparams.scala index e47951f61d..23b1cba615 100644 --- a/test/files/pos/elidable-tparams.scala +++ b/test/files/pos/elidable-tparams.scala @@ -3,7 +3,7 @@ import elidable._ class ElidableCrashTest { trait My - + @elidable(MINIMUM) def foo[a >: My <: My]: scala.Unit = () foo[My] // crash diff --git a/test/files/pos/existentials.scala b/test/files/pos/existentials.scala index 0adbc701a6..9ca86d13d8 100644 --- a/test/files/pos/existentials.scala +++ b/test/files/pos/existentials.scala @@ -11,7 +11,7 @@ class A { // lazy val quux3a = f() // quux3a // } - + val bippy0 = f _ def bippy1 = f _ // lazy val bippy2 = f _ diff --git a/test/files/pos/exponential-spec.scala b/test/files/pos/exponential-spec.scala index 83aef58f7e..54515c1d21 100644 --- a/test/files/pos/exponential-spec.scala +++ b/test/files/pos/exponential-spec.scala @@ -5,7 +5,7 @@ trait Exp[T] object Test { def f[T](exp: Exp[T]): Exp[T] = ( - f[T] _ + f[T] _ compose f[T] compose f[T] compose f[T] @@ -42,6 +42,6 @@ object Test { compose f[T] compose f[T] compose f[T] - compose f[T] + compose f[T] )(exp) } diff --git a/test/files/pos/gadt-gilles.scala b/test/files/pos/gadt-gilles.scala index 309168c1e0..662be9017d 100644 --- a/test/files/pos/gadt-gilles.scala +++ b/test/files/pos/gadt-gilles.scala @@ -6,7 +6,7 @@ object Test { val x: A[C with D] = new B[C, D] {} val y: A[C with D] = x match { case b: B[u, v] => (new B[u, v] {}): A[u with v] } // OK - + def f[T, U](p: A[T with U]): A[T with U] = p match { case b: B[u, v] => new A[u with v] {} } // Not OK } diff --git a/test/files/pos/gadts2.scala b/test/files/pos/gadts2.scala index 2263cf13a6..fc2a7e4333 100644 --- a/test/files/pos/gadts2.scala +++ b/test/files/pos/gadts2.scala @@ -9,8 +9,8 @@ object Test { final case class NumTerm(val n: Number) extends Term[Number] def f[a](t: Term[a], c: Cell[a]) { - t match { - case NumTerm(n) => c.x = MyDouble(1.0) + t match { + case NumTerm(n) => c.x = MyDouble(1.0) } } diff --git a/test/files/pos/gen-traversable-methods.scala b/test/files/pos/gen-traversable-methods.scala index 2604a09f11..bc720742cf 100644 --- a/test/files/pos/gen-traversable-methods.scala +++ b/test/files/pos/gen-traversable-methods.scala @@ -6,7 +6,7 @@ import collection._ object Test { - + def main(args: Array[String]) { val gen: GenTraversable[Int] = List(1, 2, 3) gen.head @@ -16,5 +16,5 @@ object Test { gen.lastOption gen.init } - + } diff --git a/test/files/pos/generic-sigs.scala b/test/files/pos/generic-sigs.scala index b112766056..98c50b8e82 100644 --- a/test/files/pos/generic-sigs.scala +++ b/test/files/pos/generic-sigs.scala @@ -6,7 +6,7 @@ object A { def f3(x: Class[_ <: Int]) = x def f4(x: Class[_ <: String with Int]) = x def f5(x: Class[_ <: Int with String]) = x - + class Bippy[T] def f6(x: Int) = new Bippy[t forSome { type t <: Int }] def f7(x: T forSome { type T <: Float }) = x @@ -14,7 +14,7 @@ object A { def f9(x: T forSome { type T <: runtime.BoxedUnit }) = x def f10(x: Int) = new Bippy[t forSome { type t <: Unit }] def f11(x: Int) = new Bippy[t forSome { type t >: Null }] - + class Boppy[+T1,-T2] def g1 = new Boppy[t forSome { type t <: Int }, u forSome { type u <: String }] } diff --git a/test/files/pos/gosh.scala b/test/files/pos/gosh.scala index 427df4d33c..98fae8a31e 100644 --- a/test/files/pos/gosh.scala +++ b/test/files/pos/gosh.scala @@ -7,35 +7,35 @@ object ShapeTest extends App { abstract class Shape { def draw(): Unit } - + class Line(s: Point, e: Point) extends Shape { def draw() { Console.println("draw line " + s + "," + e) } } - + abstract class Foo { type T <: Object - + def show(o: T): Unit def print() { Console.println("in Foo") } } - + abstract class ShapeFoo extends Foo { type T <: Shape def show(o: T) { o.draw() } override def print() { Console.println("in ShapeFoo") } } - + class LineFoo extends ShapeFoo { type T = Line override def print() { Console.println("in LineFoo") } } - + val p1 = new Point(1,4) val p2 = new Point(12, 28) - + val l1 = new Line(p1, p2) - + val l = new ShapeFoo { // ** // type T = Line // ** // override def print() { Console.println("in LineFoo") } // ** // diff --git a/test/files/pos/gui.scala b/test/files/pos/gui.scala index 322e0a6e22..3b4f49cf55 100644 --- a/test/files/pos/gui.scala +++ b/test/files/pos/gui.scala @@ -2,7 +2,7 @@ object Geom { trait Shape case class Point(x: Int, y: Int) extends Shape case class Rectangle(ll: Point, ur: Point) extends Shape { - def inset(delta: Int) = + def inset(delta: Int) = Rectangle(Point(ll.x - delta, ll.y - delta), Point(ur.x + delta, ur.y + delta)); } } @@ -20,7 +20,7 @@ trait Screen { } object DummyScreen extends Screen { - def drawRect(r: Geom.Rectangle, c: Color) { + def drawRect(r: Geom.Rectangle, c: Color) { Console.println("draw " + r + " with " + c) } def fillRect(r: Geom.Rectangle, c: Color) { @@ -55,7 +55,7 @@ object GUI { def mouseDown(p: Geom.Point): Unit } - abstract class Button(scr: Screen, p: Geom.Point, name: String) + abstract class Button(scr: Screen, p: Geom.Point, name: String) extends Glyph with MouseCtl { var enabled: Boolean = false val label = new Label(scr, p, name) @@ -86,7 +86,7 @@ object GUIClient { def quit() { Console.println("application exited") } } - class QuitButton (scr: Screen, p: Geom.Point, name: String, a: App) + class QuitButton (scr: Screen, p: Geom.Point, name: String, a: App) extends GUI.Button(scr, p, name) { def doit() { a.quit() } } diff --git a/test/files/pos/hk-infer.scala b/test/files/pos/hk-infer.scala index 7834282bf2..30e3476404 100644 --- a/test/files/pos/hk-infer.scala +++ b/test/files/pos/hk-infer.scala @@ -31,7 +31,7 @@ object DoesWorkHK { def BOOP(ys: Seq[M[_]]) = new Booper[M](xs ++ ys) } implicit def mkBoop[M[_]](xs: Seq[M[_]]) = new Booper[M](xs) - + def f1 = x BOOP y BOOP x1 BOOP x2 } diff --git a/test/files/pos/hkarray.scala b/test/files/pos/hkarray.scala index 3faae180f4..af1160300a 100644 --- a/test/files/pos/hkarray.scala +++ b/test/files/pos/hkarray.scala @@ -1,5 +1,5 @@ trait Foo[CC[_]] { } class Bip { - val x = new Foo[Array] { } + val x = new Foo[Array] { } }
\ No newline at end of file diff --git a/test/files/pos/hkrange.scala b/test/files/pos/hkrange.scala index 8d61167ad8..a6803230ed 100644 --- a/test/files/pos/hkrange.scala +++ b/test/files/pos/hkrange.scala @@ -1,5 +1,5 @@ class A { def f[CC[X] <: Traversable[X]](x: CC[Int]) = () - + f(1 to 5) } diff --git a/test/files/pos/imp2-pos.scala b/test/files/pos/imp2-pos.scala index 407b07f3fd..5460c60015 100644 --- a/test/files/pos/imp2-pos.scala +++ b/test/files/pos/imp2-pos.scala @@ -1,5 +1,5 @@ object Test { - import collection.mutable._ + import collection.mutable._ import collection.mutable._ val x = new HashMap } diff --git a/test/files/pos/implicit-infix-ops.scala b/test/files/pos/implicit-infix-ops.scala index d7519e6340..66f3718e86 100644 --- a/test/files/pos/implicit-infix-ops.scala +++ b/test/files/pos/implicit-infix-ops.scala @@ -1,7 +1,7 @@ object Test { import Ordering.Implicits._ import Numeric.Implicits._ - + def f1[T: Numeric](x: T, y: T, z: T) = x + y + z def f2[T: Ordering](x: T, y: T, z: T) = if (x < y) (z > y) else (x < z) } @@ -9,7 +9,7 @@ object Test { object Int { import Ordering.Implicits._ import math.Integral.Implicits._ - + def f1[T: Integral](x: T, y: T, z: T) = (x + y + z) / z def f2[T: Ordering](x: T, y: T, z: T) = if (x < y) (z > y) else (x < z) } @@ -17,7 +17,7 @@ object Int { object Frac { import Ordering.Implicits._ import math.Fractional.Implicits._ - + def f1[T: Fractional](x: T, y: T, z: T) = (x + y + z) / z def f2[T: Ordering](x: T, y: T, z: T) = if (x < y) (z > y) else (x < z) }
\ No newline at end of file diff --git a/test/files/pos/imports-pos.scala b/test/files/pos/imports-pos.scala index 5f70a5d2da..f6a55e5e07 100644 --- a/test/files/pos/imports-pos.scala +++ b/test/files/pos/imports-pos.scala @@ -7,10 +7,10 @@ object test { val foo = 1; - p("hello"); print("world"); S.out.println("!"); + p("hello"); print("world"); S.out.println("!"); S.out.flush(); } object test1 { import test._; foo -} +} diff --git a/test/files/pos/infer2-pos.scala b/test/files/pos/infer2-pos.scala index 0ed9666f40..2ce88be544 100644 --- a/test/files/pos/infer2-pos.scala +++ b/test/files/pos/infer2-pos.scala @@ -5,4 +5,3 @@ case class nil[T]() extends Lst[T] object test { Console.println(cons(1, nil())) } - diff --git a/test/files/pos/inferbroadtype.scala b/test/files/pos/inferbroadtype.scala index 467bd0f186..de8f7aa184 100644 --- a/test/files/pos/inferbroadtype.scala +++ b/test/files/pos/inferbroadtype.scala @@ -2,7 +2,7 @@ object Test { abstract class Base { val changesBaseClasses: Boolean } class Concrete extends Base { val changesBaseClasses = true } def getBase : Base = new Concrete - + var c = new Base { val changesBaseClasses = true } c = getBase } diff --git a/test/files/pos/inliner2.scala b/test/files/pos/inliner2.scala index fe231ec3c4..bc83e04312 100644 --- a/test/files/pos/inliner2.scala +++ b/test/files/pos/inliner2.scala @@ -10,7 +10,7 @@ class A { final def bob2() = if (debug) 1 else 2 } // Cool: -// +// // % ls -1 /tmp/2901/ // A$$anonfun$bob1$1.class // A$$anonfun$bob1$2.class @@ -20,7 +20,7 @@ class A { // A.class // // Observations: -// +// // (1) The inlined version accesses the field: the explicit one calls the accessor. // (2) The inlined version fails to eliminate boxing. With reference types it emits // an unneeded checkcast. @@ -30,7 +30,7 @@ class A { // inlined at all sites. // // Generated bytecode for the above: -// +// // public final int bob1(); // Code: // Stack=1, Locals=1, Args_size=1 @@ -44,7 +44,7 @@ class A { // 15: invokestatic #41; //Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer; // 18: invokestatic #45; //Method scala/runtime/BoxesRunTime.unboxToInt:(Ljava/lang/Object;)I // 21: ireturn -// +// // public final int bob2(); // Code: // Stack=1, Locals=1, Args_size=1 diff --git a/test/files/pos/java-access-pos/J.java b/test/files/pos/java-access-pos/J.java index 4f2024673c..b6bc3363a1 100644 --- a/test/files/pos/java-access-pos/J.java +++ b/test/files/pos/java-access-pos/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/pos/java-access-pos/S1.scala b/test/files/pos/java-access-pos/S1.scala index cc739d9555..10730e3a70 100644 --- a/test/files/pos/java-access-pos/S1.scala +++ b/test/files/pos/java-access-pos/S1.scala @@ -6,7 +6,7 @@ class S1 extends J { override private[b] def packageAbstract() = () override protected[b] def protectedAbstract() = () override def publicAbstract() = () - + override private[b] def packageConcrete() = () override protected[b] def protectedConcrete() = () override def publicConcrete() = () @@ -26,7 +26,7 @@ class S3 extends J { protected[b] def packageAbstract() = () protected[b] def protectedAbstract() = () def publicAbstract() = () - + override protected[b] def packageConcrete() = () override protected[b] def protectedConcrete() = () override def publicConcrete() = () @@ -37,7 +37,7 @@ class S4 extends J { private[a] def packageAbstract() = () protected[a] def protectedAbstract() = () def publicAbstract() = () - + override private[a] def packageConcrete() = () override protected[a] def protectedConcrete() = () override def publicConcrete() = () @@ -48,14 +48,14 @@ class S5 extends J { def packageAbstract() = () def protectedAbstract() = () def publicAbstract() = () - + override def packageConcrete() = () override def protectedConcrete() = () override def publicConcrete() = () } /** Constructors. */ -class S6 extends J(1) { +class S6 extends J(1) { def packageAbstract() = () def protectedAbstract() = () def publicAbstract() = () diff --git a/test/files/pos/javaReadsSigs/fromjava.java b/test/files/pos/javaReadsSigs/fromjava.java index eca63961d5..92441b0c6b 100644 --- a/test/files/pos/javaReadsSigs/fromjava.java +++ b/test/files/pos/javaReadsSigs/fromjava.java @@ -22,11 +22,11 @@ class B { }; class Contra { // Not an Ordering<Character>. static Ordering<Object> charOrd = scala.math.Ordering.Char$.MODULE$; - + public boolean useCharOrd() { return charOrd.compare(new Object(), new Object()) == 0; } - + static Numeric<?> intNum = scala.math.Numeric.IntIsIntegral$.MODULE$; } @@ -36,13 +36,13 @@ public class fromjava { return null; } }; - + public static Function1<Tuple2<? extends Object, B>, B> f2 = new scala.runtime.AbstractFunction1<Tuple2<? extends Object, B>, B>() { public B apply(Tuple2<? extends Object, B> tup) { return tup._2(); } }; - + public static String vector(Vector<String> x) { Vector<String> y = x.take(2); return y.head(); diff --git a/test/files/pos/lambdalift.scala b/test/files/pos/lambdalift.scala index 10bbf3ac12..bc997d6f81 100644 --- a/test/files/pos/lambdalift.scala +++ b/test/files/pos/lambdalift.scala @@ -11,5 +11,5 @@ object test { def h() = x; } g() + new inner().g(); - } + } } diff --git a/test/files/pos/listpattern.scala b/test/files/pos/listpattern.scala index b64068474c..47145bf037 100644 --- a/test/files/pos/listpattern.scala +++ b/test/files/pos/listpattern.scala @@ -1,7 +1,7 @@ trait Value {} case class FloatValue(x: Double) extends Value object Test { - def applyNumeric(op: (Double, Double) => Double): + def applyNumeric(op: (Double, Double) => Double): PartialFunction[List[Value], Value] = { case List(FloatValue(x), FloatValue(y)) => FloatValue(op(x, y)) } diff --git a/test/files/pos/lookupswitch.scala b/test/files/pos/lookupswitch.scala index 33594c0ea6..5d48251240 100644 --- a/test/files/pos/lookupswitch.scala +++ b/test/files/pos/lookupswitch.scala @@ -34,4 +34,3 @@ class A { case 20 => "20" } } -
\ No newline at end of file diff --git a/test/files/pos/looping-jsig.scala b/test/files/pos/looping-jsig.scala index e2d9e76229..6e3313c463 100644 --- a/test/files/pos/looping-jsig.scala +++ b/test/files/pos/looping-jsig.scala @@ -1,15 +1,15 @@ import scala.collection.mutable._ trait BugTrack { - trait B[+T] + trait B[+T] val cache : HashMap[A[_], B[_]] = HashMap.empty - def A[T](f: Int => B[T]): A[T] + def A[T](f: Int => B[T]): A[T] = new A[T]{def apply(in: Int) = f(in)} - + abstract class A[+T] extends (Int => B[T]) { def giveMeSame = this - } + } def amethod[T](p: =>A[T]): A[T] = A(in => cache.get(p) match { case Some(res) => res diff --git a/test/files/pos/lub-dealias-widen.scala b/test/files/pos/lub-dealias-widen.scala index 38854fbc5c..8d26708d65 100644 --- a/test/files/pos/lub-dealias-widen.scala +++ b/test/files/pos/lub-dealias-widen.scala @@ -27,7 +27,7 @@ object Test { = p2 >> { (xs: List[String]) => 0 } // This works after https://github.com/scala/scala/commit/a06d31f6a - // Before: error: inferred type arguments [List[String] => String,List[String] => String] + // Before: error: inferred type arguments [List[String] => String,List[String] => String] // do not conform to method &'s type parameter bounds // [G <: H,H >: Int => (Int => String)] val s = r & r2 diff --git a/test/files/pos/michel6.scala b/test/files/pos/michel6.scala index f312bf1796..b32e8bed75 100644 --- a/test/files/pos/michel6.scala +++ b/test/files/pos/michel6.scala @@ -1,6 +1,6 @@ object M { def f(x: Int): Unit = {} - + def g(): Int => Unit = if (0 == 0) f else g() } diff --git a/test/files/pos/needstypeearly.scala b/test/files/pos/needstypeearly.scala index bd93b5c45d..a90c2575f2 100644 --- a/test/files/pos/needstypeearly.scala +++ b/test/files/pos/needstypeearly.scala @@ -1,4 +1,4 @@ -abstract class NeedsXEarly { - val x: Int +abstract class NeedsXEarly { + val x: Int } class Foo extends { val x = 1 } with NeedsXEarly diff --git a/test/files/pos/nothing_manifest_disambig-old.scala b/test/files/pos/nothing_manifest_disambig-old.scala index 076742033f..9a3db0c6d4 100644 --- a/test/files/pos/nothing_manifest_disambig-old.scala +++ b/test/files/pos/nothing_manifest_disambig-old.scala @@ -1,10 +1,10 @@ object Test { def mani[T: Manifest](xs: T) = xs mani(List()) - + def listElMani[T: Manifest](xs: List[T]) = xs listElMani(List()) - + def foo[A, C](m : C)(implicit ev: C <:< Traversable[A], mani: Manifest[A]): (C, A, Manifest[A]) = (m, m.head, mani) - foo(List(1,2,3)) + foo(List(1,2,3)) }
\ No newline at end of file diff --git a/test/files/pos/nullary.scala b/test/files/pos/nullary.scala index 8e5a834012..614fcdf480 100644 --- a/test/files/pos/nullary.scala +++ b/test/files/pos/nullary.scala @@ -2,7 +2,7 @@ abstract class NullaryTest[T, m[s]] { def nullary: String = "a" val x = nullary - def nullary2: T + def nullary2: T val x2 = nullary2 def nullary3: m[T] @@ -16,5 +16,5 @@ class Concrete extends NullaryTest[Int, List] { object test { (new Concrete).nullary2 - (new Concrete).nullary3 + (new Concrete).nullary3 } diff --git a/test/files/pos/nullary_poly.scala b/test/files/pos/nullary_poly.scala index 4de7235a1c..d2e1e127a1 100644 --- a/test/files/pos/nullary_poly.scala +++ b/test/files/pos/nullary_poly.scala @@ -2,9 +2,9 @@ class A { // built-in synchronized {} - + val x: String = "a".asInstanceOf[String] - + // user-defined: def polyNullary[T]: List[T] = Nil } diff --git a/test/files/pos/override-object-yes.scala b/test/files/pos/override-object-yes.scala index b0563df0a3..858f9b21fc 100644 --- a/test/files/pos/override-object-yes.scala +++ b/test/files/pos/override-object-yes.scala @@ -14,8 +14,8 @@ package case1 { override def f = 3 } } - - trait Foo3 { + + trait Foo3 { object Bar { def g: Traversable[Int] = Nil } diff --git a/test/files/pos/partialfun.scala b/test/files/pos/partialfun.scala index d8971e56fb..9f32a22023 100644 --- a/test/files/pos/partialfun.scala +++ b/test/files/pos/partialfun.scala @@ -1,6 +1,6 @@ object partialfun { - def applyPartial[b](f: PartialFunction[Option[String], b])(x: Option[String]) = + def applyPartial[b](f: PartialFunction[Option[String], b])(x: Option[String]) = if (f.isDefinedAt(x)) f(x) else "<undefined>"; applyPartial { diff --git a/test/files/pos/pat_gilles.scala b/test/files/pos/pat_gilles.scala index 567d700eba..704d5b9c00 100644 --- a/test/files/pos/pat_gilles.scala +++ b/test/files/pos/pat_gilles.scala @@ -1,7 +1,7 @@ abstract class Table2 { - val x: Any => Unit = { zz:Any => + val x: Any => Unit = { zz:Any => zz match { case Table2.CellUpdated(row, column) => val foo = Table2.CellUpdated(2,2) diff --git a/test/files/pos/propagate.scala b/test/files/pos/propagate.scala index a7f9d6ce6d..5881920798 100644 --- a/test/files/pos/propagate.scala +++ b/test/files/pos/propagate.scala @@ -14,4 +14,3 @@ class C { - diff --git a/test/files/pos/return_thistype.scala b/test/files/pos/return_thistype.scala index f164e06cc0..c0736c0ad9 100644 --- a/test/files/pos/return_thistype.scala +++ b/test/files/pos/return_thistype.scala @@ -1,8 +1,8 @@ // tests transformation of return type in typedTypeApply (see also tcpoly_gm.scala) -class As { - class A { +class As { + class A { def foo: A.this.type = bar.asInstanceOf[A.this.type] def foo2: this.type = bar.asInstanceOf[this.type] - def bar: A = null + def bar: A = null } } diff --git a/test/files/pos/scala-singleton.scala b/test/files/pos/scala-singleton.scala index 5e0baa0cb2..08038db93b 100644 --- a/test/files/pos/scala-singleton.scala +++ b/test/files/pos/scala-singleton.scala @@ -3,12 +3,12 @@ object Test { def f1(x: AnyRef with Singleton): AnyRef with Singleton = x def f2[T <: AnyRef with Singleton](x: T): T = x - + val x1: AnyRef with Singleton = "abc" val x2 = "def" final val x3 = "ghi" val x4: String = "jkl" - + // compiles... def narrow1(x: AnyRef): AnyRef with Singleton = x @@ -17,26 +17,26 @@ object Test { // fails, wait, what? This fails and narrow1 compiles? def narrow3(x: AnyRef): AnyRef with Singleton = x.asInstanceOf[AnyRef with Singleton] - + // ok def narrow4[T <: AnyRef](x: T): AnyRef with Singleton = x - + object imp { implicit def narrow4[T <: AnyRef](x: T): AnyRef with Singleton = x val x5: String = "mno" def imp1 = f1(x5) - + // f2(x5) // doesn't work but I think it should def imp2 = f2(narrow4(x5)) } - + def main(args: Array[String]): Unit = { // compiles f1(x1) f1(x2) f1(x3) f1(x4) - + f2(x1) // f2(x2) // f2(x3) // maybe this one should work diff --git a/test/files/pos/scoping1.scala b/test/files/pos/scoping1.scala index 548f154b6b..9fe1b5f3e5 100644 --- a/test/files/pos/scoping1.scala +++ b/test/files/pos/scoping1.scala @@ -9,4 +9,4 @@ object This extends App { def foo() = () } val c: C = new D -} +} diff --git a/test/files/pos/selftails.scala b/test/files/pos/selftails.scala index 7c58543747..a4253b80c7 100644 --- a/test/files/pos/selftails.scala +++ b/test/files/pos/selftails.scala @@ -1,10 +1,10 @@ package net.liftweb.util - + /** * This trait adds functionality to Scala standard types */ trait BasicTypesHelpers { self: StringHelpers with ControlHelpers => - + /** * Compare two arrays of Byte for byte equality. * @return true if two Byte arrays contain the same bytes @@ -19,5 +19,5 @@ trait BasicTypesHelpers { self: StringHelpers with ControlHelpers => } } -trait StringHelpers +trait StringHelpers trait ControlHelpers diff --git a/test/files/pos/seq-ordering.scala b/test/files/pos/seq-ordering.scala index 8f1d293c40..517d8ae8aa 100644 --- a/test/files/pos/seq-ordering.scala +++ b/test/files/pos/seq-ordering.scala @@ -2,7 +2,7 @@ import Ordering.Implicits._ class A { import Predef.{ implicitly => ? } - + ?[Ordering[List[Int]]] ?[Ordering[IndexedSeq[(Int, String)]]] ?[Ordering[Seq[Seq[Int]]]] diff --git a/test/files/pos/signatures/Test.java b/test/files/pos/signatures/Test.java index 78c196526b..3d1e3756a7 100644 --- a/test/files/pos/signatures/Test.java +++ b/test/files/pos/signatures/Test.java @@ -3,7 +3,7 @@ import test.Outer; /* Test correct generation of java signatures. The Outer class should not * have a Java signature attribute for the inner method definition. Trait - * Mutable should have one, even though it is also a nested definition. + * Mutable should have one, even though it is also a nested definition. * (but for classes there is a way to tell about nesting to the JVM). */ class Test { diff --git a/test/files/pos/signatures/sig.scala b/test/files/pos/signatures/sig.scala index 3feb9c456a..4236f27bed 100644 --- a/test/files/pos/signatures/sig.scala +++ b/test/files/pos/signatures/sig.scala @@ -1,7 +1,7 @@ package test /* Tests correct generation of Java signatures. The local method 'bar' should - * not get a generic signature, as it may refer to type parameters of the enclosing + * not get a generic signature, as it may refer to type parameters of the enclosing * method, and the JVM does not know about nested methods. */ class Outer { diff --git a/test/files/pos/spec-Function1.scala b/test/files/pos/spec-Function1.scala index 2a3074fd14..5a115501d8 100644 --- a/test/files/pos/spec-Function1.scala +++ b/test/files/pos/spec-Function1.scala @@ -35,11 +35,11 @@ package scalabip trait Function1[@specialized -T1, @specialized +R] extends AnyRef { self => def apply(v1:T1): R override def toString() = "<function>" - + /** (f compose g)(x) == f(g(x)) */ def compose[A](g: A => T1): A => R = { x => apply(g(x)) } - + /** (f andThen g)(x) == g(f(x)) */ def andThen[A](g: R => A): T1 => A = { x => g(apply(x)) } diff --git a/test/files/pos/spec-arrays.scala b/test/files/pos/spec-arrays.scala index 7ae2cb1efb..883bc2fe62 100644 --- a/test/files/pos/spec-arrays.scala +++ b/test/files/pos/spec-arrays.scala @@ -20,7 +20,7 @@ abstract class AbsArray[T] { def updateBoolean(idx: Int, elem: Boolean) = update(idx, elem.asInstanceOf[T]) def applyObject(idx: Int): Object = apply(idx).asInstanceOf[Object] def updateObject(idx: Int, elem: Object) = update(idx, elem.asInstanceOf[T]) -} +} final class IntArray(arr: Array[Int]) extends AbsArray[Int] { def apply(idx: Int): Int = applyInt(idx) @@ -64,7 +64,7 @@ class ScalaSpecTest extends Test { while (i < arr.length) { acc = acc + arr.applyInt(i); i += 1 } acc } - + def modify(j: Int) = { val base = j * 100 % 1000 var i = 0 @@ -74,7 +74,7 @@ class ScalaSpecTest extends Test { } } } - + class ScalaSpec2Test extends Test { val arr: AbsArray[Int] = new IntArray(new Array[Int](1000)) @@ -84,7 +84,7 @@ class ScalaSpec2Test extends Test { while (i < arr.length) { acc = acc + arr.applyInt(i); i += 1 } acc } - + def modify(j: Int) = { val base = j * 100 % 1000 var i = 0 @@ -94,7 +94,7 @@ class ScalaSpec2Test extends Test { } } } - + class ScalaWrapTest extends Test { val arr: AbsArray[Int] = new ArraySeq(new Array[Int](1000)) @@ -104,7 +104,7 @@ class ScalaWrapTest extends Test { while (i < arr.length) { acc = acc + arr.applyInt(i); i += 1 } acc } - + def modify(j: Int) = { val base = j * 100 % 1000 var i = 0 @@ -114,7 +114,7 @@ class ScalaWrapTest extends Test { } } } - + class ScalaGenTest extends Test { val arr: AbsArray[Integer] = new ArraySeq(new Array[Integer](1000)) for (i <- 0 until arr.length) arr(i) = new Integer(0) @@ -125,7 +125,7 @@ class ScalaGenTest extends Test { while (i < arr.length) { acc = acc + arr.apply(i).intValue; i += 1 } acc } - + def modify(j: Int) = { val base = j * 100 % 1000 var i = 0 @@ -135,7 +135,7 @@ class ScalaGenTest extends Test { } } } - + class JavaTest extends Test { val arr = new Array[Int](1000) @@ -145,7 +145,7 @@ class JavaTest extends Test { while (i < arr.length) { acc = acc + arr(i); i += 1 } acc } - + def modify(j: Int) = { val base = j * 100 % 1000 var i = 0 @@ -166,7 +166,7 @@ class ScalaSpec3Test extends Test { while (i < arr.length) { acc = acc + arr(i); i += 1 } acc } - + def modify(j: Int) = { val base = j * 100 % 1000 var i = 0 diff --git a/test/files/pos/spec-funs.scala b/test/files/pos/spec-funs.scala index b9acbe171a..f92ae9899d 100644 --- a/test/files/pos/spec-funs.scala +++ b/test/files/pos/spec-funs.scala @@ -19,7 +19,7 @@ final class IntTest { val xs = new Array[Int](10000) val f = new AbsFunction1[Int, Int] { def apply(x: Int): Int = x * x - } + } for (j <- 0 until niters) { transF(xs, f) } diff --git a/test/files/pos/spec-params-old.scala b/test/files/pos/spec-params-old.scala index f522512846..33a252120c 100644 --- a/test/files/pos/spec-params-old.scala +++ b/test/files/pos/spec-params-old.scala @@ -10,7 +10,7 @@ class Foo[@specialized A: ClassManifest] { def m2[@specialized B <: String](x: B) = x.concat("a") // conflicting in bounds, no mention of other spec members - // expect an overload here plus implementation in + // expect an overload here plus implementation in // compatible specialized subclasses def m3[@specialized B >: A](x: B) = () @@ -19,10 +19,10 @@ class Foo[@specialized A: ClassManifest] { // non-conflicting, expect a normalized overload implementation here def m5[@specialized B](x: B) = x - + // non-conflicting, expect a normalized implementation here // and specialized implementations for all expansions in specialized subclasses - def m6[@specialized B](x: B, y: A) = + def m6[@specialized B](x: B, y: A) = goal(y) def goal(x: A) = { diff --git a/test/files/pos/spec-short.scala b/test/files/pos/spec-short.scala index 94a8007c6e..71e56a485a 100644 --- a/test/files/pos/spec-short.scala +++ b/test/files/pos/spec-short.scala @@ -5,7 +5,7 @@ abstract class AbsFun[@specialized T, @specialized U] { // abstract function, specialized def sum(xs: List[T]): Int - def prod(xs: List[T], mul: (Int, T) => Int): Int = + def prod(xs: List[T], mul: (Int, T) => Int): Int = (1 /: xs)(mul) // concrete function, not specialized @@ -18,9 +18,9 @@ abstract class AbsFun[@specialized T, @specialized U] { class Square extends AbsFun[Int, Int] { def apply(x: Int): Int = x * x - def sum(xs: List[Int]): Int = + def sum(xs: List[Int]): Int = (0 /: xs) (_ + _) - def abs(m: Int): Int = + def abs(m: Int): Int = sum(List(1, 2, 3)) } diff --git a/test/files/pos/spec-t3497.scala b/test/files/pos/spec-t3497.scala index 6cc0e24f89..ff054aa7de 100644 --- a/test/files/pos/spec-t3497.scala +++ b/test/files/pos/spec-t3497.scala @@ -10,7 +10,7 @@ object B extends A[ Array[Byte], Int ] { return -1 } } - + return 0 } } diff --git a/test/files/pos/spec-tailcall.scala b/test/files/pos/spec-tailcall.scala index d91e2f59ce..703ec011ad 100644 --- a/test/files/pos/spec-tailcall.scala +++ b/test/files/pos/spec-tailcall.scala @@ -1,5 +1,5 @@ class TailCall[@specialized T] { - final def dropLeft(n: Int, xs: List[T]): List[T] = + final def dropLeft(n: Int, xs: List[T]): List[T] = if (n == 0) xs else dropLeft(n - 1, xs.tail) /* @@ -7,7 +7,7 @@ class TailCall[@specialized T] { def crash(o: Option[String]) = filter { case None if { - def dropLeft[T](n: Int, xs: List[T]): List[T] = + def dropLeft[T](n: Int, xs: List[T]): List[T] = if (n == 0) xs else dropLeft(n - 1, xs.tail) dropLeft(2, List(1, 2, 3)).isEmpty diff --git a/test/files/pos/spec-vector.scala b/test/files/pos/spec-vector.scala index 06e49b521f..392949c669 100644 --- a/test/files/pos/spec-vector.scala +++ b/test/files/pos/spec-vector.scala @@ -1,4 +1,4 @@ // ticket #3379, abstract overrides trait Vector extends (Int=>Double) { - override def apply(i: Int): Double + override def apply(i: Int): Double } diff --git a/test/files/pos/spec.scala b/test/files/pos/spec.scala index 093d3cded4..cc060ffe84 100644 --- a/test/files/pos/spec.scala +++ b/test/files/pos/spec.scala @@ -7,7 +7,7 @@ class Bar[@specialized(Int, AnyRef) A](a: A) { } -class WithInner[@specialized(Int, AnyRef) A](a: A) { +class WithInner[@specialized(Int, AnyRef) A](a: A) { class Inner { def meth = a } @@ -42,7 +42,7 @@ class Qux[@specialized(AnyRef) A] { class Foo[@specialized(Int, AnyRef) A](val a: Array[A]) { a(0) - + def id(elem: A) = a(0) = elem } @@ -52,13 +52,13 @@ object Test { def main(arg: Array[String]) { val f = new Foo(new Array[String](5)) f.id("") - + val z = new Baz[Int, Double] z.ab(1, 1.0) - + testspec(new Array[String](5)) testspec(new Array[Int](5)) } - + def testspec[@specialized(Int, AnyRef) T](arr: Array[T]) = arr(0) } diff --git a/test/files/pos/strings.scala b/test/files/pos/strings.scala index 83b8179706..9fe8cfd94b 100644 --- a/test/files/pos/strings.scala +++ b/test/files/pos/strings.scala @@ -6,5 +6,5 @@ object test { } // #1000 object A { - println("""This a "raw" string ending with a "double quote"""") + println("""This a "raw" string ending with a "double quote"""") } diff --git a/test/files/pos/sudoku.scala b/test/files/pos/sudoku.scala index 336dc756a9..9435f504d6 100644 --- a/test/files/pos/sudoku.scala +++ b/test/files/pos/sudoku.scala @@ -3,22 +3,22 @@ object SudokuSolver extends App { // held in a global variable m. The program begins by reading 9 lines // of input to fill the board var m: Array[Array[Char]] = Array.tabulate(9)((x: Int) => readLine.toArray) - + // For printing m, a method print is defined def print = { println(""); m map (carr => println(new String(carr))) } - + // The test for validity is performed by looping over i=0..8 and // testing the row, column and 3x3 square containing the given // coordinate def invalid(i: Int, x: Int, y: Int, n: Char): Boolean = i<9 && (m(y)(i) == n || m(i)(x) == n || m(y/3*3 + i/3)(x/3*3 + i % 3) == n || invalid(i+1, x, y, n)) - + // Looping over a half-closed range of consecutive integers [l..u) // is factored out into a higher-order function def fold(f: (Int, Int) => Int, accu: Int, l: Int, u: Int): Int = if(l==u) accu else fold(f, f(accu, l), l+1, u) - + // The search function examines each position on the board in turn, // trying the numbers 1..9 in each unfilled position // The function is itself a higher-order fold, accumulating the value @@ -34,7 +34,7 @@ object SudokuSolver extends App { val newaccu = search(x+1, y, f, accu); m(y)(x) = '0'; newaccu}, accu, 1, 10)} - + // The main part of the program uses the search function to accumulate // the total number of solutions println("\n"+search(0,0,i => {print; i+1},0)+" solution(s)") diff --git a/test/files/pos/super/Super_1.java b/test/files/pos/super/Super_1.java index 418ae96bc0..9acbba0ec4 100644 --- a/test/files/pos/super/Super_1.java +++ b/test/files/pos/super/Super_1.java @@ -1,6 +1,6 @@ // A.java interface Inter<T> { } -class Super implements Inter<Super.Inner> { +class Super implements Inter<Super.Inner> { public class Inner { }; } diff --git a/test/files/pos/t0066.scala b/test/files/pos/t0066.scala index 9317da7165..2153264e7a 100644 --- a/test/files/pos/t0066.scala +++ b/test/files/pos/t0066.scala @@ -3,5 +3,5 @@ class GBTree[A, B] /*with Map[A, B, GBTree[A,B]]*/ { case class Node[A,B](key:A,value:B,smaller:Node[A,B],bigger:Node[A,B]) extends Tree[A,B]; case class Nil[A,B]() extends Tree[A,B]; - + } diff --git a/test/files/pos/t0069.scala b/test/files/pos/t0069.scala index 5a8c15cd5a..e4c242c0ee 100644 --- a/test/files/pos/t0069.scala +++ b/test/files/pos/t0069.scala @@ -8,4 +8,3 @@ object testCQ { */ } - diff --git a/test/files/pos/t0288/Foo.scala b/test/files/pos/t0288/Foo.scala index 1f7d81327d..778ba65f58 100644 --- a/test/files/pos/t0288/Foo.scala +++ b/test/files/pos/t0288/Foo.scala @@ -6,4 +6,4 @@ class Foo extends Outer{ val bar = new Inner(); // Shouldn't this work? -} +} diff --git a/test/files/pos/t0288/Outer.java b/test/files/pos/t0288/Outer.java index 7a3754fb5d..bea3e3f8d0 100644 --- a/test/files/pos/t0288/Outer.java +++ b/test/files/pos/t0288/Outer.java @@ -6,4 +6,4 @@ public class Outer{ } -} +} diff --git a/test/files/pos/t0305.scala b/test/files/pos/t0305.scala index 4d37a02eb3..4838b1fcf8 100644 --- a/test/files/pos/t0305.scala +++ b/test/files/pos/t0305.scala @@ -1,5 +1,5 @@ object Test extends App { - + def foo(is:Int*) = 1; def foo(i:Int) = 2; diff --git a/test/files/pos/t0438.scala b/test/files/pos/t0438.scala index 33b7efeaac..fa5b7711ff 100644 --- a/test/files/pos/t0438.scala +++ b/test/files/pos/t0438.scala @@ -1,9 +1,9 @@ class Foo { - implicit def pair2fun2[A, B, C](f: (A, B) => C) = + implicit def pair2fun2[A, B, C](f: (A, B) => C) = {p: (A, B) => f(p._1, p._2) } def foo(f: ((Int, Int)) => Int) = f - def bar(x: Int, y: Int) = x + y + def bar(x: Int, y: Int) = x + y foo({ (x: Int, y: Int) => x + y }) // works foo(pair2fun2(bar _)) // works diff --git a/test/files/pos/t0453.scala b/test/files/pos/t0453.scala index d59a3d22f2..dfacc5eed7 100644 --- a/test/files/pos/t0453.scala +++ b/test/files/pos/t0453.scala @@ -1,5 +1,5 @@ object Test { - val foo = new { + val foo = new { trait Bar def l () : Bar = { new Bar {} } } diff --git a/test/files/pos/t0599.scala b/test/files/pos/t0599.scala index 6125b99ce2..885159af66 100644 --- a/test/files/pos/t0599.scala +++ b/test/files/pos/t0599.scala @@ -15,4 +15,4 @@ abstract class FooA { a.xxx; doB.xxx; } - } + } diff --git a/test/files/pos/t0625.scala b/test/files/pos/t0625.scala index bda463d6a6..5614542599 100644 --- a/test/files/pos/t0625.scala +++ b/test/files/pos/t0625.scala @@ -1,6 +1,6 @@ object Test { def idMap[C[_],T](m: { def map[U](f: T => U): C[U] }): C[T] = m.map(t => t) - + def main(args: Array[String]): Unit = { idMap(Some(5)) idMap(Responder.constant(5)) diff --git a/test/files/pos/t0770.scala b/test/files/pos/t0770.scala index bb438f1918..7a0a2bf9bb 100644 --- a/test/files/pos/t0770.scala +++ b/test/files/pos/t0770.scala @@ -1,7 +1,7 @@ trait A { private[this] val p = 5 - + def f = (b: Byte) => p } diff --git a/test/files/pos/t0774/unrelated.scala b/test/files/pos/t0774/unrelated.scala index 483f836d0c..1efdb2505e 100644 --- a/test/files/pos/t0774/unrelated.scala +++ b/test/files/pos/t0774/unrelated.scala @@ -1,8 +1,8 @@ object Outer { import Inner._ - + deathname - + object Inner { def deathname: Int = 1 } diff --git a/test/files/pos/t0786.scala b/test/files/pos/t0786.scala index 4d9f1d0dc9..f40cf7d2e1 100644 --- a/test/files/pos/t0786.scala +++ b/test/files/pos/t0786.scala @@ -2,15 +2,15 @@ object ImplicitProblem { class M[T] def nullval[T] = null.asInstanceOf[T]; - + trait Rep[T] { def eval: Int } - + implicit def toRep0(n: Int) = new Rep[Int] { def eval = 0 } - + implicit def toRepN[T](n: M[T])(implicit f: T => Rep[T]) = new Rep[M[T]] { def eval = f(nullval[T]).eval + 1 } @@ -18,11 +18,11 @@ object ImplicitProblem { def depth[T <% Rep[T]](n: T) = n.eval def main(args: Array[String]) { - println(depth(nullval[M[Int]])) // (1) this works + println(depth(nullval[M[Int]])) // (1) this works println(nullval[M[Int]].eval) // (2) this works - + type m = M[Int] - println(depth(nullval[m])) // (3) this doesn't compile on 2.7.RC1 + println(depth(nullval[m])) // (3) this doesn't compile on 2.7.RC1 println(nullval[m].eval) // (4) this works } diff --git a/test/files/pos/t1000.scala b/test/files/pos/t1000.scala index fabef94fff..613af76b94 100644 --- a/test/files/pos/t1000.scala +++ b/test/files/pos/t1000.scala @@ -1,5 +1,5 @@ object A { - println("""This a "raw" string ending with a "double quote"""") + println("""This a "raw" string ending with a "double quote"""") } object Test extends App { diff --git a/test/files/pos/t1035.scala b/test/files/pos/t1035.scala index bd693d9e68..e0a9379c7e 100644 --- a/test/files/pos/t1035.scala +++ b/test/files/pos/t1035.scala @@ -7,7 +7,7 @@ class A { var name:String = _ def getName() = name def this(name:String, age:Int){this();this.name=name} - + } class B(name:String) extends A(name,0){ @@ -18,15 +18,15 @@ class D { object A { def unapply(p:A) = Some(p.getName) } - + object B { def unapply(p:B) = Some(p.getName) } def foo(p:Any) = p match { - case B(n) => println("B") - case A(n) => println("A") - - + case B(n) => println("B") + case A(n) => println("A") + + } } diff --git a/test/files/pos/t1048.scala b/test/files/pos/t1048.scala index ce57e72391..cd16db5b60 100644 --- a/test/files/pos/t1048.scala +++ b/test/files/pos/t1048.scala @@ -1,7 +1,7 @@ trait T[U] { def x: T[V] forSome { type V <: U } } - + object T { def unapply[U](t: T[U]): Option[T[V] forSome { type V <: U }] = Some(t.x) } @@ -12,4 +12,3 @@ object Test { } } - diff --git a/test/files/pos/t1071.scala b/test/files/pos/t1071.scala index 7fb802f8b0..59149a021b 100644 --- a/test/files/pos/t1071.scala +++ b/test/files/pos/t1071.scala @@ -12,6 +12,6 @@ object Test { val c = new C (c: D).a // works - c.a // error + c.a // error } diff --git a/test/files/pos/t1090.scala b/test/files/pos/t1090.scala index dca762af4f..a9bce90b00 100644 --- a/test/files/pos/t1090.scala +++ b/test/files/pos/t1090.scala @@ -10,7 +10,7 @@ object Test { type Node = Core.this.Node } def f(manager : Manager) = manager.iterator.foreach{ - case node : NodeImpl => + case node : NodeImpl => } } } diff --git a/test/files/pos/t1107b/O.scala b/test/files/pos/t1107b/O.scala index aa605a6d09..0198867704 100644 --- a/test/files/pos/t1107b/O.scala +++ b/test/files/pos/t1107b/O.scala @@ -4,10 +4,10 @@ object O case s: Sub => true case _ => false } - + def main(args: Array[String]): Unit = { val c = new AnyRef with C c.bob.toString + c.bob2.toString - } + } } diff --git a/test/files/pos/t1107b/T.scala b/test/files/pos/t1107b/T.scala index 1f3712d529..0dff0b94fd 100644 --- a/test/files/pos/t1107b/T.scala +++ b/test/files/pos/t1107b/T.scala @@ -1,6 +1,6 @@ sealed trait Top sealed trait Sub extends Top -trait C { +trait C { private object P extends Sub def bob() = P.getClass def bob2() = O.d(P) diff --git a/test/files/pos/t1123.scala b/test/files/pos/t1123.scala index a7b009cbbe..3812fa3eb3 100644 --- a/test/files/pos/t1123.scala +++ b/test/files/pos/t1123.scala @@ -7,5 +7,5 @@ object Test { } def f = extraListener.h } - def main(args : Array[String]) : Unit = (new Editor).f + def main(args : Array[String]) : Unit = (new Editor).f } diff --git a/test/files/pos/t1133.scala b/test/files/pos/t1133.scala index 4538de5f5f..562b528ea3 100644 --- a/test/files/pos/t1133.scala +++ b/test/files/pos/t1133.scala @@ -8,21 +8,21 @@ object Match case _ => println("fail") } } - + object Extractor1 { def unapply(x: Any) = x match { case x: String => Some(x, x+x, x+x+x, x+x, x) case _ => None } } - + object Extractor2 { def unapply(x: Any) = x match { case x: String => Some(x, x+x, x+x+x) case _ => None } } - + object Extractor3 { def unapply(x: Any) = x match { case x: String => Some(x, x, x) diff --git a/test/files/pos/t1164.scala b/test/files/pos/t1164.scala index 307ca92c85..ab58c1d6b4 100644 --- a/test/files/pos/t1164.scala +++ b/test/files/pos/t1164.scala @@ -1,29 +1,29 @@ -object test { +object test { - class Foo[a](val arg : a) + class Foo[a](val arg : a) + + object Foo { + def apply [a](arg : a, right :a) = new Foo[a](arg) + def unapply [a](m : Foo[a]) = Some (m.arg) + } - object Foo { - def apply [a](arg : a, right :a) = new Foo[a](arg) - def unapply [a](m : Foo[a]) = Some (m.arg) - } - def matchAndGetArgFromFoo[a]( e:Foo[a]):a = {e match { case Foo(x) => x }} - - + + // Try the same thing as above but use function as argument to Bar // constructor - + type FunIntToA [a] = (Int) => a - class Bar[a] (var f: FunIntToA[a]) - + class Bar[a] (var f: FunIntToA[a]) + object Bar { def apply[a](f: FunIntToA[a]) = new Bar[a](f) def unapply[a](m: Bar[a]) = Some (m.f) } - + def matchAndGetFunFromBar[a](b:Bar[a]) : FunIntToA[a] = { b match { case Bar(x) => x}} - + } diff --git a/test/files/pos/t1168.scala b/test/files/pos/t1168.scala index d9f38714b8..75638e792f 100644 --- a/test/files/pos/t1168.scala +++ b/test/files/pos/t1168.scala @@ -1,5 +1,5 @@ object Test extends App { - + trait SpecialException {} try { diff --git a/test/files/pos/t1210a.scala b/test/files/pos/t1210a.scala index fbb0a611d6..b3492f96e4 100644 --- a/test/files/pos/t1210a.scala +++ b/test/files/pos/t1210a.scala @@ -1,9 +1,9 @@ // both styles of abstraction should behave the same // related to 1210 because that bug broke the OO version below -trait OO { +trait OO { abstract class Test { self => type T - + val v: Test {type T = self.T} = self.v.v } } diff --git a/test/files/pos/t122.scala b/test/files/pos/t122.scala index e3daeef73e..630e24ce4a 100644 --- a/test/files/pos/t122.scala +++ b/test/files/pos/t122.scala @@ -1,4 +1,4 @@ class L { - val List(v:Int, 2) = List(2, v:Int) + val List(v:Int, 2) = List(2, v:Int) val (a:Int, b:Int) = (1, a) } diff --git a/test/files/pos/t1236.scala b/test/files/pos/t1236.scala index 7028162ee0..5e221ce411 100644 --- a/test/files/pos/t1236.scala +++ b/test/files/pos/t1236.scala @@ -1,5 +1,5 @@ trait Empty[E[_]] { - def e[A]: E[A] + def e[A]: E[A] } object T { diff --git a/test/files/pos/t1237.scala b/test/files/pos/t1237.scala index 0d1dd05d50..7777372138 100644 --- a/test/files/pos/t1237.scala +++ b/test/files/pos/t1237.scala @@ -1,11 +1,11 @@ -class HelloWorld { - def main(args: Array[String]) { +class HelloWorld { + def main(args: Array[String]) { object TypeBool; trait Fct { def g(x : Int) = TypeBool // breaks. - + // def g(x : Int) = 3 // fine. } diff --git a/test/files/pos/t1254/t1254.java b/test/files/pos/t1254/t1254.java index 17dc391672..17e1c60bf5 100644 --- a/test/files/pos/t1254/t1254.java +++ b/test/files/pos/t1254/t1254.java @@ -11,7 +11,7 @@ class NothingBug3 { scala.Option<?> o = scala.None$.MODULE$; test(o); - None.toLeft(new scala.runtime.AbstractFunction0<Integer>() { + None.toLeft(new scala.runtime.AbstractFunction0<Integer>() { public Integer apply() { return 0; } }); } diff --git a/test/files/pos/t1263/test.scala b/test/files/pos/t1263/test.scala index 7ced59083a..92d8c1cdfa 100644 --- a/test/files/pos/t1263/test.scala +++ b/test/files/pos/t1263/test.scala @@ -2,7 +2,7 @@ package test trait Map[A, +B] { def plus(key: A): MapTo = new MapTo(key) - + class MapTo(key: A) { def arrow [B1 >: B](value: B1) = null } diff --git a/test/files/pos/t1272.scala b/test/files/pos/t1272.scala index aab1a886c7..d86a909ae5 100644 --- a/test/files/pos/t1272.scala +++ b/test/files/pos/t1272.scala @@ -2,8 +2,8 @@ object ImplicitTest { implicit val i : Int = 10 implicit def a(implicit i : Int) : Array[Byte] = null implicit def b[T](implicit i : Int) : Array[T] = null - + def fn[T](implicit x : T) = 0 - + val x = fn[Array[Byte]] }
\ No newline at end of file diff --git a/test/files/pos/t1292.scala b/test/files/pos/t1292.scala index 3ed153abf2..83a996d530 100644 --- a/test/files/pos/t1292.scala +++ b/test/files/pos/t1292.scala @@ -1,5 +1,5 @@ trait Foo[T <: Foo[T, Enum], Enum <: Enumeration] { - type StV = Enum#Value + type StV = Enum#Value type Meta = MegaFoo[T, Enum] type Slog <: Enumeration diff --git a/test/files/pos/t1318.scala b/test/files/pos/t1318.scala index 3fc6e3060f..f3d2f7ab5a 100644 --- a/test/files/pos/t1318.scala +++ b/test/files/pos/t1318.scala @@ -19,7 +19,7 @@ object A extends A0 {} abstract class B0 extends M { type mType = B0 - def fs: List[fType] = Nil + def fs: List[fType] = Nil } object B extends B0 {} diff --git a/test/files/pos/t1357.scala b/test/files/pos/t1357.scala index 7bc6d45034..fcdecb3ad3 100644 --- a/test/files/pos/t1357.scala +++ b/test/files/pos/t1357.scala @@ -6,7 +6,7 @@ object NonEmptyCons { object Main { type BT[+H, +T <: Tuple2[Tuple2[H, T], Tuple2[H, T]]] = Tuple2[H, T] - + // type T = Tuple2[String,String] type BinaryTree[+E] = BT[E, T forSome { type T <: Tuple2[BT[E, T], BT[E, T]] }] diff --git a/test/files/pos/t1385.scala b/test/files/pos/t1385.scala index 6fe7308281..aefd9c35b3 100644 --- a/test/files/pos/t1385.scala +++ b/test/files/pos/t1385.scala @@ -1,3 +1,3 @@ -object Test extends Serializable { +object Test extends Serializable { private def readResolve: AnyRef = this } diff --git a/test/files/pos/t1480.scala b/test/files/pos/t1480.scala index 3dc3062ca0..1d9f94d2e9 100644 --- a/test/files/pos/t1480.scala +++ b/test/files/pos/t1480.scala @@ -1,6 +1,6 @@ class Foo{ def compare(newP : Any, oldP : Any) : Boolean = (newP,oldP) match { - case (newP : AnyRef, oldP : AnyRef) if newP == oldP => newP == oldP - case (newS : Symbol, oldS: Symbol) if newS == oldS => newS == oldS + case (newP : AnyRef, oldP : AnyRef) if newP == oldP => newP == oldP + case (newS : Symbol, oldS: Symbol) if newS == oldS => newS == oldS } } diff --git a/test/files/pos/t1560.scala b/test/files/pos/t1560.scala index fb5592016a..2af299af86 100644 --- a/test/files/pos/t1560.scala +++ b/test/files/pos/t1560.scala @@ -1,13 +1,13 @@ object Test extends App { - + trait C[T] { def t: T } - + def b: Option[C[x] forSome { type x }] = null - + def c = b match { case Some(b) => b.t } - + } diff --git a/test/files/pos/t1565.scala b/test/files/pos/t1565.scala index 030086c541..df333151d5 100644 --- a/test/files/pos/t1565.scala +++ b/test/files/pos/t1565.scala @@ -3,7 +3,7 @@ object Bug1565 { def x() = { 0; (a : Int, b : Int) => println(List(a, b)) ; 0 } (a : Int, b : Int) => println(List(a, b)) - + // various function syntaxes to exercise the parser val xs = List(1,2,3) xs.filter(x => x < 2) diff --git a/test/files/pos/t1591b.scala b/test/files/pos/t1591b.scala index 84372bb084..c671ad6472 100644 --- a/test/files/pos/t1591b.scala +++ b/test/files/pos/t1591b.scala @@ -1,10 +1,10 @@ import scala.tools.nsc._ -class SemanticTokens(val compiler: Global) { - import compiler._ +class SemanticTokens(val compiler: Global) { + import compiler._ def build() = ErrorType - + class Process { def f() = analyzer // or to crash the compiler instead of a nice message, diff --git a/test/files/pos/t1711/Seq.scala b/test/files/pos/t1711/Seq.scala index 5f426ea0f7..c18f05cd73 100644 --- a/test/files/pos/t1711/Seq.scala +++ b/test/files/pos/t1711/Seq.scala @@ -3,7 +3,7 @@ package com object Sequence { def filteringFunction[V](filter: V => Boolean): List[V] => List[V] = { - def include(v: V) = + def include(v: V) = filter(v) (l: List[V]) => l.filter(include) } diff --git a/test/files/pos/t1722-A.scala b/test/files/pos/t1722-A.scala index 9e522a5059..d059bf22f8 100644 --- a/test/files/pos/t1722-A.scala +++ b/test/files/pos/t1722-A.scala @@ -1,8 +1,8 @@ sealed trait Top trait C { private object P extends Top -} -/* +} +/* $ scala -e 'new AnyRef with C' error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken (error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.) diff --git a/test/files/pos/t1722/Test.scala b/test/files/pos/t1722/Test.scala index 5685d8f40a..f236d3fdc4 100755 --- a/test/files/pos/t1722/Test.scala +++ b/test/files/pos/t1722/Test.scala @@ -1,5 +1,5 @@ package t1722 object Test { - val x = new AnyRef with C + val x = new AnyRef with C } diff --git a/test/files/pos/t1722/Top.scala b/test/files/pos/t1722/Top.scala index cec4c531f9..4ac52412aa 100755 --- a/test/files/pos/t1722/Top.scala +++ b/test/files/pos/t1722/Top.scala @@ -3,8 +3,8 @@ package t1722 sealed trait Top trait C { private object P extends Top -} -/* +} +/* $ scala -e 'new AnyRef with C' error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken (error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.) diff --git a/test/files/pos/t1745/J.java b/test/files/pos/t1745/J.java index d95efe8e6f..8444eabb24 100644 --- a/test/files/pos/t1745/J.java +++ b/test/files/pos/t1745/J.java @@ -1,9 +1,9 @@ -class J { +class J { S1 s1; S2 s2; - + String s = bar(S3.foo(), S3.bar("def")); - + private String bar(String s1, String s2) { return s1 + s2; } diff --git a/test/files/pos/t1756.scala b/test/files/pos/t1756.scala index 2e09c8a94a..1d067c3b04 100755 --- a/test/files/pos/t1756.scala +++ b/test/files/pos/t1756.scala @@ -1,5 +1,5 @@ -/** +/** This is a tricky issue which has to do with the fact that too much conflicting type information is propagated into a single implicit search, where the intended solution applies two implicit searches. @@ -35,20 +35,20 @@ class Poly[C <: Ring[C]](val c: C) extends Ring[Poly[C]] { } object Test extends App { - + implicit def coef2poly[C <: Ring[C]](c: C): Poly[C] = new Poly(c) val a = new A val x = new Poly(new A) - + println(x+a) // works println(a+x) // works - + val y = new Poly(new Poly(new A)) - + println(x+y*x) // works println(x*y+x) // works println(y*x+x) // works - + println(x+x*y) // failed before } diff --git a/test/files/pos/t1798.scala b/test/files/pos/t1798.scala index 93df61e844..1624e3025e 100644 --- a/test/files/pos/t1798.scala +++ b/test/files/pos/t1798.scala @@ -2,7 +2,7 @@ object Foo { private def bar(): Int = 55 } class Foo(x: Int) { def this() = this(Foo.bar()) } /* - * scalac28 a.scala + * scalac28 a.scala a.scala:2: error: method bar cannot be accessed in object Foo class Foo(x: Int) { def this() = this(Foo.bar()) } ^ diff --git a/test/files/pos/t1832.scala b/test/files/pos/t1832.scala index c7b1ffb838..f3bb556e32 100644 --- a/test/files/pos/t1832.scala +++ b/test/files/pos/t1832.scala @@ -1,7 +1,7 @@ trait Cloning { trait Foo def fn(g: Any => Unit): Foo - + implicit def mkStar(i: Int) = new { def *(a: Foo): Foo = null } val pool = 4 * fn { case ghostSYMBOL: Int => ghostSYMBOL * 2 } diff --git a/test/files/pos/t1840/J.java b/test/files/pos/t1840/J.java index a697596fdd..fd98b6c4a5 100644 --- a/test/files/pos/t1840/J.java +++ b/test/files/pos/t1840/J.java @@ -1,4 +1,4 @@ package p; -class J { - J() {} +class J { + J() {} } diff --git a/test/files/pos/t1974.scala b/test/files/pos/t1974.scala index 3d28478177..a0daa13c21 100644 --- a/test/files/pos/t1974.scala +++ b/test/files/pos/t1974.scala @@ -1,20 +1,20 @@ object Broken { private var map = Map[Class[_], String]() - + def addToMap(c : Class[_], s : String) = map += (c -> s) def fetch(c : Class[_]) = map(c) } object Works { private var map = Map[Class[_], String]() - + def addToMap(c : Class[_], s : String) = map += ((c, s)) def fetch(c : Class[_]) = map(c) } object Works2 { private var map = Map[Class[_], String]() - + def addToMap(c : Class[_], s : String) = map += ((c : Class[_]) -> s) def fetch(c : Class[_]) = map(c) }
\ No newline at end of file diff --git a/test/files/pos/t2023.scala b/test/files/pos/t2023.scala index de3e848fbd..21c6fc96a6 100644 --- a/test/files/pos/t2023.scala +++ b/test/files/pos/t2023.scala @@ -3,11 +3,11 @@ trait C[A] object C { implicit def ipl[A](implicit from: A => Ordered[A]): C[A] = null } - + object P { def foo[A](i: A, j: A)(implicit c: C[A]): Unit = () } - + class ImplicitChainTest { def testTrivial: Unit = { P.foo('0', '9') diff --git a/test/files/pos/t2060.scala b/test/files/pos/t2060.scala index cf7250f545..2c701150e4 100755 --- a/test/files/pos/t2060.scala +++ b/test/files/pos/t2060.scala @@ -4,7 +4,7 @@ * line': * * val failure = 1.0 + new Op[Int] - * + * * we reduce the problem to finding a function from Double to * {+: _ >: Op[Int] <: Any}, that is, a method which takes * an argument which is an Op[Int] or a supertype thereof. diff --git a/test/files/pos/t2081.scala b/test/files/pos/t2081.scala index f4f21600c6..395134f71c 100644 --- a/test/files/pos/t2081.scala +++ b/test/files/pos/t2081.scala @@ -7,5 +7,5 @@ object ScalaForRubyists { val x = 10.days // a couple parser corner cases I wanted not to break - val y = 5.0e0 + 5e7 + val y = 5.0e0 + 5e7 } diff --git a/test/files/pos/t2082.scala b/test/files/pos/t2082.scala index 38937d78fb..3a160612fe 100755 --- a/test/files/pos/t2082.scala +++ b/test/files/pos/t2082.scala @@ -1,10 +1,10 @@ trait Mapper[T <: Mapper[T]] -trait KeyedMapper[KeyType, T <: KeyedMapper[KeyType, T]] extends Mapper[T] +trait KeyedMapper[KeyType, T <: KeyedMapper[KeyType, T]] extends Mapper[T] -trait KeyedMetaMapper[KeyType, T <: KeyedMapper[KeyType, T]] +trait KeyedMetaMapper[KeyType, T <: KeyedMapper[KeyType, T]] trait MappedForeignKey[KeyType, Owner <: Mapper[Owner], Other <: KeyedMapper[KeyType, Other]] @@ -19,19 +19,19 @@ class TestRun extends KeyedMapper[Long, TestRun] with IdPK { object TestRun extends TestRun with KeyedMetaMapper[Long, TestRun] class MetaTestSubject extends TestSubject with KeyedMetaMapper[Long, TestSubject] -object TestSubject extends MetaTestSubject +object TestSubject extends MetaTestSubject object Main { - + def oneToOneJoin[PType <: KeyedMapper[Long, PType] with IdPK, CType <: KeyedMapper[Long, CType] with IdPK, - CMetaType <: CType with KeyedMetaMapper[Long, CType], + CMetaType <: CType with KeyedMetaMapper[Long, CType], FKType <: MappedForeignKey[Long, PType, CType]] - (parents: List[PType], metaMapper: CMetaType, keyGetter: (PType) => FKType ): + (parents: List[PType], metaMapper: CMetaType, keyGetter: (PType) => FKType ): Map[Long, CType] = Map.empty - + def callIt { - oneToOneJoin[TestRun, TestSubject, MetaTestSubject, + oneToOneJoin[TestRun, TestSubject, MetaTestSubject, MappedForeignKey[Long, TestRun, TestSubject]]( List(), TestSubject, (tr: TestRun) => tr.testSubject) } diff --git a/test/files/pos/t2130-2.scala b/test/files/pos/t2130-2.scala index 464f5e0d8e..1d0b33c3e5 100644 --- a/test/files/pos/t2130-2.scala +++ b/test/files/pos/t2130-2.scala @@ -10,7 +10,7 @@ package object bar { class Dingus object Dingus case class Dongus(x: Float) - + def apply(xs: Int*) = new Bippy(xs.sum) def apply() = new Bippy(5) } diff --git a/test/files/pos/t2133.scala b/test/files/pos/t2133.scala index 99bac5c38b..c74d0a4bbf 100644 --- a/test/files/pos/t2133.scala +++ b/test/files/pos/t2133.scala @@ -13,6 +13,6 @@ trait Foo2 { class Bob extends AnyRef with Foo with Foo2 { import bip._ import bar._ - + def go() = fn() } diff --git a/test/files/pos/t2168.scala b/test/files/pos/t2168.scala index 845c5b7361..21afb239a0 100644 --- a/test/files/pos/t2168.scala +++ b/test/files/pos/t2168.scala @@ -2,5 +2,3 @@ object Test extends App { def foo1(x: AnyRef) = x match { case x: Function0[_] => x() } def foo2(x: AnyRef) = x match { case x: Function0[Any] => x() } } - - diff --git a/test/files/pos/t2171.scala b/test/files/pos/t2171.scala index a5663c96cd..6c754c76a6 100644 --- a/test/files/pos/t2171.scala +++ b/test/files/pos/t2171.scala @@ -3,5 +3,5 @@ final object test { try 0 catch { case ex => println(msg) } def main (args: Array[String]): Unit = - while (true) logIgnoredException ("...") + while (true) logIgnoredException ("...") } diff --git a/test/files/pos/t2261.scala b/test/files/pos/t2261.scala index af24234235..aac5c9e0fd 100644 --- a/test/files/pos/t2261.scala +++ b/test/files/pos/t2261.scala @@ -5,5 +5,5 @@ object Test { x = List(1,2,3) // the problem here was that somehow the type variable that was used to infer the type argument for List.apply // would accumulate several conflicting constraints - // can't reproduce with + // can't reproduce with }
\ No newline at end of file diff --git a/test/files/pos/t2305.scala b/test/files/pos/t2305.scala index d0b103fdba..6b66c5db13 100644 --- a/test/files/pos/t2305.scala +++ b/test/files/pos/t2305.scala @@ -1,6 +1,6 @@ import java.util.ArrayList -trait Bind[Z[_]] +trait Bind[Z[_]] class MySerializable[X] extends java.io.Serializable @@ -17,7 +17,7 @@ object works { object breaks { def runbind(implicit bind: Bind[ArrayList]) {} - runbind + runbind /*java.lang.AssertionError: assertion failed: java.io.Serializable at scala.Predef$.assert(Predef.scala:107) at scala.tools.nsc.symtab.Types$TypeRef.transform(Types.scala:1417) diff --git a/test/files/pos/t2310.scala b/test/files/pos/t2310.scala index e08411a3df..68912b4961 100644 --- a/test/files/pos/t2310.scala +++ b/test/files/pos/t2310.scala @@ -1,15 +1,15 @@ import scala.Stream._ object consistencyError { - /* this gives an error: + /* this gives an error: Consistency problem compiling (virtual file)! Trying to call method body%1(List(scala.collection.immutable.Stream[A])) with arguments (List(tp2, temp6, temp5)) case (l #:: ls, rs) => None ^ scala.tools.nsc.symtab.Types$TypeError: too many arguments for method body%1: (val rs: scala.collection.immutable.Stream[A])None.type - + two errors found - vss(0) = + vss(0) = args = List(tp2, temp6, temp5) vss(1) = value rs, value ls, value l args = List(tp2, temp6, temp5) @@ -18,19 +18,19 @@ object consistencyError { labels(1) = method body%1 labels(0) = method body%0 bx = 1 - label.tpe = (val rs: scala.collection.immutable.Stream[A])None.type + label.tpe = (val rs: scala.collection.immutable.Stream[A])None.type */ def crash[A](lefts: Stream[A], rights: Stream[A]) = (lefts, rights) match { case (Stream.Empty, Stream.Empty) => None case (l #:: ls, rs) => None } - + // These work // def works1[A](lefts: Stream[A]) = lefts match { // case Stream.Empty => None // case l #:: ls => None // } - // + // // def works2[A](lefts: Stream[A], rights: Stream[A]) = (lefts, rights) match { // case (Stream.Empty, Stream.Empty) => None // case (ls, rs) => None diff --git a/test/files/pos/t2399.scala b/test/files/pos/t2399.scala index b009f7856b..07882dd549 100644 --- a/test/files/pos/t2399.scala +++ b/test/files/pos/t2399.scala @@ -3,12 +3,12 @@ trait That2[A, R <: That2[A, R]] trait T[A, This >: Null <: That1[A] with T[A, This]] extends That2[A, This] { self: This => - + private var next: This = _ def isEmpty = next eq null - + def length: Int = { def loop(x: This, cnt: Int): Int = if (x.isEmpty) cnt else loop(x.next, cnt + 1) loop(self, 0) - } + } }
\ No newline at end of file diff --git a/test/files/pos/t2413/TestScalac.scala b/test/files/pos/t2413/TestScalac.scala index 6992a30f2c..098e852dd7 100644 --- a/test/files/pos/t2413/TestScalac.scala +++ b/test/files/pos/t2413/TestScalac.scala @@ -4,7 +4,7 @@ class Foo extends TestJava { // THIS METHOD YIELDS TO CRASH /* def foomethod : Option[String] => Unit = { - case None => + case None => val path = repeatParam("s","a","b","c") () case Some(error) => diff --git a/test/files/pos/t2421_delitedsl.scala b/test/files/pos/t2421_delitedsl.scala index ad6afa7bd8..a05887023a 100644 --- a/test/files/pos/t2421_delitedsl.scala +++ b/test/files/pos/t2421_delitedsl.scala @@ -1,10 +1,10 @@ trait DeliteDSL { abstract class <~<[-From, +To] extends (From => To) - implicit def trivial[A]: A <~< A = new (A <~< A) {def apply(x: A) = x} + implicit def trivial[A]: A <~< A = new (A <~< A) {def apply(x: A) = x} trait Forcible[T] object Forcible { - def factory[T](f: T => Forcible[T]) = new (T <~< Forcible[T]){def apply(x: T) = f(x)} + def factory[T](f: T => Forcible[T]) = new (T <~< Forcible[T]){def apply(x: T) = f(x)} } case class DeliteInt(x: Int) extends Forcible[Int] @@ -22,16 +22,16 @@ trait DeliteDSL { // If T is already a proxy (it is forcible), the compiler should use // forcibleIdentity to deduce that P=T. If T is Int, the compiler // should use intToForcible to deduce that P=DeliteInt. - // + // // Without this feature, the user must write 'xs.proxyOfFirst[DeliteInt]', // with the feature they can write 'xs.proxyOfFirst', which is shorter and // avoids exposing internal DELITE types to the world. object Test { - val x = new DeliteCollection(List(1,2,3)).headProxy + val x = new DeliteCollection(List(1,2,3)).headProxy // inferred: val x: Forcible[Int] = new DeliteCollection[Int](List.apply[Int](1, 2, 3)).headProxy[Forcible[Int]](forcibleInt); - val xAlready = new DeliteCollection(List(DeliteInt(1),DeliteInt(2),DeliteInt(3))).headProxy + val xAlready = new DeliteCollection(List(DeliteInt(1),DeliteInt(2),DeliteInt(3))).headProxy // inferred: val xAlready: DeliteInt = new DeliteCollection[DeliteInt](List.apply[DeliteInt](DeliteInt(1), DeliteInt(2), DeliteInt(3))).headProxy[DeliteInt](trivial[DeliteInt]); } }
\ No newline at end of file diff --git a/test/files/pos/t2435.scala b/test/files/pos/t2435.scala index 2db931b99f..697e9e1f2d 100644 --- a/test/files/pos/t2435.scala +++ b/test/files/pos/t2435.scala @@ -9,7 +9,7 @@ object Bug { case class FConstant[E <: FChain](constant:String, tail:E) extends FChain { type T = tail.T } - + object FNil extends FChain { type T = Unit } diff --git a/test/files/pos/t2444.scala b/test/files/pos/t2444.scala index a052270196..fac1e95d0f 100644 --- a/test/files/pos/t2444.scala +++ b/test/files/pos/t2444.scala @@ -2,14 +2,14 @@ object Test { trait Foo - class Bar { + class Bar { object baz extends Foo } - def frob[P1, P2<:Foo](f:P1 => P2) = () + def frob[P1, P2<:Foo](f:P1 => P2) = () def main(args:Array[String]) : Unit = { - frob((p:Bar) => p.baz) + frob((p:Bar) => p.baz) } } diff --git a/test/files/pos/t2464/ScalaOne_1.scala b/test/files/pos/t2464/ScalaOne_1.scala index 0271b9ce72..1caf8ecae4 100644 --- a/test/files/pos/t2464/ScalaOne_1.scala +++ b/test/files/pos/t2464/ScalaOne_1.scala @@ -1,6 +1,6 @@ class ScalaClassOne extends ClassTwo.Child { def func4() = { func2 - } + } } diff --git a/test/files/pos/t247.scala b/test/files/pos/t247.scala index 983b7998a9..e976404e61 100644 --- a/test/files/pos/t247.scala +++ b/test/files/pos/t247.scala @@ -12,7 +12,7 @@ class TreeMapFactory[KEY](newOrder:Order[KEY]) extends MapFactory[KEY] { def Empty[V] = new TreeMap[KEY,V](new TreeMapFactory[KEY](order)); } -class Tree[KEY,Entry](order:Order[KEY]) { +class Tree[KEY,Entry](order:Order[KEY]) { def size =0; } diff --git a/test/files/pos/t2504.scala b/test/files/pos/t2504.scala index 0abe7dd13e..67f8226852 100755 --- a/test/files/pos/t2504.scala +++ b/test/files/pos/t2504.scala @@ -1,5 +1,5 @@ object Test { val ys: Iterable[_] = Array("abc") - val xs = Array("abc") + val xs = Array("abc") xs sameElements Array("abc") } diff --git a/test/files/pos/t2545.scala b/test/files/pos/t2545.scala index b4238fb718..6ad994223c 100755 --- a/test/files/pos/t2545.scala +++ b/test/files/pos/t2545.scala @@ -1,6 +1,6 @@ trait Frog[T] { - def hello: T - def size: Int + def hello: T + def size: Int } trait OnlyWithFrogs { diff --git a/test/files/pos/t2569/Child.scala b/test/files/pos/t2569/Child.scala index 3d7f4248b5..64f4dc172f 100644 --- a/test/files/pos/t2569/Child.scala +++ b/test/files/pos/t2569/Child.scala @@ -1,9 +1,9 @@ package varargs - + class Child extends Parent { - + override def concatenate(strings: String*): String = strings map("\"" + _ + "\"") mkString("(", ", ", ")") - + } diff --git a/test/files/pos/t2569/Parent.java b/test/files/pos/t2569/Parent.java index 133f2ee567..89421becbd 100644 --- a/test/files/pos/t2569/Parent.java +++ b/test/files/pos/t2569/Parent.java @@ -1,7 +1,7 @@ package varargs; - + public class Parent { - + public String concatenate(String... strings) { StringBuilder builder = new StringBuilder(); for (String s : strings) { @@ -9,5 +9,5 @@ package varargs; } return builder.toString(); } - + } diff --git a/test/files/pos/t262.scala b/test/files/pos/t262.scala index b81490977c..ec6187b36b 100644 --- a/test/files/pos/t262.scala +++ b/test/files/pos/t262.scala @@ -1,11 +1,11 @@ object O { abstract class A { - def f:A; + def f:A; } class B extends A { def f = if(1 == 2) new C else new D; } - class C extends A { + class C extends A { def f = this; } class D extends A { diff --git a/test/files/pos/t2665.scala b/test/files/pos/t2665.scala index 108daf509a..3163e31326 100644 --- a/test/files/pos/t2665.scala +++ b/test/files/pos/t2665.scala @@ -1,3 +1,3 @@ object Test { - val x: Unit = Array("") + val x: Unit = Array("") }
\ No newline at end of file diff --git a/test/files/pos/t2669.scala b/test/files/pos/t2669.scala index e34f08f0f5..72e931178c 100644 --- a/test/files/pos/t2669.scala +++ b/test/files/pos/t2669.scala @@ -23,6 +23,6 @@ import java.util.Vector // scalac cannot detect lack of type params, but then throws AssertionError later: class TVector2639 { - val b = new Vector // this line passed without error detected + val b = new Vector // this line passed without error detected val a = new Vector(1) // this line caused throwing AssertionError when scalac } diff --git a/test/files/pos/t2691.scala b/test/files/pos/t2691.scala index 94012a8177..5f0ddd122f 100644 --- a/test/files/pos/t2691.scala +++ b/test/files/pos/t2691.scala @@ -1,5 +1,5 @@ object Breakdown { - def unapplySeq(x: Int): Some[List[String]] = Some(List("", "there")) + def unapplySeq(x: Int): Some[List[String]] = Some(List("", "there")) } object Test { 42 match { diff --git a/test/files/pos/t2726/SQLBuilder_1.scala b/test/files/pos/t2726/SQLBuilder_1.scala index 7b3e3d8322..8d07a88265 100644 --- a/test/files/pos/t2726/SQLBuilder_1.scala +++ b/test/files/pos/t2726/SQLBuilder_1.scala @@ -1,7 +1,7 @@ class SQLBuilder extends SQLBuilder.Segment -object SQLBuilder { - trait Segment +object SQLBuilder { + trait Segment } diff --git a/test/files/pos/t2910.scala b/test/files/pos/t2910.scala index 17a6a64809..d4d92fa765 100644 --- a/test/files/pos/t2910.scala +++ b/test/files/pos/t2910.scala @@ -9,9 +9,9 @@ object Test { lazy val s = "abc" } - def test3 { + def test3 { lazy val lazyBar = bar - object bar { + object bar { val foo = 12 } lazy val lazyBar2 = bar @@ -29,5 +29,5 @@ object Test { lazy val f: Int = g Console.println("foo") lazy val g: Int = f - } + } }
\ No newline at end of file diff --git a/test/files/pos/t2913.scala b/test/files/pos/t2913.scala index ee86b9e402..11d8b92053 100755 --- a/test/files/pos/t2913.scala +++ b/test/files/pos/t2913.scala @@ -11,13 +11,13 @@ class RichA { object Test { implicit def AToRichA(a: A) = new RichA - + val a = new A a.foo() a.foo(1) a.foo("") // Without implicits, a type error regarding invalid argument types is generated at `""`. This is - // the same position as an argument, so the 'second try' typing with an Implicit View is tried, + // the same position as an argument, so the 'second try' typing with an Implicit View is tried, // and AToRichA(a).foo("") is found. // // My reading of the spec "7.3 Views" is that `a.foo` denotes a member of `a`, so the view should @@ -48,6 +48,6 @@ object Main { val fn = (a : Int, str : String) => "a: " + a + ", str: " + str implicit def fx[T](f : (T,String) => String) = (x:T) => f(x,null) println(fn(1)) - () + () } } diff --git a/test/files/pos/t2939.scala b/test/files/pos/t2939.scala index 67677f2f18..3be4d4d561 100644 --- a/test/files/pos/t2939.scala +++ b/test/files/pos/t2939.scala @@ -4,10 +4,10 @@ object Proxies { class C1 extends MapProxy[Int,Int] { def self = Map[Int,Int]() } class C2 extends mutable.MapProxy[Int,Int] { def self = mutable.Map[Int,Int]() } class C3 extends immutable.MapProxy[Int,Int] { def self = immutable.Map[Int,Int]() } - + class C4 extends SetProxy[Int] { def self = Set[Int]() } class C5 extends mutable.SetProxy[Int] { def self = mutable.Set[Int]() } class C6 extends immutable.SetProxy[Int] { def self = immutable.Set[Int]() } - + class C7 extends SeqProxy[Int] { def self = Seq[Int]() } }
\ No newline at end of file diff --git a/test/files/pos/t2940/Error.scala b/test/files/pos/t2940/Error.scala index 7c600667f3..bf5a6bd0df 100644 --- a/test/files/pos/t2940/Error.scala +++ b/test/files/pos/t2940/Error.scala @@ -5,8 +5,8 @@ abstract class Error { object Test { trait Quux[T] extends Cycle[Quux[T]] val x = new Quux[Int] { def doStuff() { } } - + def main(args: Array[String]): Unit = { - + } } diff --git a/test/files/pos/t2994a.scala b/test/files/pos/t2994a.scala index f2d57c34ca..cb4a389e2f 100644 --- a/test/files/pos/t2994a.scala +++ b/test/files/pos/t2994a.scala @@ -17,8 +17,8 @@ object Naturals { type _5 = SUCC[_4] type _6 = SUCC[_5] - - // crashes scala-2.8.0 beta1 + + // crashes scala-2.8.0 beta1 trait MUL[n <: NAT, m <: NAT] extends NAT { trait curry[n[_[_], _], s[_]] { type f[z <: NAT] = n[s, z] } type a[s[_ <: NAT] <: NAT, z <: NAT] = n#a[curry[m#a, s]#f, z] diff --git a/test/files/pos/t3020.scala b/test/files/pos/t3020.scala index cb429cd94f..016563e27f 100644 --- a/test/files/pos/t3020.scala +++ b/test/files/pos/t3020.scala @@ -1,7 +1,7 @@ object Test { def main(args: Array[String]): Unit = { var x = true - + ( { if (x) new scala.util.Random() } .asInstanceOf[Runnable] ) } } diff --git a/test/files/pos/t3079.scala b/test/files/pos/t3079.scala index 4bead34ff3..fa732ea516 100644 --- a/test/files/pos/t3079.scala +++ b/test/files/pos/t3079.scala @@ -10,8 +10,8 @@ object Coerce { def IdentityCoerce[B] = new Coerce[Identity[B], B] { // java.lang.Error: A in trait Identity cannot be instantiated from ?x$1.type def unwrap = _.value - + // Providing the type of _ works around the problem. - //def unwrap = (_: Identity[B]).value + //def unwrap = (_: Identity[B]).value } }
\ No newline at end of file diff --git a/test/files/pos/t3106.scala b/test/files/pos/t3106.scala index cf7b507126..162e93366f 100644 --- a/test/files/pos/t3106.scala +++ b/test/files/pos/t3106.scala @@ -3,5 +3,5 @@ class Sample[A] (val d0: ((A,A)) => A) {} object Sample { implicit def apply[A] (x:A): Sample[A] = { new Sample(p => p._1) - } + } }
\ No newline at end of file diff --git a/test/files/pos/t3136.scala b/test/files/pos/t3136.scala index 6a5850aeb0..33d42c2f3c 100644 --- a/test/files/pos/t3136.scala +++ b/test/files/pos/t3136.scala @@ -11,7 +11,7 @@ object NullaryMethodType { } object Test { - def TEST(tp: Type): String = + def TEST(tp: Type): String = tp match { case PolyType(ps1, PolyType(ps2, res @ PolyType(a, b))) => "1"+tp // couldn't find a simpler version that still crashes case NullaryMethodType(meh) => "2"+meh diff --git a/test/files/pos/t3174b.scala b/test/files/pos/t3174b.scala index 002c4f090f..4df1bfe837 100755 --- a/test/files/pos/t3174b.scala +++ b/test/files/pos/t3174b.scala @@ -2,9 +2,9 @@ trait Foo[X] { def foo : Map[String,Foo[X]] } object Test { def f[T]() : Foo[T] = { - class Anon extends Foo[T] { - var foo: Map[String, Foo[T]] = Map[String,Foo[T]]() - //def foo = Map[String,Foo[T]]() + class Anon extends Foo[T] { + var foo: Map[String, Foo[T]] = Map[String,Foo[T]]() + //def foo = Map[String,Foo[T]]() //def foo_=(x: Map[String,Foo[T]]) {} } new Anon diff --git a/test/files/pos/t3175-pos.scala b/test/files/pos/t3175-pos.scala index 497ff8255c..89bbf8b5fc 100644 --- a/test/files/pos/t3175-pos.scala +++ b/test/files/pos/t3175-pos.scala @@ -1,7 +1,7 @@ object Test { - def f(g:{val update:Unit}) = g.update - + def f(g:{val update:Unit}) = g.update + def main(args: Array[String]): Unit = { - + } } diff --git a/test/files/pos/t3177.scala b/test/files/pos/t3177.scala index 21893c9422..9f9528faec 100644 --- a/test/files/pos/t3177.scala +++ b/test/files/pos/t3177.scala @@ -1,17 +1,17 @@ trait InvariantFunctor[F[_]] { def xmap[A, B](ma: F[A], f: A => B, g: B => A): F[B] } - + object InvariantFunctor { import Endo._ - + implicit val EndoInvariantFunctor = new InvariantFunctor[Endo] { - def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) + def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) } - + // The definition about fails with: // anon-type.scala:9: error: not found: value b - // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) + // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) // ^ // anon-type.scala:8: error: not found: type $anon // implicit val EndoInvariantFunctor = new InvariantFunctor[Endo] { @@ -20,9 +20,9 @@ object InvariantFunctor { // These both work: // implicit val EndoInvariantFunctorAscribed: InvariantFunctor[Endo] = new InvariantFunctor[Endo] { - // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) + // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) // } - // + // // implicit val EndoInvariantFunctorStubbed = new InvariantFunctor[Endo] { // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = error("stub") // } diff --git a/test/files/pos/t3274.scala b/test/files/pos/t3274.scala index dfa6a4ec01..15723184bb 100644 --- a/test/files/pos/t3274.scala +++ b/test/files/pos/t3274.scala @@ -1,7 +1,7 @@ -trait A { this: B => - trait X { +trait A { this: B => + trait X { class Y1 extends Y - } + } } trait B extends A { diff --git a/test/files/pos/t3312.scala b/test/files/pos/t3312.scala index 9bf3e23ed3..aef965d2e7 100644 --- a/test/files/pos/t3312.scala +++ b/test/files/pos/t3312.scala @@ -12,6 +12,6 @@ trait B extends Root { object Foo extends A with B { override def say: String = foo(super[A].say) - + def foo(p: => String): String = p } diff --git a/test/files/pos/t3349/AbstractTupleSet.java b/test/files/pos/t3349/AbstractTupleSet.java index 47b440a589..38e4743ef4 100644 --- a/test/files/pos/t3349/AbstractTupleSet.java +++ b/test/files/pos/t3349/AbstractTupleSet.java @@ -5,5 +5,5 @@ public abstract class AbstractTupleSet implements TupleSet { public void addColumn(String name, String expr) { throw new UnsupportedOperationException(); - } + } } diff --git a/test/files/pos/t3411.scala b/test/files/pos/t3411.scala index b76fec66a6..b58e52db8d 100644 --- a/test/files/pos/t3411.scala +++ b/test/files/pos/t3411.scala @@ -1,6 +1,6 @@ object A { def g(c: PartialFunction[Any,Unit]) {} - + def f { lazy val x = 0 g { case `x` => } diff --git a/test/files/pos/t3429/A.scala b/test/files/pos/t3429/A.scala index 4b705808c1..80785db51d 100644 --- a/test/files/pos/t3429/A.scala +++ b/test/files/pos/t3429/A.scala @@ -2,8 +2,8 @@ class A { @Test(exc = classOf[Exception]) def myTestMethod = 0 } -// rytz@chara:~/scala/trunk/sandbox$ javac Test.java -// rytz@chara:~/scala/trunk/sandbox$ ../build/pack/bin/scalac A.scala +// rytz@chara:~/scala/trunk/sandbox$ javac Test.java +// rytz@chara:~/scala/trunk/sandbox$ ../build/pack/bin/scalac A.scala // A.scala:2: error: type mismatch; // found : java.lang.Class[Exception](classOf[java.lang.Exception]) // required: java.lang.Class diff --git a/test/files/pos/t3430.scala b/test/files/pos/t3430.scala index 4990abb2a1..3129c6276a 100644 --- a/test/files/pos/t3430.scala +++ b/test/files/pos/t3430.scala @@ -1,6 +1,6 @@ // package com.example -object A { +object A { def f1(f: String => Boolean) = f("a") def f2(): Boolean = diff --git a/test/files/pos/t3521/DoubleValue.java b/test/files/pos/t3521/DoubleValue.java index 28f05cd972..e8c093890b 100644 --- a/test/files/pos/t3521/DoubleValue.java +++ b/test/files/pos/t3521/DoubleValue.java @@ -4,4 +4,4 @@ import java.lang.annotation.*; @Target(ElementType.FIELD) public @interface DoubleValue { double value(); -}
\ No newline at end of file +}
\ No newline at end of file diff --git a/test/files/pos/t3528.scala b/test/files/pos/t3528.scala index b1c4344731..ff49b3e929 100644 --- a/test/files/pos/t3528.scala +++ b/test/files/pos/t3528.scala @@ -4,5 +4,5 @@ class A { // 3528 comments def f2 = List(Set(1,2,3), List(1,2,3)) // 2322 - def f3 = List(null: Range, null: List[Int]) + def f3 = List(null: Range, null: List[Int]) } diff --git a/test/files/pos/t3568.scala b/test/files/pos/t3568.scala index 0f26e2fad3..c8e3fcc4be 100755 --- a/test/files/pos/t3568.scala +++ b/test/files/pos/t3568.scala @@ -14,7 +14,7 @@ package buffer { // ArrayVec2 can be compiled, instantiated and used. def main(args: Array[String]) { println(works) } } - + trait ElemType { type Element; type Component <: ElemType } trait Float1 extends ElemType { type Element = Float; type Component = Float1} class Vec2 extends ElemType { type Element = Vec2; type Component = Float1 } diff --git a/test/files/pos/t3578.scala b/test/files/pos/t3578.scala index 306cde811b..d984118208 100644 --- a/test/files/pos/t3578.scala +++ b/test/files/pos/t3578.scala @@ -24,7 +24,7 @@ object Test { case class JInt(num: BigInt) extends JValue case class JBool(value: Boolean) extends JValue case class JField(name: String, value: JValue) extends JValue - case class JObject(obj: List[JField]) extends JValue + case class JObject(obj: List[JField]) extends JValue case class JArray(arr: List[JValue]) extends JValue } diff --git a/test/files/pos/t3582.scala b/test/files/pos/t3582.scala index e20af5e61d..0ac112efbf 100644 --- a/test/files/pos/t3582.scala +++ b/test/files/pos/t3582.scala @@ -6,7 +6,7 @@ object Test { // [[syntax trees at end of typer]] // abstract trait C#5[A#9116 >: Nothing#5832 <: Any#52] extends scala#33.AnyRef#2780; // final object Test#15 extends java.lang.Object#2485 with ScalaObject#1913 { -// def ImplicitParamCA#9123[CC#9124[A#10858 >: Nothing#5832 <: Any#52] >: [A#10858]Nothing#5832 <: [A#10858]Any#52, +// def ImplicitParamCA#9123[CC#9124[A#10858 >: Nothing#5832 <: Any#52] >: [A#10858]Nothing#5832 <: [A#10858]Any#52, // A#9125 >: Nothing#5832 <: Any#52](implicit ev#10856: C#5[A#9127]): Unit#3818 // = scala#34.this.Predef#1683.implicitly#8816[C#5[A#10858]]() // } diff --git a/test/files/pos/t3636.scala b/test/files/pos/t3636.scala index dbfc7a2c94..24d18c653d 100644 --- a/test/files/pos/t3636.scala +++ b/test/files/pos/t3636.scala @@ -5,11 +5,11 @@ class CTxnLocal[ T ] { } trait Txn - + trait ProcTxn { def ccstm: Txn } - + trait TxnLocal[ @specialized T ] { def apply()( implicit tx: ProcTxn ) : T def set( v: T )( implicit tx: ProcTxn ) : Unit diff --git a/test/files/pos/t3670.scala b/test/files/pos/t3670.scala index 19959f910f..ec4fbe5b4f 100644 --- a/test/files/pos/t3670.scala +++ b/test/files/pos/t3670.scala @@ -1,4 +1,4 @@ -class A { +class A { val n = { val z = { lazy val bb = 1 diff --git a/test/files/pos/t3671.scala b/test/files/pos/t3671.scala index 75559f84e2..1ca9327bb7 100644 --- a/test/files/pos/t3671.scala +++ b/test/files/pos/t3671.scala @@ -2,6 +2,6 @@ object Crash { def crash(value: Int): Unit = value match { case java.lang.Integer.MAX_VALUE => println("MAX_VALUE") - case java.lang.Integer.MIN_VALUE => println("MIN_VALUE") + case java.lang.Integer.MIN_VALUE => println("MIN_VALUE") } }
\ No newline at end of file diff --git a/test/files/pos/t3837.scala b/test/files/pos/t3837.scala index e1797dba77..bcaf63cc8d 100644 --- a/test/files/pos/t3837.scala +++ b/test/files/pos/t3837.scala @@ -1,8 +1,8 @@ class BipClass { } trait BipTrait { self: BipClass => - - private[this] def foo() = 5 + + private[this] def foo() = 5 def bar() = this.foo() } // error: value foo is not a member of BipTrait with BipClass diff --git a/test/files/pos/t3856.scala b/test/files/pos/t3856.scala index 5ea4b84e2c..132c95c5e6 100644 --- a/test/files/pos/t3856.scala +++ b/test/files/pos/t3856.scala @@ -1,4 +1,4 @@ -case class C[T](x: T) +case class C[T](x: T) case class CS(xs: C[_]*) diff --git a/test/files/pos/t3866.scala b/test/files/pos/t3866.scala index 5fe7e3f50e..5d366ccf13 100644 --- a/test/files/pos/t3866.scala +++ b/test/files/pos/t3866.scala @@ -13,5 +13,5 @@ abstract class ImplicitRepeated { f("A", 1, 2) // should be implicitly resolved to alternative b) f( 1, 2 ) // should be implicitly resolved to alternative a) // ImplicitRepeated.this.f[Int, Nothing]("A", ImplicitRepeated.this.anyToN[Int](1), ImplicitRepeated.this.anyToN[Int](2)); - // ImplicitRepeated.this.f[Int, Nothing](ImplicitRepeated.this.anyToN[Int](1), ImplicitRepeated.this.anyToN[Int](2)) + // ImplicitRepeated.this.f[Int, Nothing](ImplicitRepeated.this.anyToN[Int](1), ImplicitRepeated.this.anyToN[Int](2)) }
\ No newline at end of file diff --git a/test/files/pos/t3880.scala b/test/files/pos/t3880.scala index b6f06c43a3..cd5f3c0125 100644 --- a/test/files/pos/t3880.scala +++ b/test/files/pos/t3880.scala @@ -1,6 +1,6 @@ abstract class Bar[+B] { } -abstract class C1[+B] extends Bar[B] { +abstract class C1[+B] extends Bar[B] { private[this] def g(x: C1[B]): Unit = () // this method is fine: notice that it allows the call to g, diff --git a/test/files/pos/t3898.scala b/test/files/pos/t3898.scala index 075692e5a8..ab47bbd877 100644 --- a/test/files/pos/t3898.scala +++ b/test/files/pos/t3898.scala @@ -2,5 +2,5 @@ trait Atomic[@specialized(Boolean) T] { def x: T def f(fn: T => T): Boolean = f(fn(x), true) - def f[R](a: T, b: R): R = b + def f[R](a: T, b: R): R = b } diff --git a/test/files/pos/t3938/Parent.java b/test/files/pos/t3938/Parent.java index a35f435030..08fae330bb 100644 --- a/test/files/pos/t3938/Parent.java +++ b/test/files/pos/t3938/Parent.java @@ -1,7 +1,7 @@ public class Parent<A>{ class I1 {} class I2 extends Parent.I1 {} - + // OKAY: class I3 extends I1 {} static class I4 {} diff --git a/test/files/pos/t3938/UseParent.scala b/test/files/pos/t3938/UseParent.scala index 3f4c2298d5..685d1a03a8 100644 --- a/test/files/pos/t3938/UseParent.scala +++ b/test/files/pos/t3938/UseParent.scala @@ -1,6 +1,6 @@ object UseParent { classOf[Parent[AnyRef]#I2] - + // OKAY classOf[Parent[AnyRef]#I3] classOf[Parent.I5] diff --git a/test/files/pos/t3972.scala b/test/files/pos/t3972.scala index d6cbb3dfb7..5dfc10fcef 100644 --- a/test/files/pos/t3972.scala +++ b/test/files/pos/t3972.scala @@ -2,7 +2,7 @@ object CompilerCrash { def main(args: Array[String]) { args match { case Array("a", a @ _*) => { } // The code compiles fine if this line is commented out or "@ _*" is deleted or this line is swapped for the next line - case Array("b") => { } // The code compiles fine if this line is commented out + case Array("b") => { } // The code compiles fine if this line is commented out case Array("c", c) => { 0 // The code compiles fine if this line is commented out } diff --git a/test/files/pos/t4020.scala b/test/files/pos/t4020.scala index 8a758d53f7..f976460191 100644 --- a/test/files/pos/t4020.scala +++ b/test/files/pos/t4020.scala @@ -14,11 +14,11 @@ class B { def mthd(foo: a2.Foo) = { foo match { case a2.Foo2(i) => i - - // Note: This case is impossible. In fact, scalac + + // Note: This case is impossible. In fact, scalac // will (correctly) report an error if it is uncommented, // but a warning if it is commented. - + // case a1.Foo1(i) => i } } diff --git a/test/files/pos/t4070.scala b/test/files/pos/t4070.scala index 29c8d16e30..a9777f02ed 100644 --- a/test/files/pos/t4070.scala +++ b/test/files/pos/t4070.scala @@ -21,14 +21,14 @@ package b { /* // With crash below the clasess: -% scalac -Dscalac.debug.tvar ./a.scala +% scalac -Dscalac.debug.tvar ./a.scala [ create] ?_$1 ( In Foo#crash ) [ setInst] tv[Int] ( In Foo#crash, _$1=tv[Int] ) [ create] tv[Int] ( In Foo#crash ) [ clone] tv[Int] ( Foo#crash ) // With crash above the classes: -% scalac -Dscalac.debug.tvar ./a.scala +% scalac -Dscalac.debug.tvar ./a.scala [ create] ?tv ( In Foo#crash ) ./a.scala:2: error: Invalid type application in TypeVar: List(), List(Int) def crash(x: Dingus[_]): Unit = x match { case m: Bippy[tv] => () } diff --git a/test/files/pos/t4202.scala b/test/files/pos/t4202.scala index aca7d503ee..b2a0c0120a 100644 --- a/test/files/pos/t4202.scala +++ b/test/files/pos/t4202.scala @@ -2,7 +2,7 @@ object t4202_1 { () => { trait T { def t = () - } + } } } diff --git a/test/files/pos/t4220.scala b/test/files/pos/t4220.scala index 8fb999e345..98f2649767 100644 --- a/test/files/pos/t4220.scala +++ b/test/files/pos/t4220.scala @@ -1,4 +1,4 @@ -// don't know if our half-working sbt build is meaningfully +// don't know if our half-working sbt build is meaningfully // tested for #4220 with this, but it can't hurt. class Boo(a: Int = 0) diff --git a/test/files/pos/t4243.scala b/test/files/pos/t4243.scala index 5fa8665918..e6c66faff0 100644 --- a/test/files/pos/t4243.scala +++ b/test/files/pos/t4243.scala @@ -3,16 +3,16 @@ object wrap { - + trait DomainLike[@specialized(Int) A, +This <: Domain[A]] - + trait Domain[@specialized(Int) B] extends DomainLike[B, Domain[B]] - + trait IterableDomainLike[@specialized(Int) C, +This <: IterableDomain[C]] extends DomainLike[C, This] - + trait IterableDomain[@specialized(Int) D] extends Domain[D] with IterableDomainLike[D, IterableDomain[D]] - + } diff --git a/test/files/pos/t4266.scala b/test/files/pos/t4266.scala index 301cc264bc..222f65e970 100644 --- a/test/files/pos/t4266.scala +++ b/test/files/pos/t4266.scala @@ -1,21 +1,21 @@ object Test { - + trait Tensor2Like[ - @specialized(Int) A1, - +D1 <: DomainLike[A1], + @specialized(Int) A1, + +D1 <: DomainLike[A1], +D <: Product2DomainLike[D1] ] { def domain: D; - + def checkKey(k1: A1) { domain._1.contains(k1) } } - + trait DomainLike[A] { def contains(key: A): Boolean; } - + // trait DomainLike[@specialized(Int) A] { // def contains(key: A): Boolean; // } diff --git a/test/files/pos/t4269.scala b/test/files/pos/t4269.scala index 70f0471a9a..99a30785b4 100644 --- a/test/files/pos/t4269.scala +++ b/test/files/pos/t4269.scala @@ -1,5 +1,5 @@ -class A { - PartialFunction.condOpt(Nil) { - case items@List(_*) if true => +class A { + PartialFunction.condOpt(Nil) { + case items@List(_*) if true => } } diff --git a/test/files/pos/t4273.scala b/test/files/pos/t4273.scala index 9a942e8325..a4d37174ad 100644 --- a/test/files/pos/t4273.scala +++ b/test/files/pos/t4273.scala @@ -1,8 +1,8 @@ class A { implicit def compareComparables[T](x: T)(implicit ord: Ordering[T]) = new ord.Ops(x) - + class Bippy implicit val bippyOrdering = new Ordering[Bippy] { def compare(x: Bippy, y: Bippy) = util.Random.nextInt } - + (new Bippy) < (new Bippy) }
\ No newline at end of file diff --git a/test/files/pos/t4275.scala b/test/files/pos/t4275.scala index 183cb5155e..1938aceadc 100644 --- a/test/files/pos/t4275.scala +++ b/test/files/pos/t4275.scala @@ -1,6 +1,6 @@ object Test { def f = "abc".count(_ > 'a') - + class A { private val count: Int = 0 } diff --git a/test/files/pos/t430-feb09.scala b/test/files/pos/t430-feb09.scala index bba8996e4e..1499f32b7a 100644 --- a/test/files/pos/t430-feb09.scala +++ b/test/files/pos/t430-feb09.scala @@ -13,12 +13,12 @@ package c.scala { case class C[T]() } -// Doesn't compile: type Nothing is not a member of d.scala +// Doesn't compile: type Nothing is not a member of d.scala package d.scala.d { case class D[T]() } -// Doesn't compile: type Any is not a member of e.scala +// Doesn't compile: type Any is not a member of e.scala package e.scala { case class E[T >: Nothing]() } diff --git a/test/files/pos/t4432.scala b/test/files/pos/t4432.scala index 09f4c2ab34..106312311a 100644 --- a/test/files/pos/t4432.scala +++ b/test/files/pos/t4432.scala @@ -9,7 +9,7 @@ object Main { } new A } - + def foo2 = { class B { val x = { @@ -38,5 +38,5 @@ object Main { } new D } - + } diff --git a/test/files/pos/t4457_1.scala b/test/files/pos/t4457_1.scala index 4442f28e4a..32edd6cfdc 100644 --- a/test/files/pos/t4457_1.scala +++ b/test/files/pos/t4457_1.scala @@ -15,7 +15,7 @@ object ImplicitConvAmbiguity2 { def aFunc[A](a: NN[A]) = new BB[A] def bFunc[T](e1: N[T]) = {} - + def typeMe1 { val x = aFunc(4F) bFunc(x) diff --git a/test/files/pos/t4501.scala b/test/files/pos/t4501.scala index dac2524024..40628f1a4b 100644 --- a/test/files/pos/t4501.scala +++ b/test/files/pos/t4501.scala @@ -6,7 +6,7 @@ class A { def f1 = foo(ListBuffer(), List()) def f2 = foo(ListBuffer(), ListBuffer()) def f3 = foo(List(), List()) - + // scalap // def f1 : scala.collection.Seq[scala.Nothing] = { /* compiled code */ } // def f2 : scala.collection.mutable.ListBuffer[scala.Nothing] = { /* compiled code */ } diff --git a/test/files/pos/t460.scala b/test/files/pos/t460.scala index 466d06c2ad..3fc13e4dd0 100644 --- a/test/files/pos/t460.scala +++ b/test/files/pos/t460.scala @@ -1,8 +1,8 @@ object Bug460 { def testFun(x : Int, y : Int) = x + y - val fn = testFun _ - - fn(1, 2) // Ok + val fn = testFun _ + + fn(1, 2) // Ok (testFun(_, _))(1, 2) // Ok (testFun _).apply(1, 2) (testFun _)(1, 2) // Error! (but no longer) diff --git a/test/files/pos/t4603/S.scala b/test/files/pos/t4603/S.scala index 9e228195a4..c7d809d9f7 100644 --- a/test/files/pos/t4603/S.scala +++ b/test/files/pos/t4603/S.scala @@ -1,7 +1,7 @@ // S.scala class S extends J[AnyRef] -object Test { +object Test { def main(args:Array[String]) { J.f(classOf[S]) } diff --git a/test/files/pos/t4716.scala b/test/files/pos/t4716.scala index d4bd55c55b..ec29e8d2cb 100644 --- a/test/files/pos/t4716.scala +++ b/test/files/pos/t4716.scala @@ -2,7 +2,7 @@ -trait Bug2[@specialized(Int) +A] extends TraversableOnce[A] { +trait Bug2[@specialized(Int) +A] extends TraversableOnce[A] { def ++[B >: A](that: TraversableOnce[B]) = { lazy val it = that.toIterator it diff --git a/test/files/pos/t4717.scala b/test/files/pos/t4717.scala index 4acfe489cc..ed35a8ad87 100644 --- a/test/files/pos/t4717.scala +++ b/test/files/pos/t4717.scala @@ -6,13 +6,13 @@ trait Bug1[@specialized(Boolean) A] extends TraversableOnce[A] { - + def ++[B >: A](that: TraversableOnce[B]): Iterator[B] = new Iterator[B] { lazy val it = that.toIterator def hasNext = it.hasNext def next = it.next } - + } diff --git a/test/files/pos/t4760.scala b/test/files/pos/t4760.scala index 767e3847f4..d4407a86b4 100644 --- a/test/files/pos/t4760.scala +++ b/test/files/pos/t4760.scala @@ -19,7 +19,7 @@ class Test { import scala.util.Properties.lineSeparator } } - + // parses def f3 = { import scala._ diff --git a/test/files/pos/t4840.scala b/test/files/pos/t4840.scala index eefa3b2dee..bf44f71d7a 100644 --- a/test/files/pos/t4840.scala +++ b/test/files/pos/t4840.scala @@ -1,6 +1,6 @@ class Crashy { def g(): Option[Any] = None - + def crashy() = { for (_ <- g()) { (null: Any) match { diff --git a/test/files/pos/t4853.scala b/test/files/pos/t4853.scala index ed9b320434..c91f2d6b05 100644 --- a/test/files/pos/t4853.scala +++ b/test/files/pos/t4853.scala @@ -3,7 +3,7 @@ object Animal { } class Animal[A <: AwakeOrAsleep] { - def goToSleep[B >: A <: Awake]: Animal[Asleep] = new Animal[Asleep] + def goToSleep[B >: A <: Awake]: Animal[Asleep] = new Animal[Asleep] def wakeUp[B >: A <: Asleep]: Animal[Awake] = new Animal[Awake] } diff --git a/test/files/pos/t5031_2.scala b/test/files/pos/t5031_2.scala index ded3e82301..e51215db84 100644 --- a/test/files/pos/t5031_2.scala +++ b/test/files/pos/t5031_2.scala @@ -1,4 +1,4 @@ -package object t5031 { +package object t5031 { class ID } diff --git a/test/files/pos/t5120.scala b/test/files/pos/t5120.scala index 2c193d129d..6731af14e4 100644 --- a/test/files/pos/t5120.scala +++ b/test/files/pos/t5120.scala @@ -1,12 +1,12 @@ -// An example extracted from SBT by Iulian -// that showed that the previous fix to t5120 +// An example extracted from SBT by Iulian +// that showed that the previous fix to t5120 // was too strict. class Test { class ScopedKey[T] class Value[T] class Compiled[T](val settings: Seq[Pair[T]]) - + case class Pair[T](k: ScopedKey[T], v: ScopedKey[T]) def transform[T](x: T) = x diff --git a/test/files/pos/t5127.scala b/test/files/pos/t5127.scala index e90b8d00a0..c562025302 100644 --- a/test/files/pos/t5127.scala +++ b/test/files/pos/t5127.scala @@ -4,5 +4,5 @@ package foo { class Parametrized1[T] extends Abstract1[Parametrized2[T]] { def bar(a: AnyRef) { a match { case d: Parametrized1[_] => println("ok") } } } - class Parametrized2[T] extends Parametrized1[T] with Abstract2[Parametrized2[T]] + class Parametrized2[T] extends Parametrized1[T] with Abstract2[Parametrized2[T]] } diff --git a/test/files/pos/t5156.scala b/test/files/pos/t5156.scala index e7912ef35c..52412ad4c1 100644 --- a/test/files/pos/t5156.scala +++ b/test/files/pos/t5156.scala @@ -1,6 +1,6 @@ sealed trait HList -final case class HCons[H, T <: HList](head : H, tail : T) extends HList -case object HNil extends HList +final case class HCons[H, T <: HList](head : H, tail : T) extends HList +case object HNil extends HList object HList { type ::[H, T <: HList] = HCons[H, T] diff --git a/test/files/pos/t516.scala b/test/files/pos/t516.scala index 735b259436..5561b7610c 100644 --- a/test/files/pos/t516.scala +++ b/test/files/pos/t516.scala @@ -4,7 +4,7 @@ import scala.collection.script._; class Members; object subscriber extends Subscriber[Message[String] with Undoable, Members] { - def notify(pub: Members, event: Message[String] with Undoable): Unit = + def notify(pub: Members, event: Message[String] with Undoable): Unit = (event: Message[String]) match { case Include(l, elem) => Console.println("ADD: " + elem); case Remove(l, elem) => Console.println("REM: " + elem); @@ -12,4 +12,3 @@ object subscriber extends Subscriber[Message[String] with Undoable, Members] { //case r : Remove [HasTree] with Undoable => } } - diff --git a/test/files/pos/t5178.scala b/test/files/pos/t5178.scala index 26c008d66f..ed0f814ec5 100644 --- a/test/files/pos/t5178.scala +++ b/test/files/pos/t5178.scala @@ -4,7 +4,7 @@ abstract class FileOps { trait DefaultFileOps { self: DefaultPath => - + override def withLock[R](start: Long = 5): Option[R] = None } diff --git a/test/files/pos/t5240.scala b/test/files/pos/t5240.scala index 2db689c27d..065d175f2f 100644 --- a/test/files/pos/t5240.scala +++ b/test/files/pos/t5240.scala @@ -5,7 +5,7 @@ package object foo { - + var labels: Array[_ <: String] = null - + } diff --git a/test/files/pos/t5317.scala b/test/files/pos/t5317.scala index 8c9c9d8222..052e84438c 100644 --- a/test/files/pos/t5317.scala +++ b/test/files/pos/t5317.scala @@ -2,11 +2,11 @@ object Test { trait S { type T; val x: AnyRef } trait A extends S { type T <: A; val x: A = null } trait B extends S { type T <: B; val x: B = null } - + val a = new A{} val b = new B{} val y = if (true) a else b - + // lub of y should allow for this println(y.x.x) } diff --git a/test/files/pos/t5541.scala b/test/files/pos/t5541.scala index 39682a2fff..90e5e4130b 100644 --- a/test/files/pos/t5541.scala +++ b/test/files/pos/t5541.scala @@ -27,7 +27,7 @@ object HASkipList { def asBranch : Branch[ S, A ] = this } } -sealed trait HASkipList[ S <: Sys[ S ], @specialized( Int ) A ] +sealed trait HASkipList[ S <: Sys[ S ], @specialized( Int ) A ] class HASkipListView[ S <: Sys[ S ], A ]( private val l: HASkipList[ S, A ])( implicit system: S ) { import HASkipList.Node diff --git a/test/files/pos/t5639/Foo.scala b/test/files/pos/t5639/Foo.scala index 6602150661..1a07734a8e 100644 --- a/test/files/pos/t5639/Foo.scala +++ b/test/files/pos/t5639/Foo.scala @@ -1,6 +1,6 @@ package pack.age -class Baz +class Baz object Implicits { implicit def Baz(n: Int): Baz = new Baz diff --git a/test/files/pos/t573.scala b/test/files/pos/t573.scala index 7b9d377cd1..694d001e3c 100644 --- a/test/files/pos/t573.scala +++ b/test/files/pos/t573.scala @@ -16,15 +16,15 @@ import DirX._; abstract class Linked { type Node <: Node0; - + abstract class Node0 { self: Node => - + var next : Node = _; var prev : Node = _; - + def get(dir : Dir) = if (dir == BEFORE) prev; else next; - private def set(dir : Dir, node : Node) = + private def set(dir : Dir, node : Node) = if (dir == BEFORE) prev = node; else next = node; def link(dir : Dir, node : Node) = { @@ -34,7 +34,7 @@ abstract class Linked { node.set(dir.reverse, self); } - + def end(dir : Dir) : Node = { if (get(dir) == null) this; else get(dir).end(dir); diff --git a/test/files/pos/t577.scala b/test/files/pos/t577.scala index 236c1395e2..ede45399a0 100644 --- a/test/files/pos/t577.scala +++ b/test/files/pos/t577.scala @@ -1,15 +1,15 @@ trait PriorityTree { type Node <: BasicTreeNode; - + val top = initTree; top.next = (initTree); top.next.prev = (top); - + def initTree : Node; - - - + + + trait BasicTreeNode { private[PriorityTree] var next : Node = _; private[PriorityTree] var prev : Node = _; diff --git a/test/files/pos/t5846.scala b/test/files/pos/t5846.scala index b06f5ac39c..05cabed6a0 100644 --- a/test/files/pos/t5846.scala +++ b/test/files/pos/t5846.scala @@ -4,7 +4,7 @@ /** Return the most general sorted map type. */ object Test extends App { - + val empty: collection.SortedMap[String, String] = collection.SortedMap.empty[String, String] - + } diff --git a/test/files/pos/t5853.scala b/test/files/pos/t5853.scala index 21d80206ab..2ebb6667dc 100644 --- a/test/files/pos/t5853.scala +++ b/test/files/pos/t5853.scala @@ -41,7 +41,7 @@ object Arrow { implicit final class ArrowAssoc[A](val __leftOfArrow: A) extends AnyVal { @inline def ->>[B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y) } - + def foo = 1 ->> 2 } @@ -50,6 +50,6 @@ object SpecArrow { implicit final class ArrowAssoc[A](val __leftOfArrow: A) extends AnyVal { @inline def ->> [@specialized(Int) B](y: B): Tuple2[A, B] = Tuple2(__leftOfArrow, y) } - + def foo = 1 ->> 2 } diff --git a/test/files/pos/t599.scala b/test/files/pos/t599.scala index 53f205a26b..968e2deaee 100644 --- a/test/files/pos/t599.scala +++ b/test/files/pos/t599.scala @@ -16,4 +16,4 @@ abstract class FooA { val aaa: InnerB.this.B = doB aaa.xxx; } - } + } diff --git a/test/files/pos/t602.scala b/test/files/pos/t602.scala index 6062b976b6..18dd405645 100644 --- a/test/files/pos/t602.scala +++ b/test/files/pos/t602.scala @@ -10,5 +10,5 @@ case class Span[K <: Ordered[K]](low: Option[K], high: Option[K]) extends Functi case Span(Some(low), None) => (k >= low) case Span(None, Some(high)) => (k <= high) case _ => false - } + } } diff --git a/test/files/pos/t613.scala b/test/files/pos/t613.scala index 6e3841dada..e140833106 100644 --- a/test/files/pos/t613.scala +++ b/test/files/pos/t613.scala @@ -3,9 +3,9 @@ class Outer extends App { abstract class C { val x: Int } - val foo = new C { + val foo = new C { class I { - val z = y + val z = y } val x = (new I).z } diff --git a/test/files/pos/t616.scala b/test/files/pos/t616.scala index 074ad190da..bb91c732a6 100644 --- a/test/files/pos/t616.scala +++ b/test/files/pos/t616.scala @@ -1,7 +1,7 @@ object testImplicit { implicit def foo2bar(foo: Foo): Bar = foo.bar class Foo(val bar: Bar) { - def testCoercion = {val a = this; a.baz} // here, foo2bar is inferred by the compiler, as expected + def testCoercion = {val a = this; a.baz} // here, foo2bar is inferred by the compiler, as expected //def testCoercionThisImplicit = baz // --> error: not found: value baz def testCoercionThisExplicit: Any = this.baz // --> error: value baz is not a member of Foo } diff --git a/test/files/pos/t6210.scala b/test/files/pos/t6210.scala index 1ce8493872..855c621b8e 100644 --- a/test/files/pos/t6210.scala +++ b/test/files/pos/t6210.scala @@ -10,9 +10,9 @@ case class TBool() extends Ty object Foo { def checkExpr(ast: AExpr): Ty = { var astTy:Ty = ast match { - case AAssign(nm: String, v:AExpr) => TBool() + case AAssign(nm: String, v:AExpr) => TBool() - case AConstBool(v: Boolean) => TBool() + case AConstBool(v: Boolean) => TBool() case _ => throw new Exception(s"Unhandled case check(ast: ${ast.getClass})") } diff --git a/test/files/pos/t651.scala b/test/files/pos/t651.scala index 44d20ad580..c146446af9 100644 --- a/test/files/pos/t651.scala +++ b/test/files/pos/t651.scala @@ -4,12 +4,12 @@ trait Test3 { trait MatchableImpl { trait MatchImpl; } - + trait BracePairImpl { trait BraceImpl extends MatchableImpl { private object MyMatch1 extends MatchImpl; protected def match0 : MatchImpl = MyMatch1; - + } } } diff --git a/test/files/pos/t6624.scala b/test/files/pos/t6624.scala index 1a92b92d53..44554c59c7 100644 --- a/test/files/pos/t6624.scala +++ b/test/files/pos/t6624.scala @@ -10,7 +10,7 @@ object Test { val klist: KCons[Option, KCons[Option, KCons[Option, KNil[Nothing]]]] = ??? // crashes with - // "Exception in thread "main" scala.reflect.internal.Types$TypeError: value _1 is not a member + // "Exception in thread "main" scala.reflect.internal.Types$TypeError: value _1 is not a member // of KCons[Option,KCons[Option,KNil[Nothing]]]" klist match { case KCons(KCons(KCons(_))) => diff --git a/test/files/pos/t675.scala b/test/files/pos/t675.scala index c284c0e202..905d29d44a 100644 --- a/test/files/pos/t675.scala +++ b/test/files/pos/t675.scala @@ -7,7 +7,7 @@ trait T { } trait X { def foo : Foo = FOO_0; - } + } } object Test extends App { @@ -15,5 +15,3 @@ object Test extends App { val x = new t.X{} Console.println(x.foo) } - - diff --git a/test/files/pos/t690.scala b/test/files/pos/t690.scala index 3fcdca785d..a93c54f007 100644 --- a/test/files/pos/t690.scala +++ b/test/files/pos/t690.scala @@ -10,5 +10,5 @@ trait test { override def foo(t : T) = super.foo(t); } def t : T; - M0.foo(t); + M0.foo(t); } diff --git a/test/files/pos/t6963c.scala b/test/files/pos/t6963c.scala index 0b6b5c757f..d3c3616eb2 100644 --- a/test/files/pos/t6963c.scala +++ b/test/files/pos/t6963c.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/pos/t6976/ImplicitBug_1.scala b/test/files/pos/t6976/ImplicitBug_1.scala index c9031bab2e..50bc247acc 100644 --- a/test/files/pos/t6976/ImplicitBug_1.scala +++ b/test/files/pos/t6976/ImplicitBug_1.scala @@ -1,4 +1,4 @@ -// This one is weird and nasty. Not sure if this is scalac or sbt +// This one is weird and nasty. Not sure if this is scalac or sbt // (tried with 0.12 & 0.12.2-RC2) bug. // // A level of indirection is required to trigger this bug. @@ -11,12 +11,12 @@ // 4. sbt run (it fails) // 5. Switch it back & sbt run. It still fails. // -// In this project sbt clean helps. However in a large project where this +// In this project sbt clean helps. However in a large project where this // bug was found compiler crashed even after doing sbt clean. The only -// way to work around this was to reference Exts object explicitly (C) in +// way to work around this was to reference Exts object explicitly (C) in // the source file using its implicit classes. -// Lets suppose this is a mega-trait combining all sorts of helper +// Lets suppose this is a mega-trait combining all sorts of helper // functionality. trait Support extends Exts diff --git a/test/files/pos/t7014/t7014.scala b/test/files/pos/t7014/t7014.scala index faec4c7740..7c73f700be 100644 --- a/test/files/pos/t7014/t7014.scala +++ b/test/files/pos/t7014/t7014.scala @@ -1,4 +1,3 @@ package t7014 import ThreadSafetyLevel.COMPLETELY_THREADSAFE // refer to annotation so it gets parsed -
\ No newline at end of file diff --git a/test/files/pos/t711.scala b/test/files/pos/t711.scala index 10b410e54e..4dd6040969 100644 --- a/test/files/pos/t711.scala +++ b/test/files/pos/t711.scala @@ -2,7 +2,7 @@ abstract class Component class Button extends Component { def sayHey: Unit = Console.println("Hey, I'm a button") } - + abstract class Origin { val delegate: Component } diff --git a/test/files/pos/t7264/B_2.scala b/test/files/pos/t7264/B_2.scala index 869c51481d..a8af2e727e 100644 --- a/test/files/pos/t7264/B_2.scala +++ b/test/files/pos/t7264/B_2.scala @@ -1,7 +1,7 @@ object Test { // if the following line is uncommented, things compile // type X = Foo.Values - + def foo(f: Foo) = f.bar(0 /* : Foo.Values */) } diff --git a/test/files/pos/t757.scala b/test/files/pos/t757.scala index 7513910d8d..fd7624cee7 100644 --- a/test/files/pos/t757.scala +++ b/test/files/pos/t757.scala @@ -1,4 +1,4 @@ -package foo { +package foo { object C { def foo { Console.println("foo") @@ -6,7 +6,7 @@ package foo { } } -package bar { +package bar { object Main extends App { foo.C.foo } diff --git a/test/files/pos/t758.scala b/test/files/pos/t758.scala index 44769d54f1..160bf37172 100644 --- a/test/files/pos/t758.scala +++ b/test/files/pos/t758.scala @@ -1,7 +1,7 @@ trait A { type T; type M >: T } -trait B extends A { - val x : String; - val u : A { type T = B.this.T } ; - type T = x.type; - type M = u.M +trait B extends A { + val x : String; + val u : A { type T = B.this.T } ; + type T = x.type; + type M = u.M } diff --git a/test/files/pos/t767.scala b/test/files/pos/t767.scala index d4d7eae870..0c4067f022 100644 --- a/test/files/pos/t767.scala +++ b/test/files/pos/t767.scala @@ -4,7 +4,7 @@ abstract class AbsCell { private var value: T = init def get: T = value def set (x: T) { value = x } - + class Node { val foo = 1 } diff --git a/test/files/pos/t788.scala b/test/files/pos/t788.scala index 3da88a2d26..19638dd170 100644 --- a/test/files/pos/t788.scala +++ b/test/files/pos/t788.scala @@ -4,7 +4,7 @@ trait Test { type Node <: NodeImpl; trait NodeImpl; type Expression <: Node with ExpressionImpl; - trait ExpressionImpl extends NodeImpl { + trait ExpressionImpl extends NodeImpl { def self : Expression; } type Named <: Node with NamedImpl; diff --git a/test/files/pos/t802.scala b/test/files/pos/t802.scala index 124d4915bc..2dea7036d6 100644 --- a/test/files/pos/t802.scala +++ b/test/files/pos/t802.scala @@ -1,17 +1,17 @@ package test; trait Test { - abstract class BracesImpl { + abstract class BracesImpl { type Singleton; type Brace <: Singleton with BraceImpl; - trait BraceImpl; + trait BraceImpl; trait ForFile; } - abstract class ParensImpl extends BracesImpl { + abstract class ParensImpl extends BracesImpl { type Brace <: Singleton with BraceImpl; trait BraceImpl extends super.BraceImpl; } val parens : ParensImpl; - abstract class BracksImpl extends BracesImpl { + abstract class BracksImpl extends BracesImpl { type Brace <: Singleton with BraceImpl; trait BraceImpl extends super.BraceImpl; } diff --git a/test/files/pos/t807.scala b/test/files/pos/t807.scala index ed73fe3f97..0eeb92ea24 100644 --- a/test/files/pos/t807.scala +++ b/test/files/pos/t807.scala @@ -6,7 +6,7 @@ trait Matcher { trait HasLinks { def link(b : Boolean) : Link = null; } - + } trait BraceMatcher extends Matcher { trait BracePair { diff --git a/test/files/pos/t927.scala b/test/files/pos/t927.scala index 534f355045..c903f19867 100644 --- a/test/files/pos/t927.scala +++ b/test/files/pos/t927.scala @@ -7,5 +7,5 @@ object Test { } val str: Stream[Int] = List(1,2,3).iterator.toStream assert(sum(str) == 6) - + } diff --git a/test/files/pos/t946.scala b/test/files/pos/t946.scala index 9f4cdbc043..c4bd6e9ba4 100644 --- a/test/files/pos/t946.scala +++ b/test/files/pos/t946.scala @@ -1,7 +1,7 @@ object pmbugbounds { trait Bar class Foo[t <: Bar] {} - + (new Foo[Bar]) match { case _ : Foo[x] => null } diff --git a/test/files/pos/tcpoly_bounds1.scala b/test/files/pos/tcpoly_bounds1.scala index 142c0b7b7f..5874cc664d 100644 --- a/test/files/pos/tcpoly_bounds1.scala +++ b/test/files/pos/tcpoly_bounds1.scala @@ -1,6 +1,6 @@ -class Foo[t[x]<: Pair[Int, x]] +class Foo[t[x]<: Pair[Int, x]] -// +// class MyPair[z](a: Int, b: z) extends Pair[Int, z](a,b) object foo extends Foo[MyPair] diff --git a/test/files/pos/tcpoly_checkkinds_mix.scala b/test/files/pos/tcpoly_checkkinds_mix.scala index 2d265da6b9..3734405f8b 100644 --- a/test/files/pos/tcpoly_checkkinds_mix.scala +++ b/test/files/pos/tcpoly_checkkinds_mix.scala @@ -2,9 +2,9 @@ trait Iterable[A <: Bound[A], Bound[_]] { type MyType[x <: Bound[x]] <: Iterable[x, Bound] def map[B <: Bound[B]](f: A => B): MyType[B] def flatMap[B <: Bound[B]](f: A => MyType[B]): MyType[B] - def filter(p: A => Boolean): MyType[A] + def filter(p: A => Boolean): MyType[A] } -trait OrderedSet[T <: Ordered[T]] extends Iterable[T, Ordered] { +trait OrderedSet[T <: Ordered[T]] extends Iterable[T, Ordered] { type MyType[x <: Ordered[x]] = OrderedSet[x] -} +} diff --git a/test/files/pos/tcpoly_gm.scala b/test/files/pos/tcpoly_gm.scala index ecaeef9679..89b66cfba6 100644 --- a/test/files/pos/tcpoly_gm.scala +++ b/test/files/pos/tcpoly_gm.scala @@ -1,4 +1,4 @@ -trait Rep[a] { +trait Rep[a] { def rep[m[x]]: m[a] // typedTypeApply must use asSeenFrom to adapt the return type // since rep is called on x: Rep[t] // a must become t @@ -9,7 +9,6 @@ case class ShowBin[b](app: b => String) object foo { def showBin[t](x: Rep[t], y: t): String = { val r: ShowBin[t] = x.rep[ShowBin] - r.app(y) + r.app(y) } } - diff --git a/test/files/pos/tcpoly_higherorder_bound_method.scala b/test/files/pos/tcpoly_higherorder_bound_method.scala index 090bb8fcf3..3905b3b96d 100644 --- a/test/files/pos/tcpoly_higherorder_bound_method.scala +++ b/test/files/pos/tcpoly_higherorder_bound_method.scala @@ -1,3 +1,3 @@ trait SkolemisationOfHigherOrderBoundInMethod { def method[A, N[X <: A], M[X <: N[A]]]: Unit -} +} diff --git a/test/files/pos/tcpoly_late_method_params.scala b/test/files/pos/tcpoly_late_method_params.scala index c9298918a0..e2f0bcffb3 100644 --- a/test/files/pos/tcpoly_late_method_params.scala +++ b/test/files/pos/tcpoly_late_method_params.scala @@ -1,5 +1,5 @@ trait Foo { - def flatMap[RT <: RBound[RT], RBound[_], Result[x <: RBound[x]]]: Result[RT] + def flatMap[RT <: RBound[RT], RBound[_], Result[x <: RBound[x]]]: Result[RT] // bounds for RT& = >: scala.this.Nothing <: RBound&[RT&] // bounds for x = >: scala.this.Nothing <: RBound&[x] } diff --git a/test/files/pos/tcpoly_method.scala b/test/files/pos/tcpoly_method.scala index 80dc0482fd..294b53b915 100644 --- a/test/files/pos/tcpoly_method.scala +++ b/test/files/pos/tcpoly_method.scala @@ -1,6 +1,6 @@ trait Iterable[m[+x], +t] { def flatMap[resColl[+x] <: Iterable[resColl, x], s](f: t => resColl[s]): resColl[s] - + def foo[a[x]] = "a" val x = foo[List] } diff --git a/test/files/pos/tcpoly_poly.scala b/test/files/pos/tcpoly_poly.scala index 50ffc7837f..1ba04e29df 100644 --- a/test/files/pos/tcpoly_poly.scala +++ b/test/files/pos/tcpoly_poly.scala @@ -1,3 +1,3 @@ -class Monad[m[x]] +class Monad[m[x]] object ml extends Monad[List] diff --git a/test/files/pos/tcpoly_return_overriding.scala b/test/files/pos/tcpoly_return_overriding.scala index 0814e73fa4..57ec8da76c 100644 --- a/test/files/pos/tcpoly_return_overriding.scala +++ b/test/files/pos/tcpoly_return_overriding.scala @@ -2,7 +2,7 @@ trait Generic[g[x]] { def unit: g[Unit] } -trait Rep[t] { +trait Rep[t] { def rep[m[x]](implicit gen: Generic[m]): m[t] } diff --git a/test/files/pos/tcpoly_seq.scala b/test/files/pos/tcpoly_seq.scala index b5f46f6b6b..48b3e1ce52 100644 --- a/test/files/pos/tcpoly_seq.scala +++ b/test/files/pos/tcpoly_seq.scala @@ -6,40 +6,40 @@ trait HOSeq { // values implementing this interface, in order to provide more performant ways of building that structure trait Accumulator[+coll[x], elT] { def += (el: elT): Unit - def result: coll[elT] + def result: coll[elT] } - - + + // Iterable abstracts over the type of its structure as well as its elements (see PolyP's Bifunctor) - // m[x] is intentionally unbounded: fold can then be defined nicely - // variance: if we write m[+x] instead of +m[+x], x is an invariant position because its enclosing type + // m[x] is intentionally unbounded: fold can then be defined nicely + // variance: if we write m[+x] instead of +m[+x], x is an invariant position because its enclosing type // is an invariant position -- should probably rule that out? trait Iterable[+m[+x], +t] { //def unit[a](orig: a): m[a] def iterator: Iterator[t] - + // construct an empty accumulator that will produce the same structure as this iterable, with elements of type t def accumulator[t]: Accumulator[m, t] - + def filter(p: t => Boolean): m[t] = { val buf = accumulator[t] val elems = iterator while (elems.hasNext) { val x = elems.next; if (p(x)) buf += x } buf.result } - + def map[s](f: t => s): m[s] = { val buf = accumulator[s] val elems = iterator while (elems.hasNext) buf += f(elems.next) buf.result } - + // flatMap is a more specialized map, it only works if the mapped function produces Iterable values, // which are then added to the result one by one // the compiler should be able to find the right accumulator (implicit buf) to build the result // to get concat, resColl = SingletonIterable, f = unit for SingletonIterable - def flatMap[resColl[+x] <: Iterable[resColl, x], s](f: t => resColl[s])(implicit buf: Accumulator[resColl, s]): resColl[s] = { + def flatMap[resColl[+x] <: Iterable[resColl, x], s](f: t => resColl[s])(implicit buf: Accumulator[resColl, s]): resColl[s] = { // TODO: would a viewbound for resColl[x] be better? // -- 2nd-order type params are not yet in scope in view bound val elems = iterator @@ -48,9 +48,9 @@ trait HOSeq { while (elemss.hasNext) buf += elemss.next } buf.result - } + } } - + final class ListBuffer[A] { private var start: List[A] = Nil private var last: ::[A] = _ @@ -78,7 +78,7 @@ trait HOSeq { exported = !start.isEmpty start } - + /** Clears the buffer contents. */ def clear { @@ -97,13 +97,13 @@ trait HOSeq { } } } - + implicit def listAccumulator[elT]: Accumulator[List, elT] = new Accumulator[List, elT] { private[this] val buff = new ListBuffer[elT] def += (el: elT): Unit = buff += el def result: List[elT] = buff.toList } - + trait List[+t] extends Iterable[List, t] { def head: t def tail: List[t] @@ -121,14 +121,14 @@ trait HOSeq { // construct an empty accumulator that will produce the same structure as this iterable, with elements of type t def accumulator[t]: Accumulator[List, t] = listAccumulator[t] } - + // TODO: the var tl approach does not seem to work because subtyping isn't fully working yet final case class ::[+b](hd: b, private val tl: List[b]) extends List[b] { def head = hd def tail = if(tl==null) this else tl // hack override def isEmpty: Boolean = false } - + case object Nil extends List[Nothing] { def isEmpty = true def head: Nothing = @@ -157,18 +157,18 @@ trait HOSeq { def filter(f: T=>Boolean): FilterResult def subseq(from: Int, to: Int): Subseq def flatMap[S <: Seq[K], K](f: T => S): S#Concat // legal? - def concat(others: Seq[T]): Concat + def concat(others: Seq[T]): Concat */ - + /*trait Iterator[t] { // @post hasAdvanced implies hasNext // model def hasAdvanced: Boolean - + def hasNext: Boolean // pure - + // @pre hasAdvanced def current: t // pure - + // @pre hasNext // @post hasAdvanced def advance: Unit diff --git a/test/files/pos/tcpoly_seq_typealias.scala b/test/files/pos/tcpoly_seq_typealias.scala index 0651ad9760..fb48126ce6 100644 --- a/test/files/pos/tcpoly_seq_typealias.scala +++ b/test/files/pos/tcpoly_seq_typealias.scala @@ -6,42 +6,42 @@ trait HOSeq { // values implementing this interface, in order to provide more performant ways of building that structure trait Accumulator[+coll[x], elT] { def += (el: elT): Unit - def result: coll[elT] + def result: coll[elT] } - - + + // Iterable abstracts over the type of its structure as well as its elements (see PolyP's Bifunctor) - // m[x] is intentionally unbounded: fold can then be defined nicely - // variance: if we write m[+x] instead of +m[+x], x is an invariant position because its enclosing type + // m[x] is intentionally unbounded: fold can then be defined nicely + // variance: if we write m[+x] instead of +m[+x], x is an invariant position because its enclosing type // is an invariant position -- should probably rule that out? trait Iterable[+t] { - type m[+x] - + type m[+x] + //def unit[a](orig: a): m[a] def iterator: Iterator[t] - + // construct an empty accumulator that will produce the same structure as this iterable, with elements of type t def accumulator[t]: Accumulator[m, t] - + def filter(p: t => Boolean): m[t] = { val buf = accumulator[t] val elems = iterator while (elems.hasNext) { val x = elems.next; if (p(x)) buf += x } buf.result } - + def map[s](f: t => s): m[s] = { val buf = accumulator[s] val elems = iterator while (elems.hasNext) buf += f(elems.next) buf.result } - + // flatMap is a more specialized map, it only works if the mapped function produces Iterable values, // which are then added to the result one by one // the compiler should be able to find the right accumulator (implicit buf) to build the result // to get concat, resColl = SingletonIterable, f = unit for SingletonIterable - def flatMap[resColl[+x] <: Iterable[x], s](f: t => resColl[s])(implicit buf: Accumulator[resColl, s]): resColl[s] = { + def flatMap[resColl[+x] <: Iterable[x], s](f: t => resColl[s])(implicit buf: Accumulator[resColl, s]): resColl[s] = { // TODO: would a viewbound for resColl[x] be better? // -- 2nd-order type params are not yet in scope in view bound val elems = iterator @@ -50,9 +50,9 @@ trait HOSeq { while (elemss.hasNext) buf += elemss.next } buf.result - } + } } - + final class ListBuffer[A] { private var start: List[A] = Nil private var last: ::[A] = _ @@ -80,7 +80,7 @@ trait HOSeq { exported = !start.isEmpty start } - + /** Clears the buffer contents. */ def clear { @@ -99,16 +99,16 @@ trait HOSeq { } } } - + implicit def listAccumulator[elT]: Accumulator[List, elT] = new Accumulator[List, elT] { private[this] val buff = new ListBuffer[elT] def += (el: elT): Unit = buff += el def result: List[elT] = buff.toList } - + trait List[+t] extends Iterable[t] { type m[+x] = List[x] - + def head: t def tail: List[t] def isEmpty: Boolean @@ -125,14 +125,14 @@ trait HOSeq { // construct an empty accumulator that will produce the same structure as this iterable, with elements of type t def accumulator[t]: Accumulator[List, t] = listAccumulator[t] } - + // TODO: the var tl approach does not seem to work because subtyping isn't fully working yet final case class ::[+b](hd: b, private val tl: List[b]) extends List[b] { def head = hd def tail = if(tl==null) this else tl // hack override def isEmpty: Boolean = false } - + case object Nil extends List[Nothing] { def isEmpty = true def head: Nothing = diff --git a/test/files/pos/ted.scala b/test/files/pos/ted.scala index d8ae64f29b..314f109328 100644 --- a/test/files/pos/ted.scala +++ b/test/files/pos/ted.scala @@ -9,7 +9,7 @@ object App case (b, e) => b * exponentiate(b, e - 1) } - + def main(args : Array[String]) = System.out.println(exponentiate(2, 2)) diff --git a/test/files/pos/test5.scala b/test/files/pos/test5.scala index b04de5d613..4dbafc9ac3 100644 --- a/test/files/pos/test5.scala +++ b/test/files/pos/test5.scala @@ -53,7 +53,7 @@ object test { // Check type j.P j.chk_ip(val_mp); - j.chk_ip(val_np); + j.chk_ip(val_np); // Check type i.X i.chk_ix(i.val_ix); @@ -63,6 +63,6 @@ object test { // Check j.X j.chk_ix(j.val_ix); j.chk_ix(j.val_jx); - j.chk_ix(val_njx); + j.chk_ix(val_njx); } } diff --git a/test/files/pos/test5refine.scala b/test/files/pos/test5refine.scala index 290449c3ed..5459b3b975 100644 --- a/test/files/pos/test5refine.scala +++ b/test/files/pos/test5refine.scala @@ -60,7 +60,7 @@ object test { // Check type j.P j.chk_ip(val_mp); - j.chk_ip(val_np); + j.chk_ip(val_np); // Check type i.X i.chk_ix(i.val_ix); @@ -70,6 +70,6 @@ object test { // Check j.X j.chk_ix(j.val_ix); j.chk_ix(j.val_jx); - j.chk_ix(val_njx); + j.chk_ix(val_njx); } } diff --git a/test/files/pos/testCoercionThis.scala b/test/files/pos/testCoercionThis.scala index 8bbfdcd684..5631b33306 100644 --- a/test/files/pos/testCoercionThis.scala +++ b/test/files/pos/testCoercionThis.scala @@ -11,9 +11,9 @@ object Test { // PP: is that something we really want to work? Seems like sketchville. // // These work, so I moved this out of pending. - def testCoercionThis1 = this.baz + def testCoercionThis1 = this.baz def testCoercionThis2 = (this: Foo).baz } - - class Bar { def baz = System.out.println("baz") } + + class Bar { def baz = System.out.println("baz") } } diff --git a/test/files/pos/thistypes.scala b/test/files/pos/thistypes.scala index 26339e07c4..7319cc1ecb 100644 --- a/test/files/pos/thistypes.scala +++ b/test/files/pos/thistypes.scala @@ -5,4 +5,4 @@ trait B { trait C extends B { def foo: C.this.I; -} +} diff --git a/test/files/pos/ticket0137.scala b/test/files/pos/ticket0137.scala index 72f955fe5e..94ef8e49fc 100644 --- a/test/files/pos/ticket0137.scala +++ b/test/files/pos/ticket0137.scala @@ -1,7 +1,7 @@ -trait AbsM { - abstract class MonadCompanion[M[_]] +trait AbsM { + abstract class MonadCompanion[M[_]] abstract class AbsMonadCompanion extends MonadCompanion[AM] { - def newTag: Int + def newTag: Int } type AM[_] // to trigger the bug, this must be an abstract type member that comes after the reference to it diff --git a/test/files/pos/trait-force-info.scala b/test/files/pos/trait-force-info.scala index e01d225c84..c2b33869c3 100644 --- a/test/files/pos/trait-force-info.scala +++ b/test/files/pos/trait-force-info.scala @@ -8,7 +8,7 @@ trait MyContextTrees { val self: Global val NoContext = self.analyzer.NoContext } -// +// // error: java.lang.AssertionError: assertion failed: trait Contexts.NoContext$ linkedModule: <none>List() // at scala.Predef$.assert(Predef.scala:160) // at scala.tools.nsc.symtab.classfile.ClassfileParser$innerClasses$.innerSymbol$1(ClassfileParser.scala:1211) diff --git a/test/files/pos/trait-parents.scala b/test/files/pos/trait-parents.scala index f6a2688751..c5908cdcd9 100644 --- a/test/files/pos/trait-parents.scala +++ b/test/files/pos/trait-parents.scala @@ -6,11 +6,11 @@ trait Quux object Test { def f(x: Bip) = 1 def g1(x: Foo with Bip) = f(x) - + def main(args: Array[String]): Unit = { - f(new Bip with Foo { }) + f(new Bip with Foo { }) f(new Foo with Bip { }) - g1(new Bip with Foo { }) + g1(new Bip with Foo { }) g1(new Foo with Bip { }) } } diff --git a/test/files/pos/traits.scala b/test/files/pos/traits.scala index bd64d7215a..3c6f9437a5 100644 --- a/test/files/pos/traits.scala +++ b/test/files/pos/traits.scala @@ -20,8 +20,8 @@ object Test { trait BorderedColoredShape extends Shape with Bordered with Colored { override def equals(other: Any) = other match { case that: BorderedColoredShape => ( - super.equals(that) && - super[Bordered].equals(that) && + super.equals(that) && + super[Bordered].equals(that) && super[Colored].equals(that)) case _ => false } diff --git a/test/files/pos/typealiases.scala b/test/files/pos/typealiases.scala index 5974921ed3..d03b521f77 100644 --- a/test/files/pos/typealiases.scala +++ b/test/files/pos/typealiases.scala @@ -3,18 +3,18 @@ package foo trait Test[T] { type Check[T] = Array[T] => Unit; type MyPair[S] = (T, S) - + val pair1: (T, Int) val pair: MyPair[Int] = pair1 - + def check(xs: Array[T], c: Check[T]) = c(xs) - def check2[S](xs: Array[S], c: Check[S]) = c(xs) -} + def check2[S](xs: Array[S], c: Check[S]) = c(xs) +} -object main extends Test[Int] { - val pair1 = (1,1) +object main extends Test[Int] { + val pair1 = (1,1) implicit def topair(x: Int): Pair[Int, Int] = (x,x) - val pair2: MyPair[Int] = 1 + val pair2: MyPair[Int] = 1 val x: Short = 1 } diff --git a/test/files/pos/unapplyNeedsMemberType.scala b/test/files/pos/unapplyNeedsMemberType.scala index 2581512a7b..b423257e04 100644 --- a/test/files/pos/unapplyNeedsMemberType.scala +++ b/test/files/pos/unapplyNeedsMemberType.scala @@ -8,7 +8,7 @@ trait Gunk[a] { def unapply(s: Seq) = unapply_Cons(s) } def unapply_Cons(s: Any): Option[Tuple2[a, Seq]] -} +} class Join[a] extends Gunk[a] { type Seq = JoinSeq diff --git a/test/files/pos/unapplySeq.scala b/test/files/pos/unapplySeq.scala index 4d5409c6f7..6d13cc8b52 100644 --- a/test/files/pos/unapplySeq.scala +++ b/test/files/pos/unapplySeq.scala @@ -4,7 +4,7 @@ object FooSeq { val y = x.asInstanceOf[Bar] Some(y.size, y.name) } else None - } + } def main(args:Array[String]) = { val b = new Bar diff --git a/test/files/pos/unapplyVal.scala b/test/files/pos/unapplyVal.scala index 0d6394a90f..368b9b9375 100644 --- a/test/files/pos/unapplyVal.scala +++ b/test/files/pos/unapplyVal.scala @@ -10,7 +10,7 @@ class Buffer { def joinPat(x: Any): Unit = { x match { - case Put => + case Put => case Put(y) => println("returning "+y) } @@ -29,7 +29,7 @@ object unapplyJoins extends App { // bug #1257 object Get extends Sync val jp: PartialFunction[Any, Any] = { - case Get() => + case Get() => } } diff --git a/test/files/pos/virtpatmat_castbinder.scala b/test/files/pos/virtpatmat_castbinder.scala index 53e937e866..be269638ce 100644 --- a/test/files/pos/virtpatmat_castbinder.scala +++ b/test/files/pos/virtpatmat_castbinder.scala @@ -6,7 +6,7 @@ trait IntMapIterator[V, T] { def valueOf(tip: Tip[V]): T def pop: IntMap[V] - def next: T = + def next: T = pop match { case Bin(t@Tip(_)) => { valueOf(t) diff --git a/test/files/pos/virtpatmat_exist1.scala b/test/files/pos/virtpatmat_exist1.scala index ccb91299db..6cad017b0b 100644 --- a/test/files/pos/virtpatmat_exist1.scala +++ b/test/files/pos/virtpatmat_exist1.scala @@ -13,7 +13,7 @@ object Test { // without type ascription for the one in the body of the last flatmap of each alternative, type inference borks on the existentials // def splitArray[T >: Nothing <: Any](ad: Array[Iterable[T]]): Any = { import OptionMatching._ // runOrElse(ad.apply(0))(((x1: Iterable[T]) => ( - // or(((x4: Iterable[T]) => one(null)), + // or(((x4: Iterable[T]) => one(null)), // guard(x1.isInstanceOf[Iterable[T] with Test.HashMapCollision1[_,_]], x1.asInstanceOf[Iterable[T] with Test.HashMapCollision1[_,_]]).flatMap(((x2: Iterable[T] with Test.HashMapCollision1[_,_]) => one(x2))), // guard(x1.isInstanceOf[Test.HashSetCollision1[_]], x1.asInstanceOf[Iterable[T] with Test.HashSetCollision1[_]]).flatMap(((x3: Iterable[T] with Test.HashSetCollision1[_]) => one(x3)))): Option[Any]).orElse( // (zero: Option[Any]))) diff --git a/test/files/pos/virtpatmat_exist2.scala b/test/files/pos/virtpatmat_exist2.scala index b0e4c667b7..ee186074ab 100644 --- a/test/files/pos/virtpatmat_exist2.scala +++ b/test/files/pos/virtpatmat_exist2.scala @@ -9,11 +9,11 @@ object Test { // what's the _$1 doing there? // def grow[T >: Nothing <: Any]: ParseResult[T] = { // import OptionMatching._ - // runOrElse[MemoEntry[T], ParseResult[T]]((null: MemoEntry[T]))(((x1: MemoEntry[T]) => - // (MemoEntry.unapply[T](x1).flatMap[ParseResult[T]](((x4: Either[Nothing,ParseResult[_]]) => - // guard[Right[Nothing,ParseResult[_]]](x4.isInstanceOf[Right[Nothing,ParseResult[_]]], x4.asInstanceOf[Right[Nothing,ParseResult[_]]]).flatMap[ParseResult[T]](((cp3: Right[Nothing,ParseResult[_]]) => - // scala.Right.unapply[Nothing, ParseResult[_]](cp3).flatMap[ParseResult[T]](((x5: ParseResult[_]) => - // guard[ParseResult[_$1]](x5.ne(null), x5.asInstanceOf[ParseResult[_]]).flatMap[ParseResult[T]](((x6: ParseResult[_]) => + // runOrElse[MemoEntry[T], ParseResult[T]]((null: MemoEntry[T]))(((x1: MemoEntry[T]) => + // (MemoEntry.unapply[T](x1).flatMap[ParseResult[T]](((x4: Either[Nothing,ParseResult[_]]) => + // guard[Right[Nothing,ParseResult[_]]](x4.isInstanceOf[Right[Nothing,ParseResult[_]]], x4.asInstanceOf[Right[Nothing,ParseResult[_]]]).flatMap[ParseResult[T]](((cp3: Right[Nothing,ParseResult[_]]) => + // scala.Right.unapply[Nothing, ParseResult[_]](cp3).flatMap[ParseResult[T]](((x5: ParseResult[_]) => + // guard[ParseResult[_$1]](x5.ne(null), x5.asInstanceOf[ParseResult[_]]).flatMap[ParseResult[T]](((x6: ParseResult[_]) => // one[ParseResult[T]](x6.asInstanceOf[ParseResult[T]]))))))))): Option[ParseResult[T]] // ).orElse[ParseResult[T]]((zero: Option[ParseResult[T]])))) // } diff --git a/test/files/pos/virtpatmat_exist3.scala b/test/files/pos/virtpatmat_exist3.scala index c8f873878f..94385f32c9 100644 --- a/test/files/pos/virtpatmat_exist3.scala +++ b/test/files/pos/virtpatmat_exist3.scala @@ -4,8 +4,8 @@ class ReferenceQueue[T] { case null => null } - // def wrapper(jref: ReferenceQueue[_]): ReferenceQueue[T] = OptionMatching.runOrElse(jref)(((x1: ReferenceQueue[_]) => - // (OptionMatching.guard(null.==(x1), x1.asInstanceOf[ReferenceQueue[_]]).flatMap(((x2: ReferenceQueue[_]) => + // def wrapper(jref: ReferenceQueue[_]): ReferenceQueue[T] = OptionMatching.runOrElse(jref)(((x1: ReferenceQueue[_]) => + // (OptionMatching.guard(null.==(x1), x1.asInstanceOf[ReferenceQueue[_]]).flatMap(((x2: ReferenceQueue[_]) => // OptionMatching.one(null))): Option[ReferenceQueue[T]]).orElse( // (OptionMatching.zero: Option[ReferenceQueue[T]]))) // ) diff --git a/test/files/pos/virtpatmat_gadt_array.scala b/test/files/pos/virtpatmat_gadt_array.scala index 27e72aa03e..f3332a897f 100644 --- a/test/files/pos/virtpatmat_gadt_array.scala +++ b/test/files/pos/virtpatmat_gadt_array.scala @@ -4,12 +4,12 @@ object Test { case x: Array[AnyRef] => refArrayOps[AnyRef](x).asInstanceOf[ArrayOps[T]] case null => null } - // def genericArrayOps[T >: Nothing <: Any](xs: Array[T]): scala.collection.mutable.ArrayOps[T] - // = OptionMatching.runOrElse(xs)(((x1: Array[T]) => - // ((OptionMatching.guard(x1.isInstanceOf[Array[AnyRef]], x1.asInstanceOf[Array[T] with Array[AnyRef]]).flatMap(((x2: Array[T] with Array[AnyRef]) => + // def genericArrayOps[T >: Nothing <: Any](xs: Array[T]): scala.collection.mutable.ArrayOps[T] + // = OptionMatching.runOrElse(xs)(((x1: Array[T]) => + // ((OptionMatching.guard(x1.isInstanceOf[Array[AnyRef]], x1.asInstanceOf[Array[T] with Array[AnyRef]]).flatMap(((x2: Array[T] with Array[AnyRef]) => // OptionMatching.one(Test.this.refArrayOps[AnyRef](x2).asInstanceOf[scala.collection.mutable.ArrayOps[T]]))): Option[scala.collection.mutable.ArrayOps[T]]).orElse( - // (OptionMatching.guard(null.==(x1), x1.asInstanceOf[Array[T]]).flatMap(((x3: Array[T]) => + // (OptionMatching.guard(null.==(x1), x1.asInstanceOf[Array[T]]).flatMap(((x3: Array[T]) => // OptionMatching.one(null))): Option[scala.collection.mutable.ArrayOps[T]])): Option[scala.collection.mutable.ArrayOps[T]]).orElse((OptionMatching.zero: Option[scala.collection.mutable.ArrayOps[T]])))) - + def refArrayOps[T <: AnyRef](xs: Array[T]): ArrayOps[T] = new ArrayOps.ofRef[T](xs) }
\ No newline at end of file |