Lambda
scala.quoted.runtime.impl.QuotesImpl.reflect$.Lambda$
Attributes
- Graph
- Supertypes
- Self type
- Lambda.type
Members list
Concise view
Value members
Concrete methods
Generates a lambda with the given method type.
Generates a lambda with the given method type.
Block((DefDef(_, _, params :: Nil, _, Some(rhsFn(meth, paramRefs)))) :: Nil, Closure(meth, _))
Usage:
val mtpe = MethodType(List("arg1"))(_ => List(TypeRepr.of[Int]), _ => TypeRepr.of[Int])
Lambda(owner, mtpe, {
case (methSym, List(arg1: Term)) =>
ValDef.let(methSym, f(arg1)) { ... }
}
)
Usage with quotes:
val mtpe = MethodType(List("arg1"))(_ => List(TypeRepr.of[Int]), _ => TypeRepr.of[Int])
Lambda(owner, mtpe, {
case (methSym, List(arg1: Term)) =>
given Quotes = methSym.asQuotes
'{ ... }
}
)
Attributes
- owner:
owner of the generated
meth
symbol- rhsFn:
Function that receives the
meth
symbol and the a list of references to theparams
- tpe:
Type of the definition