Extractors

io.getquill.metaprog.Extractors
object Extractors

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Extractors.type

Members list

Type members

Classlikes

object Applys

Matches predicate(bar) or predicateT where predicate can be a simple method or something selected from something else e.g: foo.method(bar) or foo.methodT

Matches predicate(bar) or predicateT where predicate can be a simple method or something selected from something else e.g: foo.method(bar) or foo.methodT

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Applys.type
object ArrowFunction

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Matches case class Person(first: String, last: String) creation of the forms: Person("Joe","Bloggs") new Person("Joe","Bloggs")

Matches case class Person(first: String, last: String) creation of the forms: Person("Joe","Bloggs") new Person("Joe","Bloggs")

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object ClassSymbol

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object ConstExpr

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ConstExpr.type
object ConstantExpr

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object ConstantTerm

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object ConstantValue

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object GenericSeq

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
GenericSeq.type

Ignore case where there happens to be an apply e.g. java functions where "str".length in scala will translate into "str".lenth() since for java methods () is automatically added in. Hence it's Apply( Select(Literal(IntConstant("str")), "length") ) Not just Select(Literal(IntConstant("str")), "length")

Ignore case where there happens to be an apply e.g. java functions where "str".length in scala will translate into "str".lenth() since for java methods () is automatically added in. Hence it's Apply( Select(Literal(IntConstant("str")), "length") ) Not just Select(Literal(IntConstant("str")), "length")

Note maybe there's even a case where you want multiple empty-applies e.g. foo()() to be ignored hence this would be done recursively like Untype

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Lambda1

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Lambda1.type
object Lambda2

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Lambda2.type
object LambdaN

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
LambdaN.type

Since things like the QueryParser slow are because Quoted matching is slow (or at least slower then I'd like them to be), a simple performance optimization is to check if there's a single-method being matched and if so, what is it's name. Since Scala matches unapply causes left-to-right (nested and recursively), we can add a unapply clause that will grab the name of the method (if it is a single one being matched which in most cases of the QueryParser is exaclty what we're looking for) and then match it to a name that we expect it to have. For example, if we're trying to match this: {{ case '{ ($o: Option[t]).map(${Lambda1(id, idType, body)}) } => }} We can do the following: {{ case "map" -@> '{ ($o: Option[t]).map(${Lambda1(id, idType, body)}) } => }} This will check that there's a Apply(TypeApply(Select(_, "map"), _), _) being called and then only proceecd into the quoted-matcher if that is the case.

Since things like the QueryParser slow are because Quoted matching is slow (or at least slower then I'd like them to be), a simple performance optimization is to check if there's a single-method being matched and if so, what is it's name. Since Scala matches unapply causes left-to-right (nested and recursively), we can add a unapply clause that will grab the name of the method (if it is a single one being matched which in most cases of the QueryParser is exaclty what we're looking for) and then match it to a name that we expect it to have. For example, if we're trying to match this: {{ case '{ ($o: Option[t]).map(${Lambda1(id, idType, body)}) } => }} We can do the following: {{ case "map" -@> '{ ($o: Option[t]).map(${Lambda1(id, idType, body)}) } => }} This will check that there's a Apply(TypeApply(Select(_, "map"), _), _) being called and then only proceecd into the quoted-matcher if that is the case.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Method0

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Method0.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object RawLambdaN

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
RawLambdaN.type
object Seal

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Seal.type
object SealedInline

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object SelectApply1

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object SelectApplyN

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object SelectExpr

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
SelectExpr.type
object SelectExprOpt

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object TupleIdent

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
TupleIdent.type
object TupleName

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
TupleName.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Uncast

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Uncast.type

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object Uninline

Uninline the term no matter what (TODO should reove the unapply case) that pattern always matches and is too confusing

Uninline the term no matter what (TODO should reove the unapply case) that pattern always matches and is too confusing

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Uninline.type
object Unseal

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Unseal.type
object Untype

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Untype.type
object UntypeApply

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object UntypeExpr

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
UntypeExpr.type
object UntypeTree

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
UntypeTree.type
object `.`

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
`.`.type

Value members

Concrete methods

def is[T : Type](using Quotes)(inputs: Expr[_]*): Boolean
def isNumeric(using Quotes)(tpe: TypeRepr): Boolean
def isNumericPrimitive(using Quotes)(tpe: TypeRepr): Boolean
def isPrimitive(using Quotes)(tpe: TypeRepr): Boolean
def isType[T : Type](using Quotes)(expr: Expr[_]): Boolean
def isType[T : Type](using Quotes)(term: Term): Boolean
def nestInline(using Quotes)(call: Option[Tree], defs: List[Definition])(expr: Expr[_]): Expr[_]
def numericPrimitiveFitsInto(using Quotes)(into: TypeRepr, from: TypeRepr): Boolean

Check whether one numeric from can be primitively assigned to a variable of another into i.e. short can fit into a int, int can fit into a long. Same with float into a double. This is used to determine what can be assigned into what (e.g. in a insert(_.age -> 4.toShort) statement) and still be considered a valid transpilation.

Check whether one numeric from can be primitively assigned to a variable of another into i.e. short can fit into a int, int can fit into a long. Same with float into a double. This is used to determine what can be assigned into what (e.g. in a insert(_.age -> 4.toShort) statement) and still be considered a valid transpilation.

Attributes

def printExpr(using Quotes)(expr: Expr[_], label: String): Unit
def summonContextMethod(using Quotes)(name: String, ctx: Expr[_]): Symbol

Summon a named method from the context Context[D, N]

Summon a named method from the context Context[D, N]

Attributes

inline def typeName[T]: String
def typeNameImpl[T : Type](implicit evidence$2: Type[T], Quotes): Expr[String]

Extensions

Extensions

extension [T](expr: Expr[T])(implicit evidence$3: Type[T], Quotes)
def reseal: Expr[T]
extension (expr: Expr[_])
def `.(caseField)`(property: String)(using Quotes): Expr[Any]