diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-25 14:49:58 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-11-26 09:28:48 +0100 |
commit | 03ec379926f1f900f09c50dd038fba86feae70f6 (patch) | |
tree | 8c9d90da8aab560ae249f059b6663327d713fac4 /src | |
parent | 5733684a4ec6857ece1048d56654dcd749163510 (diff) | |
download | dotty-03ec379926f1f900f09c50dd038fba86feae70f6.tar.gz dotty-03ec379926f1f900f09c50dd038fba86feae70f6.tar.bz2 dotty-03ec379926f1f900f09c50dd038fba86feae70f6.zip |
Fix of intersection not empty
The bug caused new version of FirstTransform to compile with errors.
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/typer/RefChecks.scala | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/RefChecks.scala b/src/dotty/tools/dotc/typer/RefChecks.scala index 6995076c5..39f71811a 100644 --- a/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/src/dotty/tools/dotc/typer/RefChecks.scala @@ -222,8 +222,10 @@ object RefChecks { } /* Is the intersection between given two lists of overridden symbols empty? */ - def intersectionIsEmpty(syms1: Iterator[Symbol], syms2: Iterator[Symbol]) = - !(syms1 exists (syms2 contains _)) + def intersectionIsEmpty(syms1: Iterator[Symbol], syms2: Iterator[Symbol]) = { + val set2 = syms2.toSet + !(syms1 exists (set2 contains _)) + } // o: public | protected | package-protected (aka java's default access) // ^-may be overridden by member with access privileges-v @@ -274,6 +276,8 @@ object RefChecks { !(member.owner.thisType.baseClasses exists (_ isSubClass other.owner)) && !member.is(Deferred) && !other.is(Deferred) && intersectionIsEmpty(member.extendedOverriddenSymbols, other.extendedOverriddenSymbols)) { + println(i"${member.extendedOverriddenSymbols.toList.map(_.showLocated)}%, %") + println(i"${other.extendedOverriddenSymbols.toList.map(_.showLocated)}%, %") overrideError("cannot override a concrete member without a third member that's overridden by both " + "(this rule is designed to prevent ``accidental overrides'')") } else if (other.isStable && !member.isStable) { // (1.4) |