Skip to content

Commit 539c203

Browse files
committed
Avoid NPE when printing TyperStates
1 parent 9a96ce3 commit 539c203

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,6 @@ class TyperState(previous: TyperState /* | Null */) extends DotClass with Showab
165165

166166
override def toText(printer: Printer): Text = constraint.toText(printer)
167167

168-
def hashesStr: String = hashCode.toString + " -> " + previous.hashesStr
168+
def hashesStr: String =
169+
if (previous == null) "" else hashCode.toString + " -> " + previous.hashesStr
169170
}

0 commit comments

Comments
 (0)