Skip to content

Commit 31afb35

Browse files
committed
don't widen in admitsNull
1 parent d705c1b commit 31afb35

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/src/dotty/tools/dotc/core/NullOpsDecorator.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ object NullOpsDecorator:
5252
}
5353

5454
def admitsNull(using Context): Boolean = {
55-
val widened = self.widenDealias
56-
widened.isNullType || widened.isAny || (widened match
55+
self.isNullType || self.isAny || (self match
5756
case OrType(l, r) => r.admitsNull || l.admitsNull
5857
case AndType(l, r) => r.admitsNull && l.admitsNull
5958
case TypeBounds(lo, hi) => lo.admitsNull

0 commit comments

Comments
 (0)