From 513710c5277ef8870ba3f5c7c9bebe40068ce4af Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 4 Feb 2012 13:16:15 -0800 Subject: Simple test manipulating Any-derived traits. --- test/files/pos/trait-parents.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/files/pos/trait-parents.scala diff --git a/test/files/pos/trait-parents.scala b/test/files/pos/trait-parents.scala new file mode 100644 index 0000000000..f6a2688751 --- /dev/null +++ b/test/files/pos/trait-parents.scala @@ -0,0 +1,16 @@ +trait Bip extends Any +trait Foo extends Any +trait Bar extends AnyRef +trait Quux + +object Test { + def f(x: Bip) = 1 + def g1(x: Foo with Bip) = f(x) + + def main(args: Array[String]): Unit = { + f(new Bip with Foo { }) + f(new Foo with Bip { }) + g1(new Bip with Foo { }) + g1(new Foo with Bip { }) + } +} -- cgit v1.2.3