summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-09-12 21:24:09 +0000
committerpaltherr <paltherr@epfl.ch>2003-09-12 21:24:09 +0000
commit01d4668fc81fbbb245d145086ceea0755848a383 (patch)
tree89e8273d8eb455e3e81369102f6e3e80382350c4
parent6e784092689e55e768aee020ba6269c38f2b0188 (diff)
downloadscala-01d4668fc81fbbb245d145086ceea0755848a383.tar.gz
scala-01d4668fc81fbbb245d145086ceea0755848a383.tar.bz2
scala-01d4668fc81fbbb245d145086ceea0755848a383.zip
- Added test file for bug 142
-rw-r--r--config/list/test-run.lst1
-rw-r--r--test/files/jvm/bug142.check8
-rw-r--r--test/files/jvm/bug142.scala39
3 files changed, 48 insertions, 0 deletions
diff --git a/config/list/test-run.lst b/config/list/test-run.lst
index eb96b19425..6b1eed1655 100644
--- a/config/list/test-run.lst
+++ b/config/list/test-run.lst
@@ -4,6 +4,7 @@
# $Id$
files/jvm/JavaInteraction.scala
+files/jvm/bug142.scala
files/run/Course-2002-01.scala
files/run/Course-2002-02.scala
diff --git a/test/files/jvm/bug142.check b/test/files/jvm/bug142.check
new file mode 100644
index 0000000000..2ecb5b2188
--- /dev/null
+++ b/test/files/jvm/bug142.check
@@ -0,0 +1,8 @@
+ok
+ok
+ok
+ok
+ok
+ok
+ok
+ok
diff --git a/test/files/jvm/bug142.scala b/test/files/jvm/bug142.scala
new file mode 100644
index 0000000000..9985ec83bf
--- /dev/null
+++ b/test/files/jvm/bug142.scala
@@ -0,0 +1,39 @@
+//############################################################################
+// Bug 142
+//############################################################################
+// $Id$
+
+import System.out.println;
+
+abstract class Foo1 { class Inner; def foo: Inner; foo; }
+abstract class Foo2 { class Inner; def foo: Inner = {println("ok"); null}; }
+abstract class Foo3 { type Inner; def foo: Inner; foo; }
+abstract class Foo4 { type Inner; def foo: Inner = {println("ok"); null.asInstanceOf[Inner]}; }
+
+abstract class Bar1 { type Inner; def foo: Inner = {println("ok"); null.asInstanceOf[Inner]}; }
+abstract class Bar2 { type Inner; def foo: Inner; foo; }
+abstract class Bar3 { class Inner; def foo: Inner = {println("ok"); null}; }
+abstract class Bar4 { class Inner; def foo: Inner; foo; }
+
+object Test1 extends Foo1 with Bar1 {def main(args:Array[String]):Unit=();}
+object Test2 extends Foo2 with Bar2 {def main(args:Array[String]):Unit=();}
+object Test3 extends Foo3 with Bar3 {def main(args:Array[String]):Unit=();}
+object Test4 extends Foo4 with Bar4 {def main(args:Array[String]):Unit=();}
+object Test5 with Foo1 with Bar1 {def main(args:Array[String]):Unit=();}
+object Test6 with Foo2 with Bar2 {def main(args:Array[String]):Unit=();}
+object Test7 with Foo3 with Bar3 {def main(args:Array[String]):Unit=();}
+object Test8 with Foo4 with Bar4 {def main(args:Array[String]):Unit=();}
+
+object Test {
+ def main(args:Array[String]): Unit = {
+ Test1;
+ Test2;
+ Test3;
+ Test4;
+ Test5;
+ Test6;
+ Test7;
+ Test8;
+ ()
+ }
+}