@@ -1038,22 +1038,25 @@ class Inliner(val call: tpd.Tree)(using Context):
10381038 val inlinedFrom = enclosingInlineds.last
10391039 val dependencies = macroDependencies(body)(using spliceContext)
10401040 val suspendable = ctx.compilationUnit.isSuspendable
1041+ val printSuspensions = ctx.settings.XprintSuspension .value
10411042 if dependencies.nonEmpty && ! ctx.reporter.errorsReported then
1043+ val hints : mutable.ListBuffer [String ] | Null =
1044+ if printSuspensions then mutable.ListBuffer .empty[String ] else null
10421045 for sym <- dependencies do
10431046 if ctx.compilationUnit.source.file == sym.associatedFile then
10441047 report.error(em " Cannot call macro $sym defined in the same source file " , call.srcPos)
10451048 else if ctx.settings.YnoSuspendedUnits .value then
10461049 val addendum = " , suspension prevented by -Yno-suspended-units"
10471050 report.error(em " Cannot call macro $sym defined in the same compilation run $addendum" , call.srcPos)
1048- if ( suspendable && ctx.settings. XprintSuspension .value)
1049- report.echo( i " suspension triggered by macro call to ${sym.showLocated} in ${sym.associatedFile}" , call.srcPos)
1051+ if suspendable && printSuspensions then
1052+ hints.nn += i " suspension triggered by macro call to ${sym.showLocated} in ${sym.associatedFile}"
10501053 if suspendable then
10511054 if ctx.settings.YnoSuspendedUnits .value then
10521055 return ref(defn.Predef_undefined )
10531056 .withType(ErrorType (em " could not expand macro, suspended units are disabled by -Yno-suspended-units " ))
10541057 .withSpan(splicePos.span)
10551058 else
1056- ctx.compilationUnit.suspend() // this throws a SuspendException
1059+ ctx.compilationUnit.suspend(hints.nn.toList.mkString( " , " ) ) // this throws a SuspendException
10571060
10581061 val evaluatedSplice = inContext(quoted.MacroExpansion .context(inlinedFrom)) {
10591062 Splicer .splice(body, splicePos, inlinedFrom.srcPos, MacroClassLoader .fromContext)
0 commit comments