From 90f430bfb9178e49dc112bacf5b250d0780dcd1e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 16 Mar 2014 21:42:10 +0100 Subject: More tests which all pass. --- tests/pos/t0904.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/pos/t0904.scala (limited to 'tests/pos/t0904.scala') diff --git a/tests/pos/t0904.scala b/tests/pos/t0904.scala new file mode 100644 index 000000000..28ad30fc2 --- /dev/null +++ b/tests/pos/t0904.scala @@ -0,0 +1,17 @@ +trait A { + def apply(x: Int): Int + def update(x: Int, y: Int): Unit +} + +trait B extends A + +abstract class Foo { + val a: A = null + val b: B = null + + a(0) = 1 + b(0) = 1 + + a(0) += 1 + b(0) += 1 // this one does not type check. +} -- cgit v1.2.3