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

izumi.reflect.dottyreflection.InspectorBase.scala Maven / Gradle / Ivy

There is a newer version: 2.3.10
Show newest version
package izumi.reflect.dottyreflection

import scala.quoted.Quotes

trait InspectorBase {

  val qctx: Quotes
  import qctx.reflect._

  protected def shift: Int

  inline val debug = false
  type debug = debug.type

  inline final protected def logStart(inline s: String): Unit = {
    if (debug) println(" " * shift + s)
  }

  inline final protected def log(inline s: String): Unit = {
    if (debug) println(" " * shift + " -> " + s)
  }

  inline final protected def logTpeAttrs[T](inline uns: TypeTree): Unit = {
    if (debug) {
      val tree = uns
      val symbol = tree.symbol
      println(s"Attrs[${tree.show}]: type=${symbol.isType}, term=${symbol.isTerm}, packageDef=${symbol.isPackageDef}, classDef=${symbol.isClassDef}, typeDef=${symbol.isValDef}, defdef=${symbol.isDefDef}, bind=${symbol.isBind}, nosymbol=${symbol.isNoSymbol}")
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy