Skip to content

Commit 0fd4aae

Browse files
Backport "Disable i19170b on Windows" to LTS (#20840)
Backports #19471 to the LTS branch. PR submitted by the release tooling. [skip ci]
2 parents d1041f6 + 6714d39 commit 0fd4aae

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

staging/src/scala/quoted/staging/QuoteDriver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private class QuoteDriver(appClassloader: ClassLoader) extends Driver:
5656
try method.invoke(inst).asInstanceOf[T]
5757
catch case ex: java.lang.reflect.InvocationTargetException =>
5858
ex.getCause match
59-
case ex: java.lang.NoClassDefFoundError =>
59+
case _: java.lang.NoClassDefFoundError =>
6060
throw new Exception(
6161
s"""`scala.quoted.staging.run` failed to load a class.
6262
|The classloader used for the `staging.Compiler` instance might not be the correct one.

tests/run-staging/i19170b.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ class A(i: Int)
88
def f(i: Expr[Int])(using Quotes): Expr[A] = { '{ new A($i) } }
99

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

0 commit comments

Comments
 (0)