ChangeOwnerTest

cps.macros.misc.ChangeOwnerTest

Minimal macros to test whether various tree manipulations break default getter Selects.

Attributes

Source
ChangeOwnerTest.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

inline def simulateAsyncMacro[T](inline body: T): () => T

Simulate the async macro: decompose block, reassemble, wrap in identity function call via quasiquotes, then wrap in lambda.

Simulate the async macro: decompose block, reassemble, wrap in identity function call via quasiquotes, then wrap in lambda.

Attributes

Source
ChangeOwnerTest.scala
def simulateAsyncMacroImpl[T : Type](body: Expr[T])(implicit evidence$1: Type[T], Quotes): Expr[() => T]

Attributes

Source
ChangeOwnerTest.scala
inline def simulateWithTreeMap[T](inline body: T): () => T

Simulate with context lambda + substituteLambdaParams (TreeMap traversal) + full BlockTransform path. The actual async macro:

Simulate with context lambda + substituteLambdaParams (TreeMap traversal) + full BlockTransform path. The actual async macro:

  1. Wraps body in context lambda: (ctx: C) ?=> body
  2. Extracts the lambda, does body.changeOwner(spliceOwner).asExprOf[T]
  3. Runs BlockTransform which seals last separately, processes via ApplyTreeTransform
  4. Reassembles via SyncCpsExpr.syncOrigin / ValWrappedCpsExpr.syncOrigin
  5. Creates new Lambda using substituteLambdaParams + changeOwner

Attributes

Source
ChangeOwnerTest.scala
def simulateWithTreeMapImpl[T : Type](body: Expr[T])(implicit evidence$1: Type[T], Quotes): Expr[() => T]

Attributes

Source
ChangeOwnerTest.scala
inline def wrapInLambda[T](inline body: T): () => T

Attributes

Source
ChangeOwnerTest.scala
def wrapInLambdaImpl[T : Type](body: Expr[T])(implicit evidence$1: Type[T], Quotes): Expr[() => T]

Attributes

Source
ChangeOwnerTest.scala