diff options
Diffstat (limited to 'test/files')
18 files changed, 46 insertions, 53 deletions
diff --git a/test/files/jvm/t1342/SI.scala b/test/files/jvm/t1342/SI.scala index 8e3b753210..7c37d4bcd7 100644 --- a/test/files/jvm/t1342/SI.scala +++ b/test/files/jvm/t1342/SI.scala @@ -4,7 +4,7 @@ class SI extends JI { } } -object Test extends Application { +object Test extends App { val x: JI = new SI x.varArgsMethod("one", "two") } diff --git a/test/files/jvm/ticket2163/ticket2163.java b/test/files/jvm/t2163/t2163.java index b6511d241c..83bd37d212 100644 --- a/test/files/jvm/ticket2163/ticket2163.java +++ b/test/files/jvm/t2163/t2163.java @@ -1,9 +1,9 @@ import java.util.*; -public class ticket2163 { +public class t2163 { public void test() { List<Integer> array = new ArrayList<Integer>(); - Ticket2163Scala<List> foo = new Ticket2163Scala<List>(array); + T2163Scala<List> foo = new T2163Scala<List>(array); foo.bar(array); } } diff --git a/test/files/jvm/t2163/t2163.scala b/test/files/jvm/t2163/t2163.scala new file mode 100644 index 0000000000..f73b520cbe --- /dev/null +++ b/test/files/jvm/t2163/t2163.scala @@ -0,0 +1,5 @@ +class T2163Scala[CC[X]](x: CC[Int]) { + def bar[DD[X]](meh: DD[Int]): CC[Int] = x +} + +object Test extends App {} diff --git a/test/files/jvm/t2570/Test.scala b/test/files/jvm/t2570/Test.scala index 7944aedae6..f1cba53546 100644 --- a/test/files/jvm/t2570/Test.scala +++ b/test/files/jvm/t2570/Test.scala @@ -1,3 +1,3 @@ class Test2 extends Test1[Test3[Test4]] class Test4 -object Test extends Application {}
\ No newline at end of file +object Test extends App {}
\ No newline at end of file diff --git a/test/files/jvm/t3415/HelloWorld.scala b/test/files/jvm/t3415/HelloWorld.scala index 53bf55e444..5ef012390e 100644 --- a/test/files/jvm/t3415/HelloWorld.scala +++ b/test/files/jvm/t3415/HelloWorld.scala @@ -1,4 +1,4 @@ -object Test extends Application { +object Test extends App { @Hello def foo() { } } diff --git a/test/files/jvm/ticket4283/AbstractFoo.java b/test/files/jvm/t4283/AbstractFoo.java index 74f3827fe3..74f3827fe3 100644 --- a/test/files/jvm/ticket4283/AbstractFoo.java +++ b/test/files/jvm/t4283/AbstractFoo.java diff --git a/test/files/jvm/ticket4283/ScalaBipp.scala b/test/files/jvm/t4283/ScalaBipp.scala index 36dea9f4de..36dea9f4de 100644 --- a/test/files/jvm/ticket4283/ScalaBipp.scala +++ b/test/files/jvm/t4283/ScalaBipp.scala diff --git a/test/files/jvm/ticket4283/Test.scala b/test/files/jvm/t4283/Test.scala index 9bbfaab928..9bbfaab928 100644 --- a/test/files/jvm/ticket4283/Test.scala +++ b/test/files/jvm/t4283/Test.scala diff --git a/test/files/jvm/ticket2163/ticket2163.scala b/test/files/jvm/ticket2163/ticket2163.scala deleted file mode 100644 index d30bfe251b..0000000000 --- a/test/files/jvm/ticket2163/ticket2163.scala +++ /dev/null @@ -1,5 +0,0 @@ -class Ticket2163Scala[CC[X]](x: CC[Int]) { - def bar[DD[X]](meh: DD[Int]): CC[Int] = x -} - -object Test extends Application {} diff --git a/test/files/pos/chang/Test.scala b/test/files/pos/chang/Test.scala index 9bb745e377..f74c6355b5 100644 --- a/test/files/pos/chang/Test.scala +++ b/test/files/pos/chang/Test.scala @@ -1,3 +1,3 @@ -object Test extends Application { +object Test extends App { new com.netgents.hello.Outer[String] } diff --git a/test/files/pos/liftcode_polymorphic.scala b/test/files/pos/liftcode_polymorphic.scala index 8f537d278a..249f5a0569 100644 --- a/test/files/pos/liftcode_polymorphic.scala +++ b/test/files/pos/liftcode_polymorphic.scala @@ -1,6 +1,6 @@ import scala.reflect.runtime.universe._ -object Append extends Application { +object Append extends App { def append[A](l1: List[A], l2: List[A]):List[A] = l1 match { diff --git a/test/files/pos/t1230/S.scala b/test/files/pos/t1230/S.scala index f8a691b6de..530dd4b853 100644 --- a/test/files/pos/t1230/S.scala +++ b/test/files/pos/t1230/S.scala @@ -1 +1 @@ -object S extends Application { (new J).foo = 5 } +object S extends App { (new J).foo = 5 } diff --git a/test/files/pos/t1231/S.scala b/test/files/pos/t1231/S.scala index ee08866e04..f14aa2561b 100644 --- a/test/files/pos/t1231/S.scala +++ b/test/files/pos/t1231/S.scala @@ -1 +1 @@ -object S extends Application { println(J.j1) } +object S extends App { println(J.j1) } diff --git a/test/files/pos/t715/meredith_1.scala b/test/files/pos/t715/meredith_1.scala index 8261b9881a..c28afb4a9b 100644 --- a/test/files/pos/t715/meredith_1.scala +++ b/test/files/pos/t715/meredith_1.scala @@ -3,7 +3,7 @@ package com.sap.dspace.model.othello; import scala.xml._ trait XMLRenderer { - type T <: Any {def getClass() : java.lang.Class[_]} + type T <: Any {def getClass(): java.lang.Class[_]} val valueTypes = List( classOf[java.lang.Boolean], @@ -14,21 +14,21 @@ trait XMLRenderer { ) def value2XML( - value : Object, - field : java.lang.reflect.Field, - pojo : T - ) : Node = { + value: Object, + field: java.lang.reflect.Field, + pojo: T + ): Node = { value match { - case null => Text( "null" ) + case null => Text("null") case vUnmatched => if (value.isInstanceOf[java.lang.Boolean]) - Text( value.asInstanceOf[java.lang.Boolean].toString ) + Text(value.asInstanceOf[java.lang.Boolean].toString) else if (value.isInstanceOf[java.lang.Integer]) - Text( value.asInstanceOf[java.lang.Integer].toString ) + Text(value.asInstanceOf[java.lang.Integer].toString) else if (value.isInstanceOf[java.lang.Float]) - Text( value.asInstanceOf[java.lang.Float].toString ) + Text(value.asInstanceOf[java.lang.Float].toString) // else if (value.isInstanceOf[T]) - // pojo2XML( value.asInstanceOf[T] ) + // pojo2XML(value.asInstanceOf[T]) else <unmatchedType> <theType> @@ -42,16 +42,16 @@ trait XMLRenderer { } def field2XML( - field : java.lang.reflect.Field, - pojo : T - ) : Elem = { + field: java.lang.reflect.Field, + pojo: T + ): Elem = { - val accessible = field.isAccessible; - field.setAccessible( true ); + val accessible = field.isAccessible + field.setAccessible(true) // BUGBUG lgm need to disambiguate on type and possibly make // recursive call to pojo2XML - val fldValXML = value2XML( field.get( pojo ), field, pojo ); - field.setAccessible( accessible ); + val fldValXML = value2XML(field.get( pojo ), field, pojo) + field.setAccessible( accessible ) Elem( null, @@ -62,37 +62,37 @@ trait XMLRenderer { ) } - def pojo2XML( pojo : T ) : Elem = { + def pojo2XML(pojo: T): Elem = { val progeny = for (field <- pojo.getClass.getDeclaredFields) - yield field2XML( field, pojo ); + yield field2XML(field, pojo) Elem( null, pojo.getClass.getName, null, TopScope, - progeny.asInstanceOf[Array[scala.xml.Node]] : _* + progeny.asInstanceOf[Array[scala.xml.Node]]: _* ) } } -case class POJO2XMLRenderer( recurse : Boolean ) +case class POJO2XMLRenderer(recurse: Boolean) extends XMLRenderer { type T = java.io.Serializable override def value2XML( - value : Object, - field : java.lang.reflect.Field, - pojo : java.io.Serializable - ) : Node = { - if (recurse) super.value2XML( value, field, pojo ) - else Text( value + "" ) + value: Object, + field: java.lang.reflect.Field, + pojo: java.io.Serializable + ): Node = { + if (recurse) super.value2XML(value, field, pojo) + else Text(value + "") } } -object thePOJO2XMLRenderer extends POJO2XMLRenderer( true ) { +object thePOJO2XMLRenderer extends POJO2XMLRenderer(true) { } -object Test extends Application { +object Test extends App { println(com.sap.dspace.model.othello.thePOJO2XMLRenderer) } diff --git a/test/files/pos/t715/runner_2.scala b/test/files/pos/t715/runner_2.scala index 1e4f40d654..d54805629a 100644 --- a/test/files/pos/t715/runner_2.scala +++ b/test/files/pos/t715/runner_2.scala @@ -1,3 +1,3 @@ -object Test extends Application { +object Test extends App { println(com.sap.dspace.model.othello.thePOJO2XMLRenderer) } diff --git a/test/files/run/collection-stacks.scala b/test/files/run/collection-stacks.scala index fbee3f8594..be9fbbf1ae 100644 --- a/test/files/run/collection-stacks.scala +++ b/test/files/run/collection-stacks.scala @@ -1,6 +1,6 @@ import scala.collection.{ immutable, mutable } -object Test extends Application { +object Test extends App { def mutableStack[T](xs: T*): mutable.Stack[T] = { val s = new mutable.Stack[T] s.pushAll(xs) diff --git a/test/files/run/t4047.scala b/test/files/run/t4047.scala index cd42a8b4df..08989bd278 100644 --- a/test/files/run/t4047.scala +++ b/test/files/run/t4047.scala @@ -18,7 +18,7 @@ class D extends Bar[Unit]{ def foo = println("Unit: called D.foo") } -object Test extends Application { +object Test extends App { val a: Foo[Unit] = new A a.foo a.foo diff --git a/test/files/run/t4146.scala b/test/files/run/t4146.scala deleted file mode 100644 index 93ce22b519..0000000000 --- a/test/files/run/t4146.scala +++ /dev/null @@ -1,7 +0,0 @@ -object bob extends Application { - var name = "Bob" -} - -object Test extends App { - assert(bob.name == "Bob") -} |