Skip to content

Commit

Permalink
Disable i19170b on Windows
Browse files Browse the repository at this point in the history
[Cherry-picked a7f514a]
  • Loading branch information
nicolasstucki authored and WojciechMazur committed Jun 27, 2024
1 parent fb8f8df commit 6714d39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
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())
}

0 comments on commit 6714d39

Please sign in to comment.