diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/reassignment.check | 13 | ||||
-rw-r--r-- | test/files/neg/reassignment.scala | 7 | ||||
-rw-r--r-- | test/files/neg/t0903.check | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/test/files/neg/reassignment.check b/test/files/neg/reassignment.check new file mode 100644 index 0000000000..f0effd1459 --- /dev/null +++ b/test/files/neg/reassignment.check @@ -0,0 +1,13 @@ +reassignment.scala:2: error: not found: value x + x = 5 + ^ +reassignment.scala:3: error: not found: value y + y := 45 + ^ +reassignment.scala:4: error: not found: value y + y += 45 + ^ +reassignment.scala:6: error: reassignment to val + z = 51 + ^ +four errors found diff --git a/test/files/neg/reassignment.scala b/test/files/neg/reassignment.scala new file mode 100644 index 0000000000..e31eefbf3f --- /dev/null +++ b/test/files/neg/reassignment.scala @@ -0,0 +1,7 @@ +class A { + x = 5 + y := 45 + y += 45 + val z = 50 + z = 51 +}
\ No newline at end of file diff --git a/test/files/neg/t0903.check b/test/files/neg/t0903.check index db4cd94d2c..2dd05cd3ee 100644 --- a/test/files/neg/t0903.check +++ b/test/files/neg/t0903.check @@ -1,4 +1,4 @@ -t0903.scala:3: error: reassignment to val +t0903.scala:3: error: value += is not a member of Int x += 1 ^ t0903.scala:4: error: reassignment to val |