From 436f141d21db0b5fa88adc9ada7059e992be58cc Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 13 Feb 2012 09:02:38 +0100 Subject: Added missing files from last commit --- test/files/neg/anytrait.check | 7 +++++++ test/files/neg/anytrait.scala | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/files/neg/anytrait.check create mode 100644 test/files/neg/anytrait.scala (limited to 'test/files/neg') diff --git a/test/files/neg/anytrait.check b/test/files/neg/anytrait.check new file mode 100644 index 0000000000..99c24b85a0 --- /dev/null +++ b/test/files/neg/anytrait.check @@ -0,0 +1,7 @@ +anytrait.scala:3: error: this statement is not allowed in trait extending from class Any: private[this] var x: Int = 1 + var x = 1 + ^ +anytrait.scala:5: error: this statement is not allowed in trait extending from class Any: T.this.x_=(T.this.x.+(1)) + { x += 1 } + ^ +two errors found diff --git a/test/files/neg/anytrait.scala b/test/files/neg/anytrait.scala new file mode 100644 index 0000000000..1501486105 --- /dev/null +++ b/test/files/neg/anytrait.scala @@ -0,0 +1,10 @@ +trait T extends Any { + + var x = 1 + + { x += 1 } + + type T = Int + + val y: T +} -- cgit v1.2.3