summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala2
-rw-r--r--test/files/pos/t9285.flags1
-rw-r--r--test/files/pos/t9285.scala1
3 files changed, 3 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 _ =>
}
diff --git a/test/files/pos/t9285.flags b/test/files/pos/t9285.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/pos/t9285.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/pos/t9285.scala b/test/files/pos/t9285.scala
new file mode 100644
index 0000000000..b7146cdf1c
--- /dev/null
+++ b/test/files/pos/t9285.scala
@@ -0,0 +1 @@
+case class C(placeholder: Unit)