All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.getquill.quotation.Bindings.scala Maven / Gradle / Ivy

The newest version!
package io.getquill.quotation

import scala.reflect.macros.whitebox.Context

object Bindings {
  def apply(c: Context)(quoted: c.Tree, tpe: c.Type): Map[c.Symbol, c.Tree] = {
    import c.universe._
    tpe
      .member(TermName("bindings"))
      .typeSignature
      .decls
      .collect {
        case m: MethodSymbol if (m.isGetter) =>
          m ->
            q"""
              {
                import _root_.scala.language.reflectiveCalls
                $quoted.bindings.$m
              }
            """
      }
      .toMap
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy