summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/transform/CleanUp.scala2
-rw-r--r--test/files/pos/bug3175.scala7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
index 66b66299b9..114f49ad50 100644
--- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala
+++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala
@@ -363,7 +363,7 @@ abstract class CleanUp extends Transform with ast.TreeDSL {
def isArrayMethodSignature =
(methSym.name == nme.length && params.isEmpty) ||
- (methSym.name == nme.update && (structResType.typeSymbol eq UnitClass)) ||
+ (methSym.name == nme.update && (structResType.typeSymbol eq UnitClass) && params.size == 2) ||
(methSym.name == nme.apply && params.size == 1) ||
(methSym.name == nme.clone_ && params.isEmpty)
diff --git a/test/files/pos/bug3175.scala b/test/files/pos/bug3175.scala
new file mode 100644
index 0000000000..89bbf8b5fc
--- /dev/null
+++ b/test/files/pos/bug3175.scala
@@ -0,0 +1,7 @@
+object Test {
+ def f(g:{val update:Unit}) = g.update
+
+ def main(args: Array[String]): Unit = {
+
+ }
+}