summaryrefslogtreecommitdiff
path: root/test/files/neg/t8763.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-06-28 16:20:10 -0400
committerSom Snytt <som.snytt@gmail.com>2016-11-25 13:24:06 -0800
commit55c6ad4f8a191e691efdbee0a1bbddc4efb66f35 (patch)
treed92698009f8e07b4c9540de9f7e3ac37b4ad62f7 /test/files/neg/t8763.scala
parent35f8908c214b5458ffe32c782dc81055773f5fb4 (diff)
downloadscala-55c6ad4f8a191e691efdbee0a1bbddc4efb66f35.tar.gz
scala-55c6ad4f8a191e691efdbee0a1bbddc4efb66f35.tar.bz2
scala-55c6ad4f8a191e691efdbee0a1bbddc4efb66f35.zip
SI-9834 Improve error on failed op=
If rewriting `x += y` fails to typecheck, emit error messages for both the original tree and the assignment. If rewrite is not attempted because `x` is a val, then say so. The error message at `tree.pos` is updated with the additional advice. SI-8763 Crash in update conversion When there are already errors, don't attempt mechanical rewrites.
Diffstat (limited to 'test/files/neg/t8763.scala')
-rw-r--r--test/files/neg/t8763.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/neg/t8763.scala b/test/files/neg/t8763.scala
new file mode 100644
index 0000000000..08ce1b471a
--- /dev/null
+++ b/test/files/neg/t8763.scala
@@ -0,0 +1,11 @@
+
+import collection.mutable
+
+object Foo {
+ def bar() {
+ val names_times = mutable.Map[String, mutable.Set[Long]]()
+ val line = ""
+ val Array(fields) = line.split("\t")
+ names_times(fields(0)) += fields(1).toLong
+ }
+}