Skip to content

Commit

Permalink
Avoid stackoverflow in printing internal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Sep 9, 2024
1 parent e44c244 commit dafdd83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/transform/init/Objects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class Objects(using Context @constructorOnly):
case Some(theValue) =>
theValue
case _ =>
report.warning("[Internal error] Value not found " + x.show + "\nenv = " + data.show + ". " + Trace.show, Trace.position)
report.warning("[Internal error] Value not found " + x.show + ". " + Trace.show, Trace.position)
Bottom

def getVal(x: Symbol)(using data: Data): Option[Value] = data.getVal(x)
Expand Down Expand Up @@ -1179,7 +1179,7 @@ class Objects(using Context @constructorOnly):
end if
case _ =>
// Only vals can be lazy
report.warning("[Internal error] Variable not found " + sym.show + "\nenv = " + env.show + ". " + Trace.show, Trace.position)
report.warning("[Internal error] Variable not found " + sym.show + ". " + Trace.show, Trace.position)
Bottom
else
given Env.Data = env
Expand Down Expand Up @@ -1230,7 +1230,7 @@ class Objects(using Context @constructorOnly):
else
Heap.writeJoin(addr, value)
case _ =>
report.warning("[Internal error] Variable not found " + sym.show + "\nenv = " + env.show + ". " + Trace.show, Trace.position)
report.warning("[Internal error] Variable not found " + sym.show + ". " + Trace.show, Trace.position)

case _ =>
report.warning("Assigning to variables in outer scope. " + Trace.show, Trace.position)
Expand Down

0 comments on commit dafdd83

Please sign in to comment.