MethodType

tastyquery.Types.MethodType
See theMethodType companion object
final class MethodType extends MethodicType, TermLambdaType

Attributes

Companion
object
Graph
Supertypes
trait LambdaType
trait TypeBinder
class MethodicType
class TermType
class TypeMappable
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

type PInfo = Type

Attributes

Inherited from:
TermLambdaType

Attributes

Inherited from:
TermLambdaType

Attributes

Inherited from:
TermLambdaType

Value members

Concrete methods

final def asSeenFrom(pre: Prefix, cls: Symbol)(using Context): MethodType
def isContextual: Boolean

Does this method type have a using modifier?

Does this method type have a using modifier?

Attributes

def isImplicit: Boolean

Does this method type have an implicit modifier?

Does this method type have an implicit modifier?

Attributes

def isImplicitOrContextual: Boolean

Does this method type have an implicit or using modifier?

Does this method type have an implicit or using modifier?

Attributes

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

Attributes

Inherited from:
MethodicType
final def instantiate(args: List[Type])(using Context): ResultType

Attributes

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

Attributes

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

Attributes

Inherited from:
TypeOrMethodic
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
protected def newParamRef(n: Int): ParamRefType

Attributes

Inherited from:
TermLambdaType
final def paramInfos: List[PInfo]

Attributes

Inherited from:
TermLambdaType

Attributes

Inherited from:
TypeMappable
def showBasic: String

Attributes

Inherited from:
TypeMappable
final def showMultiline: String

Attributes

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

Concrete fields

Inherited fields

val paramRefs: List[ParamRefType]

Attributes

Inherited from:
LambdaType