Skip to content

Commit c052463

Browse files
committed
Take the high bound
1 parent f699811 commit c052463

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

compiler/src/dotty/tools/dotc/transform/CheckUnused.scala

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -905,16 +905,9 @@ object CheckUnused:
905905
def isCanEqual: Boolean =
906906
sym.isOneOf(GivenOrImplicit) && sym.info.finalResultType.baseClasses.exists(_.derivesFrom(defn.CanEqualClass))
907907
def isMarkerTrait: Boolean =
908-
def isEmptyInterface(info: Type): Boolean =
909-
info.allMembers.forall: d =>
910-
val m = d.symbol
911-
!m.isTerm || m.isSelfSym || m.is(Method) && (m.owner == defn.AnyClass || m.owner == defn.ObjectClass)
912-
if sym.isClass then isEmptyInterface(sym.info)
913-
else if sym.is(Deferred) then
914-
sym.info match
915-
case TypeBounds(_, hi) => hi == defn.AnyType || isEmptyInterface(hi)
916-
case _ => true
917-
else false
908+
sym.info.hiBound.allMembers.forall: d =>
909+
val m = d.symbol
910+
!m.isTerm || m.isSelfSym || m.is(Method) && (m.owner == defn.AnyClass || m.owner == defn.ObjectClass)
918911
def isEffectivelyPrivate: Boolean =
919912
sym.is(Private, butNot = ParamAccessor)
920913
|| sym.owner.isAnonymousClass && !sym.isEffectivelyOverride

0 commit comments

Comments
 (0)