Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/Splicer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ object Splicer {
case _: NoSuchMethodException =>
val msg = em"Could not find method ${clazz.getCanonicalName}.$name with parameters ($paramClasses%, %)"
throw new StopInterpretation(msg, pos)
case MissingClassDefinedInCurrentRun(sym) if ctx.compilationUnit.isSuspendable =>
if (ctx.settings.XprintSuspension.value)
report.echo(i"suspension triggered by a dependency on $sym", pos)
ctx.compilationUnit.suspend() // this throws a SuspendException
}

private def stopIfRuntimeException[T](thunk: => T, method: JLRMethod): T =
Expand Down
5 changes: 5 additions & 0 deletions tests/neg-macros/i13516/Persistance.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import scala.quoted.*
object Persistance:
inline def nameOf(inline e: Any): String = ${ nameOfImpl('e) }
private def nameOfImpl(e: Expr[Any])(using Quotes): Expr[String] = Expr("")
def foo(p: Versioned): Unit = {}
3 changes: 3 additions & 0 deletions tests/neg-macros/i13516/Versioned.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// nopos-error
class Versioned:
def serialize: String = Persistance.nameOf(0)