diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-04 13:16:15 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-04 13:27:10 -0800 |
commit | 513710c5277ef8870ba3f5c7c9bebe40068ce4af (patch) | |
tree | dd2f02d2c504ed7a137134219c200817ddd78eba /test | |
parent | 6abac73c21275bd6b202ffcfc9193110bcc9a1f9 (diff) | |
download | scala-513710c5277ef8870ba3f5c7c9bebe40068ce4af.tar.gz scala-513710c5277ef8870ba3f5c7c9bebe40068ce4af.tar.bz2 scala-513710c5277ef8870ba3f5c7c9bebe40068ce4af.zip |
Simple test manipulating Any-derived traits.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/trait-parents.scala | 16 |
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 { }) + } +} |