Skip to content

Fix #651 Generalize criterion for isOpAssign #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/ast/TreeInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this modification intentional? it makes thus test not cover += operation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that was an oversight.

s = s + ("D", "E", "F")
s ++= List("G", "H", "I")
s ++= ('J' to 'Z') map (_.toString)
assert(s forall (s contains))
Expand Down