AndType

tastyquery.Types.AndType
See theAndType companion object
final class AndType(val first: Type, val second: Type) extends GroundType

Attributes

Companion
object
Graph
Supertypes
class GroundType
class Type
trait Prefix
class TermType
class TypeMappable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

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
Any

Inherited methods

final def &(that: Type)(using Context): Type

Attributes

Inherited from:
Type
final def appliedTo(tpe: TypeOrWildcard)(using Context): Type

Attributes

Inherited from:
Type
final def appliedTo(args: List[TypeOrWildcard])(using Context): Type

The type representing

The type representing

T[U1, ..., Un]

where

Value parameters

args

= U1,...,Un

this

= T

Attributes

Inherited from:
Type
final def asSeenFrom(pre: Prefix, cls: Symbol)(using Context): Type

Attributes

Inherited from:
Type
final def baseType(base: ClassSymbol)(using Context): Option[TypeRef | AppliedType]

The baseType of this type with given class symbol.

The baseType of this type with given class symbol.

Returns None if this type does not have base in any of its base types.

If the result is Some(bt), then bt is of the form

  • TypeRef(p, base) if base is monomorphic, or
  • AppliedType(TypeRef(p, base), args) otherwise, where args.size == base.typeParams.size.

If this type is already of that shape, including with the correct base, then this is returned.

Attributes

Inherited from:
Type
final def dealias(using Context): Type

Attributes

Inherited from:
Type

Attributes

Inherited from:
TypeOrWildcard
final def isFromJavaObject(using Context): Boolean

Is this type considered as "FromJavaObject" for the purposes of subtyping?

Is this type considered as "FromJavaObject" for the purposes of subtyping?

See [Definitions.FromJavaObjectAlias] for details.

Attributes

Inherited from:
Type
final def isSameType(that: Type)(using Context): Boolean

Attributes

Inherited from:
Type
final def isSubType(that: Type)(using Context): Boolean

Attributes

Inherited from:
Type
final def isSubTypeOrMethodic(that: TypeOrMethodic)(using Context): Boolean

Attributes

Inherited from:
TypeOrMethodic
final def lookupMember(name: TypeName)(using Context): Option[TypeRef]

Attributes

Inherited from:
NonEmptyPrefix
final def lookupMember(name: TermName)(using Context): Option[TermRef]

Attributes

Inherited from:
NonEmptyPrefix
final def lookupMember(name: Name)(using Context): Option[NamedType]

Attributes

Inherited from:
NonEmptyPrefix

Attributes

Inherited from:
TypeOrWildcard
final def matches(that: TypeOrMethodic)(using Context): Boolean

Is this type close enough to that type so that members with the two types would override each other?

Is this type close enough to that type so that members with the two types would override each other?

This means:

  • Either both types are polytypes with the same number of type parameters and their result types match after renaming corresponding type parameters
  • Or both types are method types with =:=-equivalent(*) parameter types and matching result types after renaming corresponding parameter types if the method types are dependent.
  • Or both types are =:=-equivalent
  • Or neither type takes term or type parameters.

(*) when matching with a Java method, we also regard Any and Object as equivalent parameter types. (TODO)

This function will always use unsafe-nulls semamtics to check the types. This is because we are using a relaxed rule (ignoring Null types) to check overriding Java methods.

Attributes

Inherited from:
TypeOrMethodic

Attributes

Inherited from:
TypeMappable
final def select(sym: TypeSymbol)(using Context): TypeRef

Attributes

Inherited from:
NonEmptyPrefix
final def select(sym: TermSymbol)(using Context): TermRef

Attributes

Inherited from:
NonEmptyPrefix
final def select(sym: TermOrTypeSymbol)(using Context): NamedType

Attributes

Inherited from:
NonEmptyPrefix
final def select(name: TypeName)(using Context): TypeRef

Attributes

Inherited from:
NonEmptyPrefix
final def select(name: TermName)(using Context): TermRef

Attributes

Inherited from:
NonEmptyPrefix
final def select(name: Name)(using Context): NamedType

Attributes

Inherited from:
NonEmptyPrefix
def showBasic: String

Attributes

Inherited from:
TypeMappable
final def showMultiline: String

Attributes

Inherited from:
TypeMappable
final def typeParams(using Context): List[TypeConstructorParam]

The type parameters of this type, if it is a type constructor.

The type parameters of this type, if it is a type constructor.

If this type is a type constructor, returns a non-empty list of its type parameters.

For all other types (proper types, any-kinded types, methodic types and package refs), returns Nil.

Special case: for Nothing, returns Nil as well (although Nothing is universally-kinded, so it is a type constructor for all possible type constructor signatures).

Attributes

Inherited from:
Type
final def widenTermRef(using Context): TermType

Widens TermRefs one level to their underlyingOrMethodic type.

Widens TermRefs one level to their underlyingOrMethodic type.

  • If this term type is a TermRef, returns this.underlyingOrMethodic.
  • Otherwise, returns this.

Attributes

Inherited from:
TermType
final def |(that: Type)(using Context): Type

Attributes

Inherited from:
Type

Concrete fields

val first: Type
val second: Type