Skip to content

Commit 3ed3e3f

Browse files
authored
Merge pull request #10031 from som-snytt/issue/trivial-npe
2 parents 1d51c22 + 34093e9 commit 3ed3e3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ trait TypeDiagnostics extends splain.SplainDiagnostics {
531531

532532
// so trivial that it never consumes params
533533
def isTrivial(rhs: Tree): Boolean =
534-
rhs.symbol == Predef_??? || rhs.tpe =:= NothingTpe || (rhs match {
534+
rhs.symbol == Predef_??? || rhs.tpe == null || rhs.tpe =:= NothingTpe || (rhs match {
535535
case Literal(_) => true
536536
case _ => isConstantType(rhs.tpe) || isSingleType(rhs.tpe)
537537
})

0 commit comments

Comments
 (0)