In the Scala 3 console (or in Scastie), when running the following code:
import scala.quoted._
val a = Expr("Hello")
The following error results:
-- Error: ----------------------------------------------------------------------
1 |val a = Expr("Hello")
| ^
|No given instance of type quoted.Quotes was found for parameter x$3 of method apply in object Expr
1 error found
Is there an additional step that needs to be done to use macros in the console?
It turns out I was misunderstanding the quoting mechanism. In the context of a minimal example to run in the console, the quote should have been spliced before returning it:
The spliced quote can then be evaluated from the console:
The quote, however, can not be evaluated directly, resulting in the former error: