QuoteContext
extends ObjectQuotation context provided by a macro expansion or in the scope of scala.quoted.run
.
Used to perform all operations on quoted Expr
or Type
.
It contains the low-level Typed AST API tasty
meta-programming API.
This API does not have the static type guarantiees that Expr
and Type
provide.
Supertypes
ObjectConstructors
QuoteContext
( tasty: Reflection )QuoteContext
( )Members
NestedContext
= QuoteContextType of a QuoteContext profided by a splice within a quote that took this context. It is only required if working with the reflection API.
Usually it is...
Type of a QuoteContext profided by a splice within a quote that took this context. It is only required if working with the reflection API.
Usually it is infered by the quotes an splices typing. But sometimes it is necessary to explicitly state that a context is nested as in the following example:
def run(using qctx: QuoteContext)(tree: qctx.tasty.Tree): Unit =
def nested()(using qctx.NestedContext): Expr[Int] = '{ ${ makeExpr(tree) } + 1 }
'{ ${ nested() } + 2 }
def makeExpr(using qctx: QuoteContext)(tree: qctx.tasty.Tree): Expr[Int] = ???
clone
( ) : Objecteq
( x$0: Object ) : Booleanerror
( msg: => String ) : UnitReport an error at the position of the macro expansion
Report an error at the position of the macro expansion
error
( msg: => String , expr: Expr[Any] ) : UnitReport an error at the on the position of expr
Report an error at the on the position of expr
finalize
( ) : Unitne
( x$0: Object ) : Booleannotify
( ) : UnitnotifyAll
( ) : Unitshow
( implicit qctx: QuoteContext ) : StringShow a source code like representation of this type without syntax highlight
Show a source code like representation of this type without syntax highlight
show
( syntaxHighlight: SyntaxHighlight ) ( implicit qctx: QuoteContext ) : StringShow a source code like representation of this type
Show a source code like representation of this type
synchronized
[X0] ( x$0: X0 ) : X0throwError
( msg: => String ) : NothingReport an error at the position of the macro expansion and throws a StopQuotedContext
Report an error at the position of the macro expansion and throws a StopQuotedContext
throwError
( msg: => String , expr: Expr[Any] ) : NothingReport an error at the on the position of expr
and throws a StopQuotedContext
Report an error at the on the position of expr
and throws a StopQuotedContext
unseal
( implicit qctx: QuoteContext ) : TypeTreeView this expression quoted.Type[T]
as a TypeTree
View this expression quoted.Type[T]
as a TypeTree
wait
( ) : Unitwait
( x$0: Long ) : Unitwait
( x$0: Long , x$1: Int ) : Unitwarning
( msg: => String ) : UnitReport a warning
Report a warning
warning
( msg: => String , expr: Expr[Nothing <: Any] ) : UnitReport a warning at the on the position of expr
Report a warning at the on the position of expr