SymbolModule

Methods of the module object val Symbol

Source:
Quotes.scala
class Object
trait Matchable
class Any

Value members

Abstract methods

def classSymbol(fullName: String): Symbol

The class Symbol of a global class definition

The class Symbol of a global class definition

Source:
Quotes.scala
def newBind(parent: Symbol, name: String, flags: Flags, tpe: TypeRepr): Symbol

Generates a pattern bind symbol with the given parent, name and type.

Generates a pattern bind symbol with the given parent, name and type.

This symbol starts without an accompanying definition. It is the meta-programmer's responsibility to provide exactly one corresponding definition by passing this symbol to the BindDef constructor.

Value parameters:
flags

extra flags to with which the symbol should be constructed

Note:

As a macro can only splice code into the point at which it is expanded, all generated symbols must be direct or indirect children of the reflection context's owner.

Source:
Quotes.scala
def newMethod(parent: Symbol, name: String, tpe: TypeRepr): Symbol

Generates a new method symbol with the given parent, name and type.

Generates a new method symbol with the given parent, name and type.

This symbol starts without an accompanying definition. It is the meta-programmer's responsibility to provide exactly one corresponding definition by passing this symbol to the DefDef constructor.

Note:

As a macro can only splice code into the point at which it is expanded, all generated symbols must be direct or indirect children of the reflection context's owner.

Source:
Quotes.scala
def newMethod(parent: Symbol, name: String, tpe: TypeRepr, flags: Flags, privateWithin: Symbol): Symbol

Works as the other newMethod, but with additional parameters.

Works as the other newMethod, but with additional parameters.

Value parameters:
flags

extra flags to with which the symbol should be constructed

privateWithin

the symbol within which this new method symbol should be private. May be noSymbol.

Source:
Quotes.scala
def newVal(parent: Symbol, name: String, tpe: TypeRepr, flags: Flags, privateWithin: Symbol): Symbol

Generates a new val/var/lazy val symbol with the given parent, name and type.

Generates a new val/var/lazy val symbol with the given parent, name and type.

This symbol starts without an accompanying definition. It is the meta-programmer's responsibility to provide exactly one corresponding definition by passing this symbol to the ValDef constructor.

Note: Also see reflect.let

Value parameters:
flags

extra flags to with which the symbol should be constructed

privateWithin

the symbol within which this new method symbol should be private. May be noSymbol.

Note:

As a macro can only splice code into the point at which it is expanded, all generated symbols must be direct or indirect children of the reflection context's owner.

Source:
Quotes.scala

Definition not available

Definition not available

Source:
Quotes.scala

Get class symbol if class is either defined in current compilation run or present on classpath.

Get class symbol if class is either defined in current compilation run or present on classpath.

Source:
Quotes.scala

Get method symbol if method is either defined in current compilation run or present on classpath.

Get method symbol if method is either defined in current compilation run or present on classpath. Throws if the method has an overload.

Source:
Quotes.scala

Get module symbol if module is either defined in current compilation run or present on classpath.

Get module symbol if module is either defined in current compilation run or present on classpath.

Source:
Quotes.scala

Get package symbol if package is either defined in current compilation run or present on classpath.

Get package symbol if package is either defined in current compilation run or present on classpath.

Source:
Quotes.scala

Symbol of the definition that encloses the current splicing context.

Symbol of the definition that encloses the current splicing context.

For example, the following call to spliceOwner would return the symbol x.

val x = ${ ... Symbol.spliceOwner ... }

For a macro splice, it is the symbol of the definition where the macro expansion happens.

Source:
Quotes.scala