TermSymbol

tastyquery.Symbols.TermSymbol
final class TermSymbol extends TermOrTypeSymbol

Attributes

Graph
Supertypes
class Symbol
class Object
trait Matchable
class Any

Members list

Type members

Value members

Concrete methods

final def hasParamWithDefault: Boolean

Is this symbol a method with at least one parameter with a default value?

Is this symbol a method with at least one parameter with a default value?

Attributes

final def isAbstractOverride: Boolean

Is this term definition abstract override?

Is this term definition abstract override?

Attributes

final def isCaseClassAccessor: Boolean

Is this symbol a case class field accessor?

Is this symbol a case class field accessor?

Attributes

final def isEnumCase: Boolean

Is this symbol a value case of an enum?

Is this symbol a value case of an enum?

Attributes

final def isExport: Boolean

Is this symbol an exporter generated by an export statement?

Is this symbol an exporter generated by an export statement?

Attributes

final def isExtensionMethod: Boolean

Is this an extension method?

Is this an extension method?

Attributes

final def isGivenOrUsing: Boolean

Is this symbol given or using?

Is this symbol given or using?

Attributes

final def isImplicit: Boolean

Is this symbol implicit?

Is this symbol implicit?

Attributes

final def isInline: Boolean

Is this symbol inline?

Is this symbol inline?

Attributes

final def isMacro: Boolean

Is this symbol a macro?

Is this symbol a macro?

Attributes

final def isMethod: Boolean

Is this symbol a method, i.e., a def?

Is this symbol a method, i.e., a def?

Attributes

Returns

true iff kind == TermSymbolKind.Method

final def isModuleVal: Boolean

Is this symbol a module val, i.e., the term of an object?

Is this symbol a module val, i.e., the term of an object?

Attributes

Returns

true iff kind == TermSymbolKind.Module

final def isParamAccessor: Boolean

Is this symbol an accessor for a constructor parameter?

Is this symbol an accessor for a constructor parameter?

Parameters of primary constructors almost always lead to two symbols: the parameter itself, which is local to the constructor, and a "param accessor", which is a field of the class. The param accessor is private if the parameter is not introduced with val or var. Otherwise, its visibility is that specified for the val or var.

Attributes

final def isParamWithDefault: Boolean

Is this symbol a method parameter with a default value?

Is this symbol a method parameter with a default value?

Attributes

final def isSetter: Boolean

Is this symbol the setter of a var?

Is this symbol the setter of a var?

Attributes

final def isSignaturePolymorphicMethod: Boolean

Is this term symbol a signature-polymorphic method?

Attributes

final def isStableMember(using Context): Boolean

Is this term symbol a stable member?

Is this term symbol a stable member?

A stable member is one that is known to be idempotent.

Attributes

final def isTransparentInline: Boolean

Is this symbol transparent inline?

Is this symbol transparent inline?

Attributes

final def kind: TermSymbolKind

The kind of term definition (val, lazy val, var, def or object).

The kind of term definition (val, lazy val, var, def or object).

Parameters and bindings declared with none of these keywords are considered vals.

Attributes

final override def localRef: TermRef

A reference to this symbol that is valid within its declaring scope.

A reference to this symbol that is valid within its declaring scope.

If this symbol is a polymorphic type, for example a polymorphic class, it is left unapplied.

Attributes

Definition Classes
final def moduleClass(using Context): Option[ClassSymbol]

Get the module class of this module value definition, if it exists:

Get the module class of this module value definition, if it exists:

  • for object val C => object class C[$]

Attributes

final def signature(using Context): Signature
final def signedName(using Context): TermName

Returns the possibly signed name of this symbol.

Returns the possibly signed name of this symbol.

For methods with at least one term or type parameter list, this returns a SignedName. For other terms, the returned name is not a SignedName.

If the owner of this symbol is a DeclaringSymbol, then owner.getDecl(signedName) will return this symbol. This is not always the case with name.

Attributes

final def staticRef(using Context): TermRef
final def targetName(using Context): UnsignedTermName
final def typeAsSeenFrom(prefix: Prefix)(using Context): TypeOrMethodic

Inherited methods

final def allOverriddenSymbols(using Context): Iterator[MatchingSymbolType]

All symbols overridden by this symbol.

All symbols overridden by this symbol.

Attributes

Inherited from:
TermOrTypeSymbol
final def annotations: List[Annotation]

Attributes

Inherited from:
Symbol
final def asClass: ClassSymbol

Attributes

Inherited from:
Symbol

Attributes

Inherited from:
Symbol
final def asTerm: TermSymbol

Attributes

Inherited from:
Symbol
final def asType: TypeSymbol

Attributes

Inherited from:
Symbol
final def displayFullName: String

A full name of this symbol for display purposes, such as debugging or error messages.

A full name of this symbol for display purposes, such as debugging or error messages.

displayFullName must not be used to identify symbols, as it is not unique.

Attributes

Inherited from:
Symbol
final protected def failNotCompleted(details: String): Nothing

Attributes

Inherited from:
Symbol
final protected def flags: FlagSet

Attributes

Inherited from:
Symbol
final def getAnnotation(annotClass: ClassSymbol)(using Context): Option[Annotation]

Attributes

Inherited from:
Symbol
final def getAnnotations(annotClass: ClassSymbol)(using Context): List[Annotation]

Attributes

Inherited from:
Symbol
final def hasAnnotation(annotClass: ClassSymbol)(using Context): Boolean

Attributes

Inherited from:
Symbol
final def isAbstractMember: Boolean

Is this symbol an abstract member?

Is this symbol an abstract member?

An abstract member must be implemented in a subclass of its owner. Term members are abstract if they have no right-hand-side. Type members are abstract if they are neither type aliases nor opaque type aliases.

Other kinds of symbols are never abstract members. To test whether a class is abstract, use ClassSymbol.isAbstractClass.

Note that this is false for abstract override members.

Attributes

Inherited from:
TermOrTypeSymbol
final def isClass: Boolean

Attributes

Inherited from:
Symbol
final def isFinalMember: Boolean

Is this symbol a final member, in the sense that it cannot be overridden?

Is this symbol a final member, in the sense that it cannot be overridden?

Classes are always final members, since Scala 3 does not allow to override (shadow) inner classes.

Other symbols are final members iff they have the final modifier.

Attributes

Inherited from:
TermOrTypeSymbol
final def isInfix: Boolean

Does this symbol have the infix modifier?

Does this symbol have the infix modifier?

Attributes

Inherited from:
TermOrTypeSymbol
final def isPackage: Boolean

Attributes

Inherited from:
Symbol
final def isPrivate: Boolean

Is this symbol private?

Is this symbol private?

A symbol is said private if it either private without scope or private[this].

Private members obey different rules than other members in a number of situations. In particular, they are not inherited and therefore do not participate in overriding relationships.

Attributes

Returns

true iff visibility == Visibility.Private || visibility == Visibility.PrivateThis

Inherited from:
TermOrTypeSymbol
final def isPublic: Boolean

Is this symbol public?

Is this symbol public?

Attributes

Returns

true iff visibility == Visibility.Public

Inherited from:
TermOrTypeSymbol
final def isSynthetic: Boolean

Is this symbol generated by the compiler?

Is this symbol generated by the compiler?

Attributes

Inherited from:
TermOrTypeSymbol
final def isTerm: Boolean

Attributes

Inherited from:
Symbol
final def isType: Boolean

Attributes

Inherited from:
Symbol
final def matchingSymbol(inClass: ClassSymbol, siteClass: ClassSymbol)(using Context): Option[MatchingSymbolType]

The symbol whose name and type matches the type of this symbol in the given class.

The symbol whose name and type matches the type of this symbol in the given class.

If inClass == this.owner, matchingSymbol returns this symbol. Otherwise, private members and constructors are ignored.

Unlike the override-related methods overriddenSymbol and overridingSymbol, this method can return non-empty results when inClass and this.owner are unrelated.

siteClass must be a common subclass of this.owner and inClass.

Value parameters

inClass

The class in which to look for a matching symbol

siteClass

The base class from which member types are computed

Attributes

Throws
java.lang.IllegalArgumentException

if owner.isClass is false, if siteClass.isSubclass(owner.asClass) is false, or if siteClass.isSubclass(inClass) is false

Inherited from:
TermOrTypeSymbol
final def nextOverriddenSymbol(using Context): Option[MatchingSymbolType]

The first symbol overridden by this symbol, if any.

The first symbol overridden by this symbol, if any.

Attributes

Inherited from:
TermOrTypeSymbol
final def overriddenSymbol(inClass: ClassSymbol)(using Context): Option[MatchingSymbolType]

The symbol, in class inClass, that is overridden by this symbol, if any.

The symbol, in class inClass, that is overridden by this symbol, if any.

Attributes

Inherited from:
TermOrTypeSymbol
final def overrides(that: TermOrTypeSymbol)(using Context): Boolean

Returns true iff this symbol override that symbol.

Returns true iff this symbol override that symbol.

Attributes

Inherited from:
TermOrTypeSymbol
final def overridingSymbol(inClass: ClassSymbol)(using Context): Option[MatchingSymbolType]

The symbol overriding this symbol in given subclass inClass, if any.

The symbol overriding this symbol in given subclass inClass, if any.

Attributes

Inherited from:
TermOrTypeSymbol
final protected def privateWithin: Option[DeclaringSymbol]

Attributes

Inherited from:
Symbol

The source language in which this symbol was defined.

The source language in which this symbol was defined.

The source language of a symbol may have an influence on how it is erased, and therefore on how its signature is computed.

Attributes

Inherited from:
TermOrTypeSymbol
def toDebugString: String

Attributes

Inherited from:
Symbol
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Symbol -> Any
Inherited from:
Symbol
final def tree: Option[DefiningTreeType]

Attributes

Inherited from:
Symbol
final def visibility: Visibility

The declared visibility of this symbol.

The declared visibility of this symbol.

Attributes

Inherited from:
TermOrTypeSymbol

Concrete fields