diff options
author | paltherr <paltherr@epfl.ch> | 2004-01-07 17:59:10 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-01-07 17:59:10 +0000 |
commit | edf7c7a74b6a4c09fce5f99cd237f3a19d365abd (patch) | |
tree | 3ee6418a9ed7ec607ca01594eefc90485a9b1428 /test/files/run | |
parent | 84f921cf1c1d843a24570aa66e4362cd4d0dc2ba (diff) | |
download | scala-edf7c7a74b6a4c09fce5f99cd237f3a19d365abd.tar.gz scala-edf7c7a74b6a4c09fce5f99cd237f3a19d365abd.tar.bz2 scala-edf7c7a74b6a4c09fce5f99cd237f3a19d365abd.zip |
- Added bug 266
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/bugs.check | 5 | ||||
-rw-r--r-- | test/files/run/bugs.scala | 54 |
2 files changed, 59 insertions, 0 deletions
diff --git a/test/files/run/bugs.check b/test/files/run/bugs.check index 7bdeb7d655..f8820edba7 100644 --- a/test/files/run/bugs.check +++ b/test/files/run/bugs.check @@ -66,3 +66,8 @@ true <<< bug 250 >>> bug 250 +<<< bug 266 +hello +4 +>>> bug 266 + diff --git a/test/files/run/bugs.scala b/test/files/run/bugs.scala index 153c1e2f90..326d229c0f 100644 --- a/test/files/run/bugs.scala +++ b/test/files/run/bugs.scala @@ -295,6 +295,59 @@ object Bug250Test { } //############################################################################ +// Bug 266 + +// version - A + +abstract class Bug266AFoo { + type T <: AnyRef; + abstract class I0 { def f(x: T): Unit; f(null); } +} + +object Bug266ATest extends Bug266AFoo { + type T = String; + class I1 extends I0 { def f(x: String): Unit = { System.out.println("hello"); ();} } + def main(args: Array[String]): Unit = { new I1; () } +} + +// version - B + +abstract class Bug266BA { + type t; + abstract class P { + def f(x: t): unit; + } +} + +abstract class Bug266BA1 extends Bug266BA { + def mkP: Bug266BA1.this.P; + val in: t; +} + +class Bug266BB extends Bug266BA { + type t = int; + class P1 extends Bug266BB.this.P { + def f(x: int): unit = System.out.println(x + 1); + } + def mkP = new P1; + val in = 3; +} + +object Bug266BTest with Executable { + val a: Bug266BA1 = new Bug266BA1 with Bug266BB; + a.mkP.f(a.in); +} + +// main + +object Bug266Test { + def main(args: Array[String]): Unit = { + Bug266ATest.main(args); + Bug266BTest.main(args); + } +} + +//############################################################################ // Main object Test { @@ -335,6 +388,7 @@ object Test { test(226, Bug226Test.main(args)); test(233, Bug233Test.main(args)); test(250, Bug250Test.main(args)); + test(266, Bug266Test.main(args)); if (errors > 0) { System.out.println(); |