File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
compiler/src/dotty/tools/dotc/transform/init Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,8 @@ object Objects:
163
163
val joinedTrace = data.pendingTraces.slice(index + 1 , data.checkingObjects.size).foldLeft(pendingTrace) { (a, acc) => acc ++ a }
164
164
val callTrace = Trace .buildStacktrace(joinedTrace, " Calling trace:\n " )
165
165
val cycle = data.checkingObjects.slice(index, data.checkingObjects.size)
166
- report.warning(" Cyclic initialization: " + cycle.map(_.show).mkString(" -> " ) + " -> " + clazz.show + " . " + callTrace, clazz.defTree)
166
+ val pos = clazz.defTree.asInstanceOf [TypeDef ].rhs.asInstanceOf [Template ].constr
167
+ report.warning(" Cyclic initialization: " + cycle.map(_.show).mkString(" -> " ) + " -> " + clazz.show + " . " + callTrace, pos)
167
168
else if index == - 1 && data.checkedObjects.indexOf(clazz) == - 1 then
168
169
data.pendingTraces += pendingTrace
169
170
data.checkingObjects += clazz
@@ -527,7 +528,7 @@ object Objects:
527
528
def iterate ()(using Context ): Unit =
528
529
count += 1
529
530
530
- given Trace = Trace .empty.add(classSym.defTree )
531
+ given Trace = Trace .empty.add(tpl.constr )
531
532
given env : Env .Data = Env .empty
532
533
533
534
log(" Iteration " + count) {
You can’t perform that action at this time.
0 commit comments