Skip to content

Commit 83a01b8

Browse files
committed
Remove null checks
1 parent 702c485 commit 83a01b8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,7 @@ trait TreeInfo[T <: Untyped] { self: Trees.Instance[T] =>
443443
(sym == receiver.symbol) || {
444444
receiver match {
445445
case Apply(_, _) => op.isOpAssignmentName // xs(i) += x
446-
case _ => receiver.symbol != null &&
447-
(receiver.symbol.isGetter || receiver.symbol.isField) // xs.addOne(x) for var xs
446+
case _ => receiver.symbol.isGetter || receiver.symbol.isField // xs.addOne(x) for var xs
448447
}
449448
}
450449
@tailrec def loop(mt: Type): Boolean = mt match {
@@ -457,7 +456,7 @@ trait TreeInfo[T <: Untyped] { self: Trees.Instance[T] =>
457456
case PolyType(_, restpe) => loop(restpe)
458457
case _ => false
459458
}
460-
fun.symbol != null && loop(fun.symbol.info)
459+
loop(fun.symbol.info)
461460
}
462461
case _ =>
463462
tree.tpe.isInstanceOf[ThisType]

0 commit comments

Comments
 (0)