File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ object Objects:
252252 val joinedTrace = data.pendingTraces.slice(index + 1 , data.checkingObjects.size).foldLeft(pendingTrace) { (a, acc) => acc ++ a }
253253 val callTrace = Trace .buildStacktrace(joinedTrace, " Calling trace:\n " )
254254 val cycle = data.checkingObjects.slice(index, data.checkingObjects.size)
255- val pos = clazz.defTree
255+ val pos = clazz.defTree.sourcePos.focus
256256 report.warning(" Cyclic initialization: " + cycle.map(_.klass.show).mkString(" -> " ) + " -> " + clazz.show + " . " + callTrace, pos)
257257 end if
258258 data.checkingObjects(index)
Original file line number Diff line number Diff line change @@ -49,7 +49,12 @@ object Trace:
4949 val code = SyntaxHighlighting .highlight(pos.lineContent.trim.nn)
5050 i " $code\t $loc"
5151 else
52- tree.show
52+ tree match
53+ case defDef : DefTree =>
54+ // The definition can be huge, avoid printing the whole definition.
55+ defDef.symbol.show
56+ case _ =>
57+ tree.show
5358 val positionMarkerLine =
5459 if pos.exists && pos.source.exists then
5560 positionMarker(pos)
You can’t perform that action at this time.
0 commit comments