File tree 2 files changed +7
-2
lines changed
compiler/src/dotty/tools/dotc/transform/init
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ object Objects:
252
252
val joinedTrace = data.pendingTraces.slice(index + 1 , data.checkingObjects.size).foldLeft(pendingTrace) { (a, acc) => acc ++ a }
253
253
val callTrace = Trace .buildStacktrace(joinedTrace, " Calling trace:\n " )
254
254
val cycle = data.checkingObjects.slice(index, data.checkingObjects.size)
255
- val pos = clazz.defTree
255
+ val pos = clazz.defTree.sourcePos.focus
256
256
report.warning(" Cyclic initialization: " + cycle.map(_.klass.show).mkString(" -> " ) + " -> " + clazz.show + " . " + callTrace, pos)
257
257
end if
258
258
data.checkingObjects(index)
Original file line number Diff line number Diff line change @@ -49,7 +49,12 @@ object Trace:
49
49
val code = SyntaxHighlighting .highlight(pos.lineContent.trim.nn)
50
50
i " $code\t $loc"
51
51
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
53
58
val positionMarkerLine =
54
59
if pos.exists && pos.source.exists then
55
60
positionMarker(pos)
You can’t perform that action at this time.
0 commit comments