diff options
author | Paul Phillips <paulp@improving.org> | 2010-03-14 07:25:15 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-03-14 07:25:15 +0000 |
commit | 08437bb245349c347ff1072010bfa8dc00a76256 (patch) | |
tree | 556f9d3e61787908cbedcc1e4175c32aa9d5e8ce | |
parent | 605b7c5aeb1b513f1cc9d55819c39412443d0dfa (diff) | |
download | scala-08437bb245349c347ff1072010bfa8dc00a76256.tar.gz scala-08437bb245349c347ff1072010bfa8dc00a76256.tar.bz2 scala-08437bb245349c347ff1072010bfa8dc00a76256.zip |
Tighten update check in cleanup.
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/CleanUp.scala | 2 | ||||
-rw-r--r-- | test/files/pos/bug3175.scala | 7 |
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 = { + + } +} |