MethodType

tastyquery.Types$.MethodType
See theMethodType companion object
final class MethodType(val paramNames: List[TermName])(paramTypesExp: MethodType => List[Type], resultTypeExp: MethodType => Type) extends MethodicType with TermLambdaType

Attributes

Companion:
object
Graph
Supertypes
trait Binders
trait TermType
class Type
class Prefix
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Types

Inherited types

type PInfo = Type

Attributes

Inherited from:
TermLambdaType

Attributes

Inherited from:
TermLambdaType

Attributes

Inherited from:
TermLambdaType

Attributes

Inherited from:
Type

Value members

Concrete methods

def instantiate(args: List[Type])(using Context): Type
def paramInfos: List[PInfo]
def paramTypes: List[Type]
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: Type)(using Context): Type

Attributes

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

The type representing

The type representing

T[U1, ..., Un]

where

Attributes

args

= U1,...,Un

this

= T

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[Type]

The basetype of this type with given class symbol.

The basetype of this type with given class symbol.

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

Attributes

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

Attributes

Inherited from:
Type
final def isExactlyNothing(using Context): Boolean

Is this type exactly Nothing (no vars, aliases, refinements etc allowed)?

Is this type exactly Nothing (no vars, aliases, refinements etc allowed)?

Attributes

Inherited from:
Type
final def isOfClass(sym: Symbol)(using Context): Boolean

Attributes

Inherited from:
Type
final def isRef(sym: Symbol)(using Context): Boolean

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 lookupMember(name: TypeName)(using Context): Option[TypeRef]

Attributes

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

Attributes

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

Attributes

Inherited from:
Type
final def lookupRef(name: ThisName): Option[ParamRefType]

Attributes

Inherited from:
LambdaType
final def matches(that: Type)(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:
Type
final def memberType(member: TermSymbol)(using Context): Type

Attributes

Inherited from:
Prefix

Attributes

Inherited from:
Prefix

Attributes

Inherited from:
Prefix
protected def newParamRef(n: Int): ParamRefType

Attributes

Inherited from:
TermLambdaType
final def normalizedPrefix(using Context): Option[Prefix]

The normalized prefix of this type is:

The normalized prefix of this type is:

  • For a type alias, the normalized prefix of its alias.
  • For all other named type and class infos: the prefix.
  • Inherited by all other type proxies.
  • None for all other types.

Attributes

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

Attributes

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

Attributes

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

Attributes

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

Attributes

Inherited from:
Prefix
final def widen(using Context): Type

Widen singleton types, ByNameTypes, AnnotatedTypes and RefinedTypes.

Widen singleton types, ByNameTypes, AnnotatedTypes and RefinedTypes.

Attributes

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

Attributes

Inherited from:
Type

Concrete fields

val paramNames: List[TermName]

Inherited fields

Attributes

Inherited from:
LambdaType