From 6965b470d433f501203c4e3d77b0919f826691ba Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Fri, 22 May 2015 16:07:23 +0200 Subject: Enable 440 run tests that pass. Note that some of them may pass due to several bugs that interfere. --- tests/run/valueclasses-pavlov.scala | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/run/valueclasses-pavlov.scala (limited to 'tests/run/valueclasses-pavlov.scala') diff --git a/tests/run/valueclasses-pavlov.scala b/tests/run/valueclasses-pavlov.scala new file mode 100644 index 000000000..6ab5ff3e6 --- /dev/null +++ b/tests/run/valueclasses-pavlov.scala @@ -0,0 +1,26 @@ +trait Foo extends Any { + def box1(x: Box1): String + def box2(x: Box2): String +} + +class Box1(val value: String) extends AnyVal + +class Box2(val value: String) extends AnyVal with Foo { + def box1(x: Box1) = "box1: ok" + def box2(x: Box2) = "box2: ok" +} + +class C(x: String) { + def this() = this("") +} + +object Test { + + def main(args: Array[String]): Unit = { + val b1 = new Box1("") + val b2 = new Box2("") + val f: Foo = b2 + println(f.box1(b1)) + println(f.box2(b2)) + } +} -- cgit v1.2.3