From 55c6ad4f8a191e691efdbee0a1bbddc4efb66f35 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Tue, 28 Jun 2016 16:20:10 -0400 Subject: 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. --- test/files/neg/t9834.scala | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/files/neg/t9834.scala (limited to 'test/files/neg/t9834.scala') diff --git a/test/files/neg/t9834.scala b/test/files/neg/t9834.scala new file mode 100644 index 0000000000..1ecda7a2b8 --- /dev/null +++ b/test/files/neg/t9834.scala @@ -0,0 +1,6 @@ + +object x { def apply() = 42 ; def update(i: Int) = () } + +trait Test { + x() += "42" +} -- cgit v1.2.3