Skip to content

Commit 38784ab

Browse files
oderskyliufengyun
authored andcommitted
Add debug output to track down problem compiling ScalaTest
1 parent 81a29f2 commit 38784ab

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

compiler/src/dotty/tools/dotc/CompilationUnit.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import dotty.tools.dotc.core.SymDenotations.ClassDenotation
1010
import dotty.tools.dotc.core.Symbols._
1111
import dotty.tools.dotc.transform.SymUtils._
1212
import util.{NoSource, SourceFile}
13+
import core.Decorators._
1314

1415
class CompilationUnit protected (val source: SourceFile) {
1516

@@ -36,6 +37,7 @@ class CompilationUnit protected (val source: SourceFile) {
3637

3738
def suspend()(given ctx: Context): Nothing =
3839
if !suspended then
40+
println(i"suspended: $this")
3941
suspended = true
4042
ctx.run.suspendedUnits += this
4143
throw CompilationUnit.SuspendException()

compiler/src/dotty/tools/dotc/typer/Inliner.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
12431243
for sym <- dependencies do
12441244
if ctx.compilationUnit.source.file == sym.associatedFile then
12451245
ctx.error(em"Cannot call macro $sym defined in the same source file", body.sourcePos)
1246+
println(i"suspension triggered by macro call to ${sym.showLocated} in ${sym.associatedFile}")
12461247
ctx.compilationUnit.suspend() // this throws a SuspendException
12471248

12481249
val evaluatedSplice = Splicer.splice(body, inlinedFrom.sourcePos, MacroClassLoader.fromContext)(ctx1)

0 commit comments

Comments
 (0)