ClassSymbol

tastyquery.Symbols.ClassSymbol
final class ClassSymbol extends TypeSymbol, DeclaringSymbol

Attributes

Graph
Supertypes
class TypeSymbol
class Symbol
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

Attributes

Inherited from:
TypeSymbol

Value members

Concrete methods

final def companionClass(using Context): Option[ClassSymbol]

Get the companion class of this class, if it exists:

Get the companion class of this class, if it exists:

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

Attributes

final def declarations(using Context): List[TermOrTypeSymbol]

Note: this will force all trees in a package

Note: this will force all trees in a package

Attributes

Returns a list of all the overloaded declarations with the given unsigned name.

Returns a list of all the overloaded declarations with the given unsigned name.

Attributes

Throws
tastyquery.Exceptions.MemberNotFoundException

if there is no declaration with the given unsigned name

final def findDecl(name: Name)(using Context): TermOrTypeSymbol
final def findDecl(name: TypeName)(using Context): TypeSymbol
final def findDecl(name: TermName)(using Context): TermSymbol
final def findMember(name: Name)(using Context): TermOrTypeSymbol
final def findMember(name: TermName)(using Context): TermSymbol
final def findMember(name: TypeName)(using Context): TypeSymbol

Convenience method to find a non-overloaded decl from its unsigned name.

Convenience method to find a non-overloaded decl from its unsigned name.

Attributes

Throws
tastyquery.Exceptions.MemberNotFoundException

if there are multiple or no overload with the given unsigned name

final def getAllOverloadedDecls(name: UnsignedTermName)(using Context): List[TermSymbol]

Returns a list of all the overloaded declarations with the given unsigned name.

Returns a list of all the overloaded declarations with the given unsigned name.

If there is no declaration with the given unsigned name, this method returns Nil.

Attributes

final def getDecl(name: Name)(using Context): Option[TermOrTypeSymbol]
final def getDecl(name: TypeName)(using Context): Option[TypeSymbol]
final def getDecl(name: TermName)(using Context): Option[TermSymbol]
final def getMember(name: Name)(using Context): Option[TermOrTypeSymbol]
final def getMember(name: TermName)(using Context): Option[TermSymbol]
final def getMember(name: TypeName)(using Context): Option[TypeSymbol]
final def getNonOverloadedDecl(name: UnsignedTermName)(using Context): Option[TermSymbol]

Convenience method to get a non-overloaded decl from its unsigned name.

Convenience method to get a non-overloaded decl from its unsigned name.

If there are multiple or no overload with the given unsigned name, this method returns None.

Attributes

final def givenSelfType: Option[Type]
final def isAbstractClass: Boolean

Is this class abstract?

Is this class abstract?

An abstract class cannot be directly instantiated. It must be extended by a concrete class before doing so.

This is true for traits and abstract classes.

Attributes

final def isCaseClass: Boolean

Is this class a case class?

Is this class a case class?

Attributes

final def isEnum: Boolean

Is this class an enum?

Is this class an enum?

Attributes

final def isModuleClass: Boolean

Is this the hidden class of an object?

Is this the hidden class of an object?

Attributes

def isPrimitiveValueClass: Boolean
final def isSubClass(that: ClassSymbol)(using Context): Boolean
final def isTrait: Boolean

Is this class a trait?

Is this class a trait?

Attributes

final def isTransparentTrait: Boolean

Is this a class a transparent trait?

Is this a class a transparent trait?

Attributes

def isTupleNClass: Boolean
final def linearization(using Context): List[ClassSymbol]
final def moduleValue(using Context): Option[TermSymbol]

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

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

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

Attributes

final def openLevel: OpenLevel

The open level of this class (open, closed, sealed or final).

The open level of this class (open, closed, sealed or final).

Attributes

def parentClasses(using Context): List[ClassSymbol]
final def parents(using Context): List[Type]
final def sealedChildren(using Context): List[ClassSymbol | TermSymbol]

The direct children of a sealed class (including enums).

The direct children of a sealed class (including enums).

If this.is(Sealed) is false, this method returns Nil.

Otherwise, each element of the list is either:

  • a non-module class that extends this class (including enum class cases), or
  • a module value whose module class extends this class, or
  • an enum val case for this enum class.

The results are ordered by their declaration order in the source.

Attributes

final def selfType: Type
final def thisType: ThisType

The ThisType for this class, as visible from inside this class.

The ThisType for this class, as visible from inside this class.

Attributes

final def typeParams: List[ClassTypeParamSymbol]

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 isOpaqueTypeAlias: Boolean

Attributes

Inherited from:
TypeSymbol
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 isTypeAlias: Boolean

Attributes

Inherited from:
TypeSymbol
final override def localRef: TypeRef

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
Inherited from:
TypeSymbol
final protected def matchingDecl(inClass: ClassSymbol, siteClass: ClassSymbol)(using Context): Option[TypeSymbol]

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

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

Value parameters

inClass

The class containing the result symbol's definition

siteClass

The base class from which member types are computed

Attributes

Inherited from:
TypeSymbol
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
final def staticRef(using Context): TypeRef

Attributes

Inherited from:
TypeSymbol
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

override val name: ClassTypeName