@@ -300,7 +300,7 @@ object RefChecks {
300
300
overrideError(" cannot be used here - class definitions cannot be overridden" )
301
301
} else if (! other.is(Deferred ) && member.isClass) {
302
302
overrideError(" cannot be used here - classes can only override abstract types" )
303
- } else if (other.isEffectivelyFinal) { // (1.2)
303
+ } else if (other.isEffectivelyFinal && ! isIgnorable(member) ) { // (1.2)
304
304
overrideError(i " cannot override final member ${other.showLocated}" )
305
305
} else if (! other.is(Deferred ) &&
306
306
! isDefaultGetter(other.name) &&
@@ -314,7 +314,7 @@ object RefChecks {
314
314
clazz + " inherits conflicting members:\n "
315
315
+ infoStringWithLocation(other) + " and\n " + infoStringWithLocation(member)
316
316
+ " \n (Note: this can be resolved by declaring an override in " + clazz + " .)" )
317
- else
317
+ else if ( ! isIgnorable(member))
318
318
overrideError(" needs `override' modifier" )
319
319
} else if (other.is(AbsOverride ) && other.isIncompleteIn(clazz) && ! member.is(AbsOverride )) {
320
320
overrideError(" needs `abstract override' modifiers" )
@@ -640,6 +640,13 @@ object RefChecks {
640
640
}
641
641
}
642
642
643
+ /** Ignore `==' entries in EqClass; they clash with `final` entries in `Any` */
644
+ private def isIgnorable (sym : Symbol )(implicit ctx : Context ) = {
645
+ val res = sym.owner == defn.EqClassClass
646
+ if (! res) println(i " not ignorable: ${sym.owner} / ${defn.EqClassClass }" )
647
+ res
648
+ }
649
+
643
650
// Note: if a symbol has both @deprecated and @migration annotations and both
644
651
// warnings are enabled, only the first one checked here will be emitted.
645
652
// I assume that's a consequence of some code trying to avoid noise by suppressing
0 commit comments