scala.quoted.Quotes.reflectModule.ValDefModule
Methods of the module object val ValDef
Create a value definition val x
, var x
or lazy val x
with the signature defined in the symbol.
Create a value definition val x
, var x
or lazy val x
with the signature defined in the symbol.
The rhs
should return Some
containing the implementation of the method, or None
if the method has no implementation. Any definition directly inside the implementation should have symbol
as owner.
Use Symbol.asQuotes
to create the rhs using quoted code.
See also: Tree.changeOwner
Creates a block { val <name> = <rhs: Term>; <body(x): Term> }
Creates a block { val <name> = <rhs: Term>; <body(x): Term> }
Usage:
ValDef.let(owner, "x", rhs1) { x =>
ValDef.let(x.symbol.owner, "y", rhs2) { y =>
// use `x` and `y`
}
}
Attributes
Creates a block { val x1 = <terms(0): Term>; ...; val xn = <terms(n-1): Term>; <body(List(x1, ..., xn)): Term> }
Creates a block { val x1 = <terms(0): Term>; ...; val xn = <terms(n-1): Term>; <body(List(x1, ..., xn)): Term> }
Usage:
ValDef.let(owner, rhsList) { xs =>
...
}
Attributes
Creates a block { val x = <rhs: Term>; <body(x): Term> }
Creates a block { val x = <rhs: Term>; <body(x): Term> }
Usage:
ValDef.let(owner, rhs1) { x =>
ValDef.let(owner, rhs2) { y =>
// use `x` and `y`
}
}
Attributes
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4