summaryrefslogtreecommitdiff
path: root/test/files/pos/trait-parents.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-04 13:16:15 -0800
committerPaul Phillips <paulp@improving.org>2012-02-04 13:27:10 -0800
commit513710c5277ef8870ba3f5c7c9bebe40068ce4af (patch)
treedd2f02d2c504ed7a137134219c200817ddd78eba /test/files/pos/trait-parents.scala
parent6abac73c21275bd6b202ffcfc9193110bcc9a1f9 (diff)
downloadscala-513710c5277ef8870ba3f5c7c9bebe40068ce4af.tar.gz
scala-513710c5277ef8870ba3f5c7c9bebe40068ce4af.tar.bz2
scala-513710c5277ef8870ba3f5c7c9bebe40068ce4af.zip
Simple test manipulating Any-derived traits.
Diffstat (limited to 'test/files/pos/trait-parents.scala')
-rw-r--r--test/files/pos/trait-parents.scala16
1 files changed, 16 insertions, 0 deletions
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 { })
+ }
+}