diff options
author | Martin Odersky <odersky@gmail.com> | 2005-10-06 13:14:33 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2005-10-06 13:14:33 +0000 |
commit | 25a98964b5109aa55b71a8a26886c59903193548 (patch) | |
tree | 84b8fa154b5a0a2f36accd43d8d35926f6ba8579 /test-nsc/files/pos/compile.scala | |
parent | 3b81e0cbac2fe51226472949ecde4d81b0e95412 (diff) | |
download | scala-25a98964b5109aa55b71a8a26886c59903193548.tar.gz scala-25a98964b5109aa55b71a8a26886c59903193548.tar.bz2 scala-25a98964b5109aa55b71a8a26886c59903193548.zip |
*** empty log message ***
Diffstat (limited to 'test-nsc/files/pos/compile.scala')
-rw-r--r-- | test-nsc/files/pos/compile.scala | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/test-nsc/files/pos/compile.scala b/test-nsc/files/pos/compile.scala new file mode 100644 index 0000000000..3ed733fd40 --- /dev/null +++ b/test-nsc/files/pos/compile.scala @@ -0,0 +1,150 @@ +//############################################################################ +// Compile Time Bugs & Test Cases +//############################################################################ +// $Id$ + +import java.lang.System; // to avoid name clash with .NET's library + +//############################################################################ +// Test 0 + +/* +class Test0Foo[X]; + +object Test0Test { + type Gen[A] = Test0Foo[A]; + class Tic(g: Test0Test.Gen[Int]); + class Tac(g: Gen[Int]); +} + +//############################################################################ +// Test 1 - Single types in lambda lift + +object Test1 { + def main(args: Array[String]): Unit = { + List[args.type](args); + } + def foo[X]: Any = { + def bar(x: X) = List(x); + 0 + } +} + +//############################################################################ +// Test 2 - Local variables owned by other local variables + +class Test2_1(i: Int) { + val t = { + val x = { + val y = { + val z = i; + z; + }; + }; + }; + val x = { + val y = { + val z = i; + z; + }; + }; + val y = { + val z = i; + z; + }; + val z2_1 = i; +} + +class Test2_2(i: Int) { + { + val t = { + val x = { + val y = { + val z = i; + z; + }; + }; + }; + val x = { + val y = { + val z = i; + z; + }; + }; + val y = { + val z = i; + z; + }; + val z2_2 = i; + 0 + } +} + +class Test2_3() { + + def this(i: Int) = { + this(); + val t = { + val x = { + val y = { + val z = i; + z; + }; + }; + }; + val x = { + val y = { + val z = i; + z; + }; + }; + val y = { + val z = i; + z; + }; + val z2_3 = i; + } + + def test(i: Int): Int = { + val t = { + val x = { + val y = { + val z = i; + z; + }; + }; + }; + val x = { + val y = { + val z = i; + z; + }; + }; + val y = { + val z = i; + z; + }; + val z_test = i; + 0 + } + +} +*/ +//############################################################################ +// Test 3 - Super Calls with Mixins + +class Test3Foo; + +trait Test3A[T] { + def fun: T = fun; +} + +class Test3B extends Test3A[Test3Foo]; + +trait Test3M extends Test3A[Test3Foo] { + override def fun: Test3Foo = super.fun; +} + +class Test3C extends Test3B with Test3M; + +//############################################################################ |