diff options
author | Som Snytt <som.snytt@gmail.com> | 2016-06-28 16:20:10 -0400 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2016-11-25 13:24:06 -0800 |
commit | 55c6ad4f8a191e691efdbee0a1bbddc4efb66f35 (patch) | |
tree | d92698009f8e07b4c9540de9f7e3ac37b4ad62f7 /test/files/neg/t8763.scala | |
parent | 35f8908c214b5458ffe32c782dc81055773f5fb4 (diff) | |
download | scala-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.scala | 11 |
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 + } +} |