diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2009-12-04 14:34:04 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2009-12-04 14:34:04 +0000 |
commit | a41307b3eaa6448dec49f4c9d20f04103eb73193 (patch) | |
tree | 45ce9d051cc6c839ae9ba6e282d5b77c4b1cdc31 | |
parent | e7d2120beeb847ce7db9cc5f65ec168e58f17efb (diff) | |
download | scala-a41307b3eaa6448dec49f4c9d20f04103eb73193.tar.gz scala-a41307b3eaa6448dec49f4c9d20f04103eb73193.tar.bz2 scala-a41307b3eaa6448dec49f4c9d20f04103eb73193.zip |
Added new test, see #2754
-rw-r--r-- | test/files/run/t2754.scala | 39 |
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 } +} |