summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 55728ec70f..5485c4ccc4 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -563,7 +563,8 @@ abstract class RefChecks extends InfoTransform {
!(receiver isSubClass actual) && receiver != AllRefClass && actual != AllRefClass &&
(name == nme.EQ || name == nme.LE))
nonSensible("non-null ", false)
- else if ((isNew(qual) || isNew(args.head)) && hasObjectEquals)
+ else if ((isNew(qual) || isNew(args.head)) && hasObjectEquals &&
+ (name == nme.EQ || name == nme.NE))
nonSensibleWarning("a fresh object", false)
case _ =>
}