summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-04-29 14:37:55 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-04-29 14:51:39 +1000
commitfd14b6184250430b826c067bd7f3685d27ba9773 (patch)
tree763e7357a387534943c6538a8af6b0d3638bb218 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
parenteeba018f27487e161de93d93c01cb8b2d8132f8f (diff)
downloadscala-fd14b6184250430b826c067bd7f3685d27ba9773.tar.gz
scala-fd14b6184250430b826c067bd7f3685d27ba9773.tar.bz2
scala-fd14b6184250430b826c067bd7f3685d27ba9773.zip
SI-9285 Don't warn about non-sensible equals in synthetic methods
Notably, in the synthetic equals method of a case class. Otherwise, we get an unsuppressable warning when defining a case class with a `Unit`-typed parameter, which some folks use a placeholder for real type while evolving a design.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index a3a4c70d1e..4b30b4e436 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -1122,7 +1122,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans
}
/** Sensibility check examines flavors of equals. */
def checkSensible(pos: Position, fn: Tree, args: List[Tree]) = fn match {
- case Select(qual, name @ (nme.EQ | nme.NE | nme.eq | nme.ne)) if args.length == 1 && isObjectOrAnyComparisonMethod(fn.symbol) =>
+ case Select(qual, name @ (nme.EQ | nme.NE | nme.eq | nme.ne)) if args.length == 1 && isObjectOrAnyComparisonMethod(fn.symbol) && !currentOwner.isSynthetic =>
checkSensibleEquals(pos, qual, name, fn.symbol, args.head)
case _ =>
}