O object

UnsafeExpr

extends Object with Serializable

Supertypes

Object, Serializable

Members

private def 

bodyFn

[t] ( implicit  qctx: QuoteContext ) ( e: Term params: List[ValDef] args: List[Term] ) : Term

def 

open

[T1, R, X] ( f: Expr[T1 => R] ) ( content: (Expr[R], PolyFunction) => X ) ( implicit  qctx: QuoteContext ) : X

Allows inspection or transformation of the body of the expression of function. This body may have references to the arguments of the function which sho...

Allows inspection or transformation of the body of the expression of function. This body may have references to the arguments of the function which should be closed over if the expression will be spliced.

val f: Expr[T => R] = ...
UnsafeExpr.open(f) { (body, close) =>
  val newParam: Expr[T] = ...
  ...
  close(body)(newParam) // body or part of the body
}
def 

open

[T1, T2, R, X] ( f: Expr[(T1, T2) => R] ) ( content: (Expr[R], PolyFunction) => X ) ( implicit  qctx: QuoteContext ) ( implicit  x$4: DummyImplicit ) : X

def 

open

[T1, T2, T3, R, X] ( f: Expr[(T1, T2, T3) => R] ) ( content: (Expr[R], PolyFunction) => X ) ( implicit  qctx: QuoteContext ) ( implicit  x$4: DummyImplicit x$5: DummyImplicit ) : X

private def 

paramsAndBody

[R] ( implicit  qctx: QuoteContext ) ( f: Expr[Any] ) : ( List[ValDef], Expr[R] )

def 

underlyingArgument

[T] ( expr: Expr[T] ) ( implicit  qctx: QuoteContext ) : Expr[T]

Returns the undelying argument that was in the call before inlining.

Returns the undelying argument that was in the call before inlining.

inline foo(x: Int): Int = baz(x, x)
foo(bar())

is inlined as

val x = bar()
baz(x, x)

in this case the undelying argument of x will be bar().

Warning: Using the undelying argument directly in the expansion of a macro may change the parameter semantics as by-value parameter could be re-evaluated.