scala.quoted.staging.Compiler
See theCompiler companion trait
object Compiler
Attributes
Members list
Type members
Classlikes
Setting of the Compiler instance.
Value members
Concrete methods
Create a new instance of the compiler using the the classloader of the application.
Create a new instance of the compiler using the the classloader of the application.
Usage:
import scala.quoted.staging._
given Compiler =
object Dummy
Compiler.make(Dummy.getClass.getClassLoader)
Note that we use an instance of Dummy
to get the classloader that loaded the application. Any other instance of a class defined in the application would also work. Using a class defined in the standard library should be avoided as it might be loaded by a different classloader.
If the given compiler is defined in one of your classes (e.i. not as a top-level definition), then the compiler can be instantiated with:
given Compiler = Compiler.make(this.getClass.getClassLoader)
Value parameters
- appClassloader
-
classloader of the application that generated the quotes
- settings
-
compiler settings
Attributes
- Returns
-
A new instance of the compiler
In this article