diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/bug874.scala | 22 | ||||
-rw-r--r-- | test/files/run/caseclasses.check | 2 | ||||
-rw-r--r-- | test/files/run/caseclasses.scala | 15 | ||||
-rw-r--r-- | test/files/run/classof.check | 1 | ||||
-rwxr-xr-x | test/files/run/classof.scala | 8 |
5 files changed, 26 insertions, 22 deletions
diff --git a/test/files/run/bug874.scala b/test/files/run/bug874.scala deleted file mode 100644 index 945a5bf620..0000000000 --- a/test/files/run/bug874.scala +++ /dev/null @@ -1,22 +0,0 @@ -object Test { - abstract class Base { - type T; - def T : T; - def U[A](x1: A)(x2: int): Any - T; - U("xyz")(2) - } - class Mix extends Base { - case class T { - Console.println("T created") - } - case class U[A](x1: A)(x2: int) { - Console.println("U created with "+x1+" and "+x2) - } - } - def main(args : Array[String]) : Unit = { - val obvious: Base = new Mix; - obvious.T - obvious.U("abc")(1) - } -} diff --git a/test/files/run/caseclasses.check b/test/files/run/caseclasses.check index d86bac9de5..7eb54ea631 100644 --- a/test/files/run/caseclasses.check +++ b/test/files/run/caseclasses.check @@ -1 +1,3 @@ OK +creating C(hi) +OK diff --git a/test/files/run/caseclasses.scala b/test/files/run/caseclasses.scala index 72a7232d8a..8cba990114 100644 --- a/test/files/run/caseclasses.scala +++ b/test/files/run/caseclasses.scala @@ -2,6 +2,16 @@ case class Foo(x: int)(y: int); case class Bar; +object M { + abstract case class C(x: String) {} + object C extends (String => C) { + def apply(x: String): C = { + println("creating C("+x+")") + new C(x) {} + } + } +} + object Test extends Application { def fn[a,b](x: a => b) = x; @@ -18,6 +28,11 @@ object Test extends Application { case x:IndexOutOfBoundsException => } + M.C("hi") match { + case M.C("hi") => println("OK") + case _ => println("NO") + } + try { f(2) productElement 3 throw new NullPointerException("duh") diff --git a/test/files/run/classof.check b/test/files/run/classof.check new file mode 100644 index 0000000000..e9a8fd6b76 --- /dev/null +++ b/test/files/run/classof.check @@ -0,0 +1 @@ +SomeClass diff --git a/test/files/run/classof.scala b/test/files/run/classof.scala new file mode 100755 index 0000000000..5c920d797f --- /dev/null +++ b/test/files/run/classof.scala @@ -0,0 +1,8 @@ +class SomeClass + +object Test { + def main(args: Array[String]): Unit = { + val cls: Predef.Class[SomeClass] = classOf[SomeClass] + Console.println(cls.getName()) + } +} |