Skip to content

Commit f780a37

Browse files
committed
Make isBottomType work for derives types as well.
1 parent a2f0fc1 commit f780a37

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,7 @@ class Definitions {
589589
}
590590

591591
def isBottomClass(cls: Symbol) = cls == NothingClass || cls == NullClass
592-
def isBottomType(tp: Type) = tp match {
593-
case tp: TypeRef => isBottomClass(tp.symbol)
594-
case _ => false
595-
}
592+
def isBottomType(tp: Type) = tp.derivesFrom(NothingClass) || tp.derivesFrom(NullClass)
596593

597594
def isFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.Function)
598595
def isAbstractFunctionClass(cls: Symbol) = isVarArityClass(cls, tpnme.AbstractFunction)

0 commit comments

Comments
 (0)