aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-15 17:31:02 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-15 17:31:11 +0200
commit495b07ea1509a1bf3a7091f9fc0a95fccf1b183e (patch)
tree9d4177c0ec20eb50ef38c393f4ff289def73c2f0
parentae8a24638551913a60097a5a07c74f5e98e43af0 (diff)
downloaddotty-495b07ea1509a1bf3a7091f9fc0a95fccf1b183e.tar.gz
dotty-495b07ea1509a1bf3a7091f9fc0a95fccf1b183e.tar.bz2
dotty-495b07ea1509a1bf3a7091f9fc0a95fccf1b183e.zip
Fix #651 Generalize criterion for isOpAssign
Methods like + can have multiple parameters. In that case += also takes multiple parameters.
-rw-r--r--src/dotty/tools/dotc/ast/TreeInfo.scala2
-rw-r--r--tests/run/colltest1.check (renamed from tests/pending/run/colltest1.check)0
-rw-r--r--tests/run/colltest1.scala (renamed from tests/pending/run/colltest1.scala)3
3 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/ast/TreeInfo.scala b/src/dotty/tools/dotc/ast/TreeInfo.scala
index 2f6b6b914..6401c01c1 100644
--- a/src/dotty/tools/dotc/ast/TreeInfo.scala
+++ b/src/dotty/tools/dotc/ast/TreeInfo.scala
@@ -33,7 +33,7 @@ trait TreeInfo[T >: Untyped <: Type] { self: Trees.Instance[T] =>
}
def isOpAssign(tree: Tree) = unsplice(tree) match {
- case Apply(fn, _ :: Nil) =>
+ case Apply(fn, _ :: _) =>
unsplice(fn) match {
case Select(_, name) if name.isOpAssignmentName => true
case _ => false
diff --git a/tests/pending/run/colltest1.check b/tests/run/colltest1.check
index 5ec6286d9..5ec6286d9 100644
--- a/tests/pending/run/colltest1.check
+++ b/tests/run/colltest1.check
diff --git a/tests/pending/run/colltest1.scala b/tests/run/colltest1.scala
index 3f1fe5530..1fd1a4bb9 100644
--- a/tests/pending/run/colltest1.scala
+++ b/tests/run/colltest1.scala
@@ -139,7 +139,8 @@ object Test extends dotty.runtime.LegacyApp {
def setTest(empty: => Set[String]): Unit = {
var s = empty + "A" + "B" + "C"
- s += ("D", "E", "F")
+ s += "D"
+ s = s + ("D", "E", "F")
s ++= List("G", "H", "I")
s ++= ('J' to 'Z') map (_.toString)
assert(s forall (s contains))