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
2 changes: 1 addition & 1 deletion staging/src/scala/quoted/staging/QuoteDriver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private class QuoteDriver(appClassloader: ClassLoader) extends Driver:
try method.invoke(inst).asInstanceOf[T]
catch case ex: java.lang.reflect.InvocationTargetException =>
ex.getCause match
case ex: java.lang.NoClassDefFoundError =>
case _: java.lang.NoClassDefFoundError =>
throw new Exception(
s"""`scala.quoted.staging.run` failed to load a class.
|The classloader used for the `staging.Compiler` instance might not be the correct one.
Expand Down
11 changes: 6 additions & 5 deletions tests/run-staging/i19170b.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ class A(i: Int)
def f(i: Expr[Int])(using Quotes): Expr[A] = { '{ new A($i) } }

@main def Test = {
try
val g: Int => A = staging.run { '{ (i: Int) => ${ f('{i}) } } }
println(g(3))
catch case ex: Exception =>
assert(ex.getMessage().startsWith("`scala.quoted.staging.run` failed to load a class."))
if !System.getProperty("os.name").contains("Windows") then
try
val g: Int => A = staging.run { '{ (i: Int) => ${ f('{i}) } } }
println(g(3))
catch case ex: Exception =>
assert(ex.getMessage().startsWith("`scala.quoted.staging.run` failed to load a class."), ex.getMessage())
}