diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t5358.check | 7 | ||||
-rw-r--r-- | test/files/neg/t5358.scala | 4 | ||||
-rw-r--r-- | test/pending/pos/bug4704.scala | 36 | ||||
-rw-r--r-- | test/pending/run/bug4704run.scala | 10 |
4 files changed, 57 insertions, 0 deletions
diff --git a/test/files/neg/t5358.check b/test/files/neg/t5358.check new file mode 100644 index 0000000000..59e83bba2f --- /dev/null +++ b/test/files/neg/t5358.check @@ -0,0 +1,7 @@ +t5358.scala:3: error: class C inherits conflicting members: + method hi in trait A of type => String and + method hi in trait B of type => String +(Note: this can be resolved by declaring an override in class C.) +class C extends A with B + ^ +one error found diff --git a/test/files/neg/t5358.scala b/test/files/neg/t5358.scala new file mode 100644 index 0000000000..13d827ed82 --- /dev/null +++ b/test/files/neg/t5358.scala @@ -0,0 +1,4 @@ +trait A { def hi = "A" } +trait B { def hi = "B" } +class C extends A with B + diff --git a/test/pending/pos/bug4704.scala b/test/pending/pos/bug4704.scala new file mode 100644 index 0000000000..6af719adf7 --- /dev/null +++ b/test/pending/pos/bug4704.scala @@ -0,0 +1,36 @@ +trait Bar { + def f1 = super.hashCode + def f2 = super[Object].hashCode + def f3 = super[ScalaObject].hashCode + + override def hashCode = 1 +} +trait Barzoo { + def g1 = super.hashCode + def g2 = super[Object].hashCode + def g3 = super[ScalaObject].hashCode + + override def hashCode = 2 +} + +trait Foo extends Bar with Barzoo { + def f4 = super.hashCode + def f5 = super[Object].hashCode + def f6 = super[ScalaObject].hashCode + def f6b = super[Bar].hashCode + def g4 = super[Barzoo].hashCode + + override def hashCode = super[Bar].hashCode + super[Barzoo].hashCode +} + +class Quux extends Foo { + override def hashCode = super.hashCode + super[Object].hashCode + super[ScalaObject].hashCode + super[Foo].hashCode +} + +trait Borp extends Quux { + def f12 = super.hashCode + def f14 = super[ScalaObject].hashCode + def f15 = super[Quux].hashCode + override def hashCode = super[Quux].hashCode +} + diff --git a/test/pending/run/bug4704run.scala b/test/pending/run/bug4704run.scala new file mode 100644 index 0000000000..af488a56c7 --- /dev/null +++ b/test/pending/run/bug4704run.scala @@ -0,0 +1,10 @@ +trait MM { + protected def method = "bip" +} +trait NN { + protected def method = "bop" +} +trait OOOOO extends MM with NN { + override protected def method = super[MM].method + super[NN].method + override def hashCode = super[MM].hashCode + super[NN].hashCode +} |