Skip to content

Commit 2790df9

Browse files
committed
Remove Toolbox.make parameterless variant
Bail out on trying to figure out the class loader and force the user to provide it. As it was done in Scala 2.
1 parent 33bc26a commit 2790df9

File tree

80 files changed

+91
-136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+91
-136
lines changed

compiler/test-resources/repl/i6007

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
scala> implicit def toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
2-
def toolbox: quoted.Toolbox
1+
scala> implicit def toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)def toolbox: quoted.Toolbox
32
scala> val v = '{ (if true then Some(1) else None).map(v => v+1) }
43
val v: quoted.Expr[Option[Int]] = Expr(<pickled tasty>)
54
scala> v.show

library/src/scala/quoted/Toolbox.scala

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package scala.quoted
22

33
import scala.annotation.implicitNotFound
44

5-
@implicitNotFound("Could not find implicit quoted.Toolbox.\n\nDefault toolbox can be instantiated with:\n `implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make`\n\n")
5+
@implicitNotFound("Could not find implicit quoted.Toolbox.\n\nDefault toolbox can be instantiated with:\n `implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)`\n\n")
66
trait Toolbox {
77
def run[T](expr: Expr[T]): T
88
def show[T](expr: Expr[T]): String
@@ -11,25 +11,12 @@ trait Toolbox {
1111

1212
object Toolbox {
1313

14-
/** Create a new instance of the toolbox.
15-
*
16-
* This instance of the toolbox tries to recover the classloader of the application based on
17-
* the classloader of the class that call make. This may not always be the correct classloader,
18-
* in which case the classloader must be passed explicitly.
19-
*
20-
* @param settings toolbox settings
21-
* @return A new instance of the toolbox
22-
*/
23-
@forceInline def make(implicit settings: Settings): Toolbox = {
24-
// Get the name of the class at call site
25-
val className = new Throwable().getStackTrace.head.getClassName
26-
// We inline to make forName use the classloader of the class at call site
27-
val clazz = Class.forName(className)
28-
val cl = clazz.getClassLoader
29-
make(cl)
30-
}
31-
3214
/** Create a new instance of the toolbox using the the classloader of the application.
15+
*
16+
* Usuage:
17+
* ```
18+
* implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
19+
* ```
3320
*
3421
* @param appClassloader classloader of the application that generated the quotes
3522
* @param settings toolbox settings

sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/main/scala/hello/Hello.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import scala.quoted._
55

66
object Main {
77

8-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
99

1010
def main(args: Array[String]): Unit = {
11+
1112
val square = stagedPower(2)
1213

1314
assert(Math.pow(3, 2) == square(3))

tests/neg-with-compiler/i5941/macro_1.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ object Lens {
1313
}
1414

1515
def impl[S: Type, T: Type](getter: Expr[S => T])(implicit refl: Reflection): Expr[Lens[S, T]] = {
16+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(this.getClass.getClassLoader)
1617
import refl._
1718
import util._
18-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
19-
2019
// obj.copy(field = value)
2120
def setterBody(obj: Expr[S], value: Expr[T], field: String): Expr[S] =
2221
Term.Select.overloaded(obj.unseal, "copy", Nil, Term.NamedArg(field, value.unseal) :: Nil).seal[S]

tests/neg-with-compiler/quote-run-in-macro-1/quoted_1.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import scala.quoted._
22

33
object Macros {
44

5-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
6-
5+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
76
inline def foo(i: => Int): Int = ${ fooImpl('i) }
87
def fooImpl(i: Expr[Int]): Expr[Int] = {
98
val y: Int = i.run

tests/neg-with-compiler/quote-run-in-macro-2/quoted_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object Macros {
55

66
inline def foo(i: => Int): Int = ${ fooImpl('i) }
77
def fooImpl(i: Expr[Int]): Expr[Int] = {
8-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
99
val y: Int = i.run
1010
y.toExpr
1111
}

tests/neg/tasty-string-interpolator-position-a/Macro_1.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ object FIntepolator {
1313

1414
def apply(strCtxExpr: Expr[StringContext], argsExpr: Expr[Seq[Any]])(implicit reflect: Reflection): Expr[String] = {
1515
import reflect._
16-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
1716
error("there are no parts", strCtxExpr.unseal.underlyingArgument.pos)
1817
'{ ($strCtxExpr).s($argsExpr: _*) }
1918
}

tests/neg/tasty-string-interpolator-position-b/Macro_1.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ object Macro {
1010
}
1111

1212
object FIntepolator {
13-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
14-
13+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
1514
def apply(strCtxExpr: Expr[StringContext], argsExpr: Expr[Seq[Any]])(implicit reflect: Reflection): Expr[String] = {
1615
import reflect._
1716
error("there are no args", argsExpr.unseal.underlyingArgument.pos)

tests/pos-with-compiler/quote-0.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class Test {
3636
${ powerCode(3, '{math.sqrt(2.0)}) }
3737
}
3838

39-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
40-
39+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
4140
program.run
4241
}

tests/pos-with-compiler/quote-assert/quoted_2.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ object Test {
1515
${ assertImpl('{x != 0}) }
1616
}
1717

18-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
19-
18+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
2019
program.run
2120
}

tests/run-with-compiler-custom-args/staged-streams_1.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,7 @@ object Test {
676676
.fold('{0}, ((a: Expr[Int], b : Expr[Int]) => '{ $a + $b }))
677677

678678
def main(args: Array[String]): Unit = {
679-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
680-
679+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
681680
println(test1().run)
682681
println
683682
println(test2().run)

tests/run-with-compiler/i3823-b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Test {
44
def f[T](x: Expr[T])(implicit t: Type[T]) = '{
55
val z: $t = $x
66
}
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
88
println(f('{2})(Type.IntTag).show)
99
}
1010
}

tests/run-with-compiler/i3823-c.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Test {
44
def f[T](x: Expr[T])(implicit t: Type[T]) = '{
55
val z = $x
66
}
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
88
println(f('{2})(Type.IntTag).show)
99
}
1010
}

tests/run-with-compiler/i3823.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Test {
44
def f[T: Type](x: Expr[T])(t: Type[T]) = '{
55
val z: $t = $x
66
}
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
88
println(f('{2})('[Int]).show)
99
}
1010
}

tests/run-with-compiler/i3847-b.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ object Arrays {
1313
}
1414

1515
object Test {
16-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
17-
1816
def main(args: Array[String]): Unit = {
17+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
1918
import Arrays._
2019
implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int}
2120
val arr: Expr[Array[List[Int]]] = Array[List[Int]](List(1, 2, 3)).toExpr

tests/run-with-compiler/i3847.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ object Arrays {
1414

1515
object Test {
1616
def main(args: Array[String]): Unit = {
17+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(this.getClass.getClassLoader)
1718
import Arrays._
1819
implicit val ct: Expr[ClassTag[Int]] = '{ClassTag.Int}
1920
val arr: Expr[Array[Int]] = Array[Int](1, 2, 3).toExpr
20-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
2121
println(arr.show)
2222
}
2323
}

tests/run-with-compiler/i3876-b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import scala.quoted._
22
object Test {
33
def main(args: Array[String]): Unit = {
4-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
4+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
55

66
val x: Expr[Int] = '{3}
77

tests/run-with-compiler/i3876-c.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import scala.quoted._
22
object Test {
33
def main(args: Array[String]): Unit = {
4-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
4+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
55

66
val x: Expr[Int] = '{3}
77

tests/run-with-compiler/i3876-d.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import scala.quoted._
22
object Test {
33
def main(args: Array[String]): Unit = {
4-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
4+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
55

66
val x: Expr[Int] = '{3}
77

tests/run-with-compiler/i3876.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import scala.quoted._
22
object Test {
33
def main(args: Array[String]): Unit = {
4-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
4+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
55

66
val x: Expr[Int] = '{3}
77

tests/run-with-compiler/i3946.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import scala.quoted._
22
object Test {
33
def main(args: Array[String]): Unit = {
4-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
5-
4+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
65
val u: Expr[Unit] = '{}
76
println(u.show)
87
println(u.run)

tests/run-with-compiler/i3947.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947b.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947b2.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947b3.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947c.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947d.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947d2.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947e.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
88

99
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
1010
val lclazz = clazz.toExpr

tests/run-with-compiler/i3947f.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947g.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947i.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i3947j.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import scala.quoted._
44
object Test {
55

66
def main(args: Array[String]): Unit = {
7-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
8-
7+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
98
def test[T: Type](clazz: java.lang.Class[T]): Unit = {
109
val lclazz = clazz.toExpr
1110
val name = '{ ($lclazz).getCanonicalName }

tests/run-with-compiler/i4044a.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted._
22

33
class Foo {
44
def foo: Unit = {
5-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
5+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
66
val e: Expr[Int] = '{3}
77
val q = '{ ${ '{ $e } } }
88
println(q.show)

tests/run-with-compiler/i4044b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object VarRef {
2020

2121
object Test {
2222
def main(args: Array[String]): Unit = {
23-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
23+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
2424
val q = VarRef('{4})(varRef => '{ ${varRef.update('{3})}; ${varRef.expr} })
2525
println(q.show)
2626
}

tests/run-with-compiler/i4044c.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted._
22

33
class Foo {
44
def foo: Unit = {
5-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
5+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
66
val q = '{ ${ '{ ${ '{ 5 } } } } }
77
println(q.show)
88
}

tests/run-with-compiler/i4044d.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted._
22

33
class Foo {
44
def foo: Unit = {
5-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
5+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
66
val a: Expr[Int] = '{3}
77
val q: Expr[Int] = '{
88
val b = 3

tests/run-with-compiler/i4044e.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted._
22

33
class Foo {
44
def foo: Unit = {
5-
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make
5+
implicit val toolbox: scala.quoted.Toolbox = scala.quoted.Toolbox.make(getClass.getClassLoader)
66
val e: Expr[Int] = '{3}
77
val f: Expr[Int] = '{5}
88
val t: Type[Int] = '[Int]

0 commit comments

Comments
 (0)