File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -222,8 +222,10 @@ object RefChecks {
222
222
}
223
223
224
224
/* Is the intersection between given two lists of overridden symbols empty? */
225
- def intersectionIsEmpty (syms1 : Iterator [Symbol ], syms2 : Iterator [Symbol ]) =
226
- ! (syms1 exists (syms2 contains _))
225
+ def intersectionIsEmpty (syms1 : Iterator [Symbol ], syms2 : Iterator [Symbol ]) = {
226
+ val set2 = syms2.toSet
227
+ ! (syms1 exists (set2 contains _))
228
+ }
227
229
228
230
// o: public | protected | package-protected (aka java's default access)
229
231
// ^-may be overridden by member with access privileges-v
@@ -274,6 +276,8 @@ object RefChecks {
274
276
! (member.owner.thisType.baseClasses exists (_ isSubClass other.owner)) &&
275
277
! member.is(Deferred ) && ! other.is(Deferred ) &&
276
278
intersectionIsEmpty(member.extendedOverriddenSymbols, other.extendedOverriddenSymbols)) {
279
+ println(i " ${member.extendedOverriddenSymbols.toList.map(_.showLocated)}%, % " )
280
+ println(i " ${other.extendedOverriddenSymbols.toList.map(_.showLocated)}%, % " )
277
281
overrideError(" cannot override a concrete member without a third member that's overridden by both " +
278
282
" (this rule is designed to prevent ``accidental overrides'')" )
279
283
} else if (other.isStable && ! member.isStable) { // (1.4)
You can’t perform that action at this time.
0 commit comments