Skip to content

Commit b5d6879

Browse files
b-studiossmarter
andauthored
Apply suggestions from code review
Co-authored-by: Guillaume Martres <smarter@ubuntu.com>
1 parent fe73b0b commit b5d6879

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/typer/RefChecks.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,20 +797,20 @@ object RefChecks {
797797
// validate all base types of a class in reverse linear order.
798798
def register(tp: Type): Unit = {
799799
val baseClass = tp.classSymbol
800-
if (baseClasses contains baseClass) {
800+
if (baseClasses.contains(baseClass)) {
801801
val alreadySeen = seenTypes.getOrElse(baseClass, Nil)
802802
if (!alreadySeen.exists(_ <:< tp))
803803
seenTypes.update(baseClass, tp :: alreadySeen.filterNot(tp <:< _))
804804
}
805-
val remaining = tp.parents filterNot seenParents
805+
val remaining = tp.parents.filterNot(seenParents)
806806
seenParents ++= remaining
807-
remaining foreach register
807+
remaining.foreach(register)
808808
}
809809
register(tpe)
810810

811811
seenTypes.iterator.foreach {
812812
case (cls, Nil) =>
813-
assert(false) // this case should not be reachable
813+
unreachable()
814814
case (cls, _ :: Nil) =>
815815
() // Ok
816816
case (cls, tp1 :: tp2 :: _) =>

0 commit comments

Comments
 (0)