scala.reflect.macros.runtime.Names.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scala-compiler Show documentation
Show all versions of scala-compiler Show documentation
Compiler for the Scala Programming Language
package scala.reflect.macros
package runtime
trait Names {
self: Context =>
lazy val freshNameCreator = callsiteTyper.context.unit.fresh
def fresh(): String =
freshNameCreator.newName()
def fresh(name: String): String =
freshNameCreator.newName(name)
def fresh[NameType <: Name](name: NameType): NameType =
name.mapName(freshNameCreator.newName(_)).asInstanceOf[NameType]
}