summaryrefslogtreecommitdiff
path: root/test/files/run/t2754.scala
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2009-12-04 14:34:04 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2009-12-04 14:34:04 +0000
commita41307b3eaa6448dec49f4c9d20f04103eb73193 (patch)
tree45ce9d051cc6c839ae9ba6e282d5b77c4b1cdc31 /test/files/run/t2754.scala
parente7d2120beeb847ce7db9cc5f65ec168e58f17efb (diff)
downloadscala-a41307b3eaa6448dec49f4c9d20f04103eb73193.tar.gz
scala-a41307b3eaa6448dec49f4c9d20f04103eb73193.tar.bz2
scala-a41307b3eaa6448dec49f4c9d20f04103eb73193.zip
Added new test, see #2754
Diffstat (limited to 'test/files/run/t2754.scala')
-rw-r--r--test/files/run/t2754.scala39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/files/run/t2754.scala b/test/files/run/t2754.scala
new file mode 100644
index 0000000000..14c4f31e59
--- /dev/null
+++ b/test/files/run/t2754.scala
@@ -0,0 +1,39 @@
+object Main {
+ def main(args: Array[String]) {
+ val v: FooBarPlus[Int] = new FooBarPlusImpl()
+ v.foo += 10
+ }
+}
+
+trait Foo[P] {
+ def foo: P
+}
+
+trait FooBar[P] extends Foo[P] {
+ def bar: P
+}
+
+trait FooBarPlus[P] extends FooBar[P] {
+ override def foo: P
+ override def bar: P
+
+ def foo_=(x: P)
+ def bar_=(x: P)
+}
+
+class FooImpl extends Foo[Int] {
+ def foo = 1
+}
+
+class FooBarImpl extends FooImpl with FooBar[Int] {
+ protected var f = 0
+ protected var b = 0
+
+ override def foo = f
+ def bar = b
+}
+
+class FooBarPlusImpl extends FooBarImpl with FooBarPlus[Int] {
+ def foo_=(x: Int) { f = x }
+ def bar_=(x: Int) { b = x }
+}