From dafdd83e7a52383744609736dd879dce8a239d1c Mon Sep 17 00:00:00 2001 From: Fengyun Liu Date: Mon, 9 Sep 2024 14:25:39 +0200 Subject: [PATCH] Avoid stackoverflow in printing internal errors --- compiler/src/dotty/tools/dotc/transform/init/Objects.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/transform/init/Objects.scala b/compiler/src/dotty/tools/dotc/transform/init/Objects.scala index 794144df8528..2c0cd4dfba06 100644 --- a/compiler/src/dotty/tools/dotc/transform/init/Objects.scala +++ b/compiler/src/dotty/tools/dotc/transform/init/Objects.scala @@ -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) @@ -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 @@ -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)