From edf7c7a74b6a4c09fce5f99cd237f3a19d365abd Mon Sep 17 00:00:00 2001 From: paltherr Date: Wed, 7 Jan 2004 17:59:10 +0000 Subject: - Added bug 266 --- test/files/run/bugs.check | 5 +++++ test/files/run/bugs.scala | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) (limited to 'test/files/run') 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 @@ -294,6 +294,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 @@ -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(); -- cgit v1.2.3