diff options
Diffstat (limited to 'tests/pos')
54 files changed, 169 insertions, 169 deletions
diff --git a/tests/pos/Bridges.scala b/tests/pos/Bridges.scala index a7350d785..6c2115d7e 100644 --- a/tests/pos/Bridges.scala +++ b/tests/pos/Bridges.scala @@ -1,6 +1,6 @@ abstract class X[T]{ def go2(x:T)(y:T = x): T = y - def go: T + def go: T def go1(x: T) = x } diff --git a/tests/pos/Coder.scala b/tests/pos/Coder.scala index 77bbd134c..6eb1ad55a 100644 --- a/tests/pos/Coder.scala +++ b/tests/pos/Coder.scala @@ -7,15 +7,15 @@ class Coder(words: List[String]) { private val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") - + ('1', "1") match { - case (digit, str) => true + case (digit, str) => true case _ => false } /** Invert the mnemonics map to give a map from chars 'A' ... 'Z' to '2' ... '9' */ - private val charCode0: Map[Char, Char] = mnemonics withFilter { + private val charCode0: Map[Char, Char] = mnemonics withFilter { case (digit, str) => true case _ => false } flatMap { x$1 => @@ -24,18 +24,18 @@ class Coder(words: List[String]) { } } - private val charCode: Map[Char, Char] = + private val charCode: Map[Char, Char] = for ((digit, str) <- mnemonics; ltr <- str) yield ltr -> digit /** Maps a word to the digit string it can represent */ private def wordCode(word: String): String = word map charCode /** A map from digit strings to the words that represent them */ - private val wordsForNum: Map[String, List[String]] = + private val wordsForNum: Map[String, List[String]] = words groupBy wordCode withDefaultValue Nil /** All ways to encode a number as a list of words */ - def encode(number: String): Set[List[String]] = + def encode(number: String): Set[List[String]] = if (number.isEmpty) Set(Nil) else { for { @@ -44,7 +44,7 @@ class Coder(words: List[String]) { rest <- encode(number drop splitPoint) } yield word :: rest }.toSet - + /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkString " ") diff --git a/tests/pos/Labels.scala b/tests/pos/Labels.scala index d82287313..f1a120920 100644 --- a/tests/pos/Labels.scala +++ b/tests/pos/Labels.scala @@ -5,18 +5,18 @@ import dotty.tools.dotc.ast.tpd._ object Labels { def main(args: Array[String]): Unit = { var i = 10 - while(i>0) { + while(i>0) { var j = 0 while(j<i) { - println(j+" " + i) - j = j +1 - } + println(j +" " + i) + j = j + 1 + } i = i - 1} pattern(1) pattern(2) - pattern(3) + pattern(3) } - + def pattern(a: Int) = a match { case 1 if (a>0) => println("one") case t@2 => println("two" + t) diff --git a/tests/pos/List1.scala b/tests/pos/List1.scala index 30ebf5e1e..733ef376d 100644 --- a/tests/pos/List1.scala +++ b/tests/pos/List1.scala @@ -21,7 +21,7 @@ object lists { def foo = { val intnil = Nil[Int]; - val intlist = intnil.prepend(1).prepend(1+1); + val intlist = intnil.prepend(1).prepend(1 + 1); val x: Int = intlist.head; val strnil = Nil[String]; val strlist = strnil.prepend("A").prepend("AA"); @@ -33,8 +33,8 @@ object lists { def isEmpty: Boolean = false; def head: Int = 1; def foo: List[Int] { def isEmpty: Boolean; def head: Int; def tail: List[Int] } = Nil[Int]; - def tail0: List[Int] = foo.prepend(1).prepend(1+1); - def tail: List[Int] = Nil[Int].prepend(1).prepend(1+1); + def tail0: List[Int] = foo.prepend(1).prepend(1 + 1); + def tail: List[Int] = Nil[Int].prepend(1).prepend(1 + 1); } def foo2 = { diff --git a/tests/pos/Meter.scala b/tests/pos/Meter.scala index 53be6f9d0..bbee710c4 100644 --- a/tests/pos/Meter.scala +++ b/tests/pos/Meter.scala @@ -12,7 +12,7 @@ package a { def < (other: Meter): Boolean = this.underlying < other.underlying def toFoot: Foot = new Foot(this.underlying * 0.3048) override def print = { Console.print(">>>"); super.print; proprint } - override def toString: String = underlying.toString+"m" + override def toString: String = underlying.toString +"m" } object Meter extends (Double => Meter) { @@ -30,7 +30,7 @@ package a { class Foot(val unbox: Double) extends AnyVal { def + (other: Foot): Foot = new Foot(this.unbox + other.unbox) - override def toString = unbox.toString+"ft" + override def toString = unbox.toString +"ft" } object Foot { implicit val boxings: BoxingConversions[Foot, Double] = new BoxingConversions[Foot, Double] { @@ -65,23 +65,23 @@ object Test extends App { //println((x + x) / x) println((x + x) / 0.5) println((x < x).toString) - println("x.isInstanceOf[Meter]: "+x.isInstanceOf[Meter]) + println("x.isInstanceOf[Meter]: " + x.isInstanceOf[Meter]) - println("x.hashCode: "+x.hashCode) - println("x == 1: "+(x == 1)) - println("x == y: "+(x == y)) + println("x.hashCode: " + x.hashCode) + println("x == 1: " +(x == 1)) + println("x == y: " +(x == y)) assert(x.hashCode == (1.0).hashCode) val a: Any = x val b: Any = y - println("a == b: "+(a == b)) + println("a == b: " +(a == b)) { println("testing native arrays") val arr = Array(x, y + x) println(arr.deep) def foo[T <: Printable](x: Array[T]) = { - for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + for (i <- 0 until x.length) { x(i).print; println(" " + x(i)) } } val m = arr(0) println(m) @@ -93,7 +93,7 @@ object Test extends App { // val arr = FlatArray(x, y + x) // println(arr) // def foo(x: FlatArray[Meter]) { - // for (i <- 0 until x.length) { x(i).print; println(" "+x(i)) } + // for (i <- 0 until x.length) { x(i).print; println(" " + x(i)) } // } // val m = arr(0) // println(m) diff --git a/tests/pos/SI-7638.scala b/tests/pos/SI-7638.scala index ed581efe9..eea302e17 100644 --- a/tests/pos/SI-7638.scala +++ b/tests/pos/SI-7638.scala @@ -36,16 +36,16 @@ object vectorOrder { * unhandled exception while transforming SI-7638.scala * error: uncaught exception during compilation: java.lang.UnsupportedOperationException * error: java.lang.UnsupportedOperationException: tail of empty list - * at scala.collection.immutable.Nil$.tail(List.scala:339) - * at scala.collection.immutable.Nil$.tail(List.scala:334) - * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$rebindSuper$1.apply(Mixin.scala:123) - * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$rebindSuper$1.apply(Mixin.scala:122) - * at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207) - * at scala.reflect.internal.SymbolTable.afterPhase(SymbolTable.scala:216) - * at scala.tools.nsc.Global.afterPickler(Global.scala:1104) - * at scala.tools.nsc.transform.Mixin.scala$tools$nsc$transform$Mixin$$rebindSuper(Mixin.scala:122) - * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$mixinTraitMembers$1$1.apply(Mixin.scala:339) - * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$mixinTraitMembers$1$1.apply(Mixin.scala:292) + * at scala.collection.immutable.Nil$.tail(List.scala:339) + * at scala.collection.immutable.Nil$.tail(List.scala:334) + * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$rebindSuper$1.apply(Mixin.scala:123) + * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$rebindSuper$1.apply(Mixin.scala:122) + * at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207) + * at scala.reflect.internal.SymbolTable.afterPhase(SymbolTable.scala:216) + * at scala.tools.nsc.Global.afterPickler(Global.scala:1104) + * at scala.tools.nsc.transform.Mixin.scala$tools$nsc$transform$Mixin$$rebindSuper(Mixin.scala:122) + * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$mixinTraitMembers$1$1.apply(Mixin.scala:339) + * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$mixinTraitMembers$1$1.apply(Mixin.scala:292) */ new ArrayVectorOrder[A] { } } diff --git a/tests/pos/SI-7638a.scala b/tests/pos/SI-7638a.scala index 060bd0ffa..7a73c8ea3 100644 --- a/tests/pos/SI-7638a.scala +++ b/tests/pos/SI-7638a.scala @@ -37,16 +37,16 @@ object vectorOrder { * unhandled exception while transforming SI-7638.scala * error: uncaught exception during compilation: java.lang.UnsupportedOperationException * error: java.lang.UnsupportedOperationException: tail of empty list - * at scala.collection.immutable.Nil$.tail(List.scala:339) - * at scala.collection.immutable.Nil$.tail(List.scala:334) - * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$rebindSuper$1.apply(Mixin.scala:123) - * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$rebindSuper$1.apply(Mixin.scala:122) - * at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207) - * at scala.reflect.internal.SymbolTable.afterPhase(SymbolTable.scala:216) - * at scala.tools.nsc.Global.afterPickler(Global.scala:1104) - * at scala.tools.nsc.transform.Mixin.scala$tools$nsc$transform$Mixin$$rebindSuper(Mixin.scala:122) - * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$mixinTraitMembers$1$1.apply(Mixin.scala:339) - * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$mixinTraitMembers$1$1.apply(Mixin.scala:292) + * at scala.collection.immutable.Nil$.tail(List.scala:339) + * at scala.collection.immutable.Nil$.tail(List.scala:334) + * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$rebindSuper$1.apply(Mixin.scala:123) + * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$rebindSuper$1.apply(Mixin.scala:122) + * at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:207) + * at scala.reflect.internal.SymbolTable.afterPhase(SymbolTable.scala:216) + * at scala.tools.nsc.Global.afterPickler(Global.scala:1104) + * at scala.tools.nsc.transform.Mixin.scala$tools$nsc$transform$Mixin$$rebindSuper(Mixin.scala:122) + * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$mixinTraitMembers$1$1.apply(Mixin.scala:339) + * at scala.tools.nsc.transform.Mixin$$anonfun$scala$tools$nsc$transform$Mixin$$mixinTraitMembers$1$1.apply(Mixin.scala:292) */ new ArrayVectorOrder[A] { } } diff --git a/tests/pos/assignments.scala b/tests/pos/assignments.scala index 94223b62c..9801bdca2 100644 --- a/tests/pos/assignments.scala +++ b/tests/pos/assignments.scala @@ -3,8 +3,8 @@ object assignments { var a = Array(1, 2, 3) var i = 0 a(i) = a(i) * 2 - a(i+1) += 1 - + a(i + 1) += 1 + class C { var myX = 0 def x = myX @@ -13,11 +13,11 @@ object assignments { x = x + 1 x *= 2 } - + var c = new C c.x =c.x + 1 c.x *= 2 - + val cc = c import cc._ x = x + 1 diff --git a/tests/pos/blockescapes.scala b/tests/pos/blockescapes.scala index 68ce37ed3..589953fe5 100644 --- a/tests/pos/blockescapes.scala +++ b/tests/pos/blockescapes.scala @@ -1,11 +1,11 @@ object blockescapes { - + { val x = 0; () } val x0 = { class Foo; new Foo } val x1 = {} var x2 = { val z = 0 } val m1 = { val x = 2; x } - + trait T def m0: T = { object Foo { class Bar extends T } ; new Foo.Bar } -}
\ No newline at end of file +} diff --git a/tests/pos/implicits1.scala b/tests/pos/implicits1.scala index 47b7f1c52..d8ca76de5 100644 --- a/tests/pos/implicits1.scala +++ b/tests/pos/implicits1.scala @@ -43,7 +43,7 @@ object Implicits { val e: Int = z.foo(true) // Haoyi Li's example on scala-user: - + trait Modifier implicit def stringNode(v: String): Modifier = new Modifier {} diff --git a/tests/pos/inferred.scala b/tests/pos/inferred.scala index 87bbd9473..311e56a50 100644 --- a/tests/pos/inferred.scala +++ b/tests/pos/inferred.scala @@ -55,4 +55,4 @@ object Inferred { val ints3 = new CONS[Int](1, NIL) val ints4 = new CONS(1, NIL) -}
\ No newline at end of file +} diff --git a/tests/pos/java-interop/t2433/Test.scala b/tests/pos/java-interop/t2433/Test.scala index 02fd89b64..02fd89b64 100755..100644 --- a/tests/pos/java-interop/t2433/Test.scala +++ b/tests/pos/java-interop/t2433/Test.scala diff --git a/tests/pos/java-interop/t2940/Error.scala b/tests/pos/java-interop/t2940/Error.scala index 92f08f580..305d8aa4c 100644 --- a/tests/pos/java-interop/t2940/Error.scala +++ b/tests/pos/java-interop/t2940/Error.scala @@ -1,5 +1,5 @@ abstract class Error { - val c: Cycle[_] + val c: Cycle[_] } object Test { diff --git a/tests/pos/java-interop/t2956/t2956.scala b/tests/pos/java-interop/t2956/t2956.scala index 33803874b..33803874b 100755..100644 --- a/tests/pos/java-interop/t2956/t2956.scala +++ b/tests/pos/java-interop/t2956/t2956.scala diff --git a/tests/pos/nameddefaults.scala b/tests/pos/nameddefaults.scala index 671f14a07..20a0eae47 100644 --- a/tests/pos/nameddefaults.scala +++ b/tests/pos/nameddefaults.scala @@ -1,7 +1,7 @@ object nameddefaults { def foo(first: Int, second: Int = 2, third: Int = 3) = first + second - + var x = 1 var y = 2 @@ -12,7 +12,7 @@ object nameddefaults { foo(1) // named and missing arguments - + foo(first = 1, second = 3) foo(second = 3, first = 1) @@ -20,7 +20,7 @@ object nameddefaults { foo(first = 2, third = 3) foo(2, third = 3) - + // same but with non-idempotent expressions foo(first = x, second = y) @@ -30,11 +30,11 @@ object nameddefaults { foo(first = x, third = y) foo(x, third = y) - + // The same thing, but for classes - + class C(first: Int, second: Int = 2, third: Int = 3) {} - + new C(1, 2, 3) new C(1, 2) @@ -42,7 +42,7 @@ object nameddefaults { new C(1) // named and missing arguments - + new C(first = 1, second = 3) new C(second = 3, first = 1) @@ -50,7 +50,7 @@ object nameddefaults { new C(first = 2, third = 3) new C(2, third = 3) - + // same but with non-idempotent expressions new C(first = x, second = y) diff --git a/tests/pos/packageobject.scala b/tests/pos/packageobject.scala index 1a373c248..b49a8489a 100644 --- a/tests/pos/packageobject.scala +++ b/tests/pos/packageobject.scala @@ -1,5 +1,5 @@ package test { - object `package` {} + object `package` {} } -package object foo {}
\ No newline at end of file +package object foo {} diff --git a/tests/pos/selftypes.scala b/tests/pos/selftypes.scala index 243405f77..5180419d1 100644 --- a/tests/pos/selftypes.scala +++ b/tests/pos/selftypes.scala @@ -1,20 +1,20 @@ object selftypes { - + trait A { self: AB => - + type AA = List[this.BX] - + class AX - + } - + trait B { self: AB => - + type BB = AA - + class BX } - + class AB extends A with B -}
\ No newline at end of file +} diff --git a/tests/pos/sigs.scala b/tests/pos/sigs.scala index 4c1973cad..a9a1b464e 100644 --- a/tests/pos/sigs.scala +++ b/tests/pos/sigs.scala @@ -1,31 +1,31 @@ object sigs { - + type Lst[A] = List[A] - + type Twin[B] = (B, B) - + var x = 7 * 9 - + class Base { - + def foo(x: Int): Any = 33 def foo: Object = "x" - + } - + class Sub extends Base { - + override def foo = "abc" - + override def foo(x: Int) = "abc" } - + trait A { self: B => type AA val a: AA & BB - + } - + trait B { this: A => type BB val b: AA & BB @@ -39,4 +39,4 @@ object sigs { } -}
\ No newline at end of file +} diff --git a/tests/pos/t0031.scala b/tests/pos/t0031.scala index d4050c818..6070a4683 100644 --- a/tests/pos/t0031.scala +++ b/tests/pos/t0031.scala @@ -7,12 +7,12 @@ object Main { def require[a](precondition: => Boolean)(command: => a): Ensure[a] = if (precondition) new Ensure[a] { - def ensure(postcondition: a => Boolean): a = { - val result = command; - if (postcondition(result)) result - else sys.error("Assertion error") + def ensure(postcondition: a => Boolean): a = { + val result = command; + if (postcondition(result)) result + else sys.error("Assertion error") } - } + } else sys.error("Assertion error"); @@ -22,7 +22,7 @@ object Main { } ensure (result => s contains result); def main(args: Array[String]) = { - val s = List(1, 2); + val s = List(1, 2); Console.println(arb(s)) } diff --git a/tests/pos/t0039.scala b/tests/pos/t0039.scala index 652c606b0..7b51320e2 100644 --- a/tests/pos/t0039.scala +++ b/tests/pos/t0039.scala @@ -1,6 +1,6 @@ abstract class Extensible[A, This <: Extensible[A, This]](x: A, xs: This) { self: This => - def mkObj(x: A, xs: This): This; + def mkObj(x: A, xs: This): This; } class Fixed[A](x: A, xs: Fixed[A]) extends Extensible[A, Fixed[A]](x, xs) { - def mkObj(x: A, xs: Fixed[A]) = new Fixed(x, xs); + def mkObj(x: A, xs: Fixed[A]) = new Fixed(x, xs); } diff --git a/tests/pos/t0061.scala b/tests/pos/t0061.scala index 8a3aed7c6..0228413fa 100644 --- a/tests/pos/t0061.scala +++ b/tests/pos/t0061.scala @@ -5,6 +5,6 @@ object O { case class testA() extends testClass ; def ga( x:testClass ) = x match { - case testA() => () + case testA() => () } } diff --git a/tests/pos/t0066.scala b/tests/pos/t0066.scala index 8ac328908..04bcd1f5d 100644 --- a/tests/pos/t0066.scala +++ b/tests/pos/t0066.scala @@ -1,7 +1,7 @@ class GBTree[A, B] { abstract class Tree[A,B]; case class Node[A,B](key:A,value:B,smaller:Node[A,B],bigger:Node[A,B]) - extends Tree[A,B]; + extends Tree[A,B]; case class Nil[A,B]() extends Tree[A,B]; } diff --git a/tests/pos/t0770.scala b/tests/pos/t0770.scala index 7a0a2bf9b..54990ec09 100644 --- a/tests/pos/t0770.scala +++ b/tests/pos/t0770.scala @@ -1,13 +1,13 @@ trait A { - private[this] val p = 5 + private[this] val p = 5 - def f = (b: Byte) => p + def f = (b: Byte) => p } trait B { - def failure: Boolean - def success = !failure + def failure: Boolean + def success = !failure } diff --git a/tests/pos/t1085.scala b/tests/pos/t1085.scala index c59e657cb..62f2be0b8 100644 --- a/tests/pos/t1085.scala +++ b/tests/pos/t1085.scala @@ -1,5 +1,5 @@ trait Functor[a] { - type MyType[a] + type MyType[a] } object Test { diff --git a/tests/pos/t1133.scala b/tests/pos/t1133.scala index 562b528ea..2e4793e99 100644 --- a/tests/pos/t1133.scala +++ b/tests/pos/t1133.scala @@ -11,14 +11,14 @@ object Match object Extractor1 { def unapply(x: Any) = x match { - case x: String => Some(x, x+x, x+x+x, x+x, x) + 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 x: String => Some(x, x + x, x + x+x) case _ => None } } diff --git a/tests/pos/t1168.scala b/tests/pos/t1168.scala index 75638e792..f43436812 100644 --- a/tests/pos/t1168.scala +++ b/tests/pos/t1168.scala @@ -6,7 +6,7 @@ object Test extends App { throw new Exception } catch { case e : SpecialException => { - println("matched SpecialException: "+e) + println("matched SpecialException: " + e) assume(e.isInstanceOf[SpecialException]) } case e : Exception => { diff --git a/tests/pos/t1722/Test.scala b/tests/pos/t1722/Test.scala index f236d3fdc..f236d3fdc 100755..100644 --- a/tests/pos/t1722/Test.scala +++ b/tests/pos/t1722/Test.scala diff --git a/tests/pos/t1722/Top.scala b/tests/pos/t1722/Top.scala index 4ac52412a..4ac52412a 100755..100644 --- a/tests/pos/t1722/Top.scala +++ b/tests/pos/t1722/Top.scala diff --git a/tests/pos/t2060.scala b/tests/pos/t2060.scala index 0b9079062..0b9079062 100755..100644 --- a/tests/pos/t2060.scala +++ b/tests/pos/t2060.scala diff --git a/tests/pos/t2082.scala b/tests/pos/t2082.scala index a7ee3789b..34a7c4e3a 100755..100644 --- a/tests/pos/t2082.scala +++ b/tests/pos/t2082.scala @@ -13,7 +13,7 @@ trait IdPK class TestSubject extends KeyedMapper[Long, TestSubject] with IdPK class TestRun extends KeyedMapper[Long, TestRun] with IdPK { - object testSubject extends MappedForeignKey[Long, TestRun, TestSubject] + object testSubject extends MappedForeignKey[Long, TestRun, TestSubject] } object TestRun extends TestRun with KeyedMetaMapper[Long, TestRun] diff --git a/tests/pos/t2179.scala b/tests/pos/t2179.scala index 89e22b6e2..89e22b6e2 100755..100644 --- a/tests/pos/t2179.scala +++ b/tests/pos/t2179.scala diff --git a/tests/pos/t2208_pos.scala b/tests/pos/t2208_pos.scala index dd6d686ba..9f8f96c7d 100644 --- a/tests/pos/t2208_pos.scala +++ b/tests/pos/t2208_pos.scala @@ -1,8 +1,8 @@ object Test { - class A + class A - class B[X] - type Alias[X <: A] = B[X] + class B[X] + type Alias[X <: A] = B[X] - val foo: B[A] = new Alias[A] // check that type aliases can be instantiated + val foo: B[A] = new Alias[A] // check that type aliases can be instantiated } diff --git a/tests/pos/t2305.scala b/tests/pos/t2305.scala index 3338ab911..37d4ac6ca 100644 --- a/tests/pos/t2305.scala +++ b/tests/pos/t2305.scala @@ -5,22 +5,22 @@ trait Bind[Z[_]] class MySerializable[X] extends java.io.Serializable object Bind { - implicit val JavaArrayListBind: Bind[ArrayList] = new Bind[ArrayList] {} - implicit val MySerializableBind: Bind[MySerializable] = new Bind[MySerializable] {} + implicit val JavaArrayListBind: Bind[ArrayList] = new Bind[ArrayList] {} + implicit val MySerializableBind: Bind[MySerializable] = new Bind[MySerializable] {} } object works { - // this works fine: - def runbind(implicit bind: Bind[MySerializable]): Unit = {} - runbind + // this works fine: + def runbind(implicit bind: Bind[MySerializable]): Unit = {} + runbind } object breaks { - def runbind(implicit bind: Bind[ArrayList]): Unit = {} + def runbind(implicit bind: Bind[ArrayList]): Unit = {} 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) - at scala.tools.nsc.symtab.Types$TypeRef.baseType(Types.scala:1559) - */ + /*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) + at scala.tools.nsc.symtab.Types$TypeRef.baseType(Types.scala:1559) + */ } diff --git a/tests/pos/t2405.scala b/tests/pos/t2405.scala index 224b2ce83..a4ac914fb 100644 --- a/tests/pos/t2405.scala +++ b/tests/pos/t2405.scala @@ -2,22 +2,22 @@ object A { implicit val x: Int = 1 } // Problem as stated in the ticket. object Test1 { - import A.{x => y} - implicitly[Int] + import A.{x => y} + implicitly[Int] } // Testing for the absense of shadowing #1. object Test2 { - import A.{x => y} - val x = 2 - implicitly[Int] + import A.{x => y} + val x = 2 + implicitly[Int] } // Testing for the absense of shadowing #2. object Test3 { - { - import A.{x => y} - def x: Int = 0 - implicitly[Int] - } + { + import A.{x => y} + def x: Int = 0 + implicitly[Int] + } } diff --git a/tests/pos/t2425.scala b/tests/pos/t2425.scala index 477d5467a..477d5467a 100755..100644 --- a/tests/pos/t2425.scala +++ b/tests/pos/t2425.scala diff --git a/tests/pos/t2429.scala b/tests/pos/t2429.scala index 4cda3bde1..4cda3bde1 100755..100644 --- a/tests/pos/t2429.scala +++ b/tests/pos/t2429.scala diff --git a/tests/pos/t2444.scala b/tests/pos/t2444.scala index fac1e95d0..fb93749aa 100644 --- a/tests/pos/t2444.scala +++ b/tests/pos/t2444.scala @@ -9,7 +9,7 @@ object Test { 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/tests/pos/t2484.scala b/tests/pos/t2484.scala index b822415fd..b822415fd 100755..100644 --- a/tests/pos/t2484.scala +++ b/tests/pos/t2484.scala diff --git a/tests/pos/t2500.scala b/tests/pos/t2500.scala index d0ff99a93..4b02fe488 100644 --- a/tests/pos/t2500.scala +++ b/tests/pos/t2500.scala @@ -1,6 +1,6 @@ object Test { - import scala.collection._ - ((Map(1 -> "a", 2 -> "b"): collection.Map[Int, String]) map identity[(Int, String)]) : scala.collection.Map[Int,String] - ((SortedMap(1 -> "a", 2 -> "b"): collection.SortedMap[Int, String]) map identity[(Int, String)]): scala.collection.SortedMap[Int,String] - ((SortedSet(1, 2): collection.SortedSet[Int]) map identity[Int]): scala.collection.SortedSet[Int] + import scala.collection._ + ((Map(1 -> "a", 2 -> "b"): collection.Map[Int, String]) map identity[(Int, String)]) : scala.collection.Map[Int,String] + ((SortedMap(1 -> "a", 2 -> "b"): collection.SortedMap[Int, String]) map identity[(Int, String)]): scala.collection.SortedMap[Int,String] + ((SortedSet(1, 2): collection.SortedSet[Int]) map identity[Int]): scala.collection.SortedSet[Int] } diff --git a/tests/pos/t2504.scala b/tests/pos/t2504.scala index 72117174c..72117174c 100755..100644 --- a/tests/pos/t2504.scala +++ b/tests/pos/t2504.scala diff --git a/tests/pos/t2545.scala b/tests/pos/t2545.scala index 6ad994223..6ad994223 100755..100644 --- a/tests/pos/t2545.scala +++ b/tests/pos/t2545.scala diff --git a/tests/pos/t2591.scala b/tests/pos/t2591.scala index 47ae551bf..59f7a02cc 100644 --- a/tests/pos/t2591.scala +++ b/tests/pos/t2591.scala @@ -7,9 +7,9 @@ object Implicits { } object Test { - // should cause imp to be in scope so that the next expression type checks - // `import Implicits._` works - import Implicits.imp + // should cause imp to be in scope so that the next expression type checks + // `import Implicits._` works + import Implicits.imp (new A) : Int } diff --git a/tests/pos/t262.scala b/tests/pos/t262.scala index ec6187b36..9f7686a8f 100644 --- a/tests/pos/t262.scala +++ b/tests/pos/t262.scala @@ -3,7 +3,7 @@ object O { def f:A; } class B extends A { - def f = if(1 == 2) new C else new D; + def f = if (1 == 2) new C else new D; } class C extends A { def f = this; diff --git a/tests/pos/t2635.scala b/tests/pos/t2635.scala index 7cd553135..7cd553135 100755..100644 --- a/tests/pos/t2635.scala +++ b/tests/pos/t2635.scala diff --git a/tests/pos/t2683.scala b/tests/pos/t2683.scala index 4ba34b554..4ba34b554 100755..100644 --- a/tests/pos/t2683.scala +++ b/tests/pos/t2683.scala diff --git a/tests/pos/t3174.scala b/tests/pos/t3174.scala index 8d9b2578d..8d9b2578d 100755..100644 --- a/tests/pos/t3174.scala +++ b/tests/pos/t3174.scala diff --git a/tests/pos/t3278.scala b/tests/pos/t3278.scala index 05bfbc146..254f4dc79 100644 --- a/tests/pos/t3278.scala +++ b/tests/pos/t3278.scala @@ -1,30 +1,30 @@ class Foo class Test { - def update[B](x : B, b : Int): Unit = {} - def apply[B](x : B) = 1 + def update[B](x : B, b : Int): Unit = {} + def apply[B](x : B) = 1 } class Test2 { type B = Foo - def update(x : B, b : Int): Unit = {} - def apply(x : B) = 1 + def update(x : B, b : Int): Unit = {} + def apply(x : B) = 1 } object Test { - def main(a : Array[String]): Unit = { - val a = new Test - val f = new Foo - a(f) = 1 //works - a(f) = a(f) + 1 //works - a(f) += 1 //error: reassignment to val - } + def main(a : Array[String]): Unit = { + val a = new Test + val f = new Foo + a(f) = 1 //works + a(f) = a(f) + 1 //works + a(f) += 1 //error: reassignment to val + } } object Test2 { - def main(args : Array[String]): Unit = { + def main(args : Array[String]): Unit = { args(0) += "a" - val a = new Test2 - val f = new Foo - a(f) = 1 //works - a(f) = a(f) + 1 //works - a(f) += 1 //error: reassignment to val - } + val a = new Test2 + val f = new Foo + a(f) = 1 //works + a(f) = a(f) + 1 //works + a(f) += 1 //error: reassignment to val + } } diff --git a/tests/pos/tailcall/i321.scala b/tests/pos/tailcall/i321.scala index 595e13910..daa078dd5 100644 --- a/tests/pos/tailcall/i321.scala +++ b/tests/pos/tailcall/i321.scala @@ -23,4 +23,4 @@ class i321[T >: Null <: AnyRef] { final def go2[U >: Null <: AnyRef](t: i321[U]): Int = t.go2(this) -}
\ No newline at end of file +} diff --git a/tests/pos/tailcall/tailcall.scala b/tests/pos/tailcall/tailcall.scala index 1e05840ea..faa707e18 100644 --- a/tests/pos/tailcall/tailcall.scala +++ b/tests/pos/tailcall/tailcall.scala @@ -6,4 +6,4 @@ class tailcall { class TypedApply[T2]{ private def firstDiff[T <: TypedApply[T2]](xs: List[T]): Int = firstDiff(xs) -}
\ No newline at end of file +} diff --git a/tests/pos/templateParents.scala b/tests/pos/templateParents.scala index 845913270..1bc07b571 100644 --- a/tests/pos/templateParents.scala +++ b/tests/pos/templateParents.scala @@ -1,11 +1,11 @@ object templateParents { // traits do not call a constructor - class C[+T](x: T) + class C[+T](x: T) trait D extends C[String] trait E extends C[Int] new C("abc") with D - + } object templateParents1 { diff --git a/tests/pos/tryTyping.scala b/tests/pos/tryTyping.scala index a2aeb17c8..cfa2c7a77 100644 --- a/tests/pos/tryTyping.scala +++ b/tests/pos/tryTyping.scala @@ -17,4 +17,4 @@ object tryTyping{ try{???; 1} catch a3(3) } -}
\ No newline at end of file +} diff --git a/tests/pos/typedIdents.scala b/tests/pos/typedIdents.scala index f6c88379b..e99b5a045 100644 --- a/tests/pos/typedIdents.scala +++ b/tests/pos/typedIdents.scala @@ -18,17 +18,17 @@ package P { // `X' bound by package clause println("L12: " + x) // `x' refers to constant `3' here locally { import Q.X._ // `x' and `y' bound by wildcard import - // println("L14: "+x) // reference to `x' is ambiguous here + // println("L14: " + x) // reference to `x' is ambiguous here import X.y // `y' bound by explicit import println("L16: " + y) // `y' refers to `Q.X.y' here locally { val x = "abc" // `x' bound by local definition import P.X._ // `x' and `y' bound by wildcard import - // println("L19: "+y) // reference to `y' is ambiguous here + // println("L19: " + y) // reference to `y' is ambiguous here println("L20: " + x) // `x' refers to string ``abc'' here } } } } } -}
\ No newline at end of file +} diff --git a/tests/pos/typedapply.scala b/tests/pos/typedapply.scala index e28e59d4f..8496d528b 100644 --- a/tests/pos/typedapply.scala +++ b/tests/pos/typedapply.scala @@ -8,4 +8,4 @@ object typedapply { foo[Int, String] _ -}
\ No newline at end of file +} diff --git a/tests/pos/varargs.scala b/tests/pos/varargs.scala index 3739636b8..616456616 100644 --- a/tests/pos/varargs.scala +++ b/tests/pos/varargs.scala @@ -10,4 +10,4 @@ object varargs { g(Nil: _*) g(1) g() -}
\ No newline at end of file +} |