Skip to content

Commit

Permalink
Merge pull request scala#7855 from diesalbla/merge_find_foreach_map
Browse files Browse the repository at this point in the history
Superaccessors: merge several List method.
  • Loading branch information
retronym authored Mar 12, 2019
2 parents e3c0c10 + 5319a9e commit 3e98d20
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT
if (mix == tpnme.EMPTY && !owner.isTrait) {
// scala/bug#4989 Check if an intermediate class between `clazz` and `owner` redeclares the method as abstract.
val intermediateClasses = clazz.info.baseClasses.tail.takeWhile(_ != owner)
intermediateClasses.map(sym.overridingSymbol).find(s => s.isDeferred && !s.isAbstractOverride && !s.owner.isTrait).foreach {
absSym =>
intermediateClasses.foreach { icls =>
val absSym = sym.overridingSymbol(icls)
if (absSym.isDeferred && !absSym.isAbstractOverride && !absSym.owner.isTrait)
reporter.error(sel.pos, s"${sym.fullLocationString} cannot be directly accessed from $clazz because ${absSym.owner} redeclares it as abstract")
}
}
Expand Down

0 comments on commit 3e98d20

Please sign in to comment.