TypeOrMethodic

tastyquery.Types$.TypeOrMethodic
sealed abstract class TypeOrMethodic extends TermType

A type or a methodic type.

Partitioned into Type and MethodicType.

Attributes

Graph
Supertypes
class TermType
class TypeMappable
class Object
trait Matchable
class Any
Known subtypes
trait LambdaType
class MethodType
class PolyType
class TypeLambda
class MethodicType
class Type
trait BoundType
trait ParamRef
class TermParamRef
class TypeParamRef
class RecThis
class GroundType
class AndType
class AnyKindType
class NothingType
class OrType
class TypeProxy
class AppliedType
class ByNameType
class ConstantType
class MatchType
class NamedType
class TermRef
class TypeRef
class RecType
class RefinedType
class SkolemType
class SuperType
class ThisType
Show all

Members list

Value members

Abstract methods

Concrete methods

final def asSeenFrom(pre: Prefix, cls: Symbol)(using Context): ThisTypeMappableType
final def isSubTypeOrMethodic(that: TypeOrMethodic)(using Context): Boolean
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

Deprecated methods

final def widen(using Context): TypeOrMethodic

Widen singleton types, ByNameTypes, AnnotatedTypes and RefinedTypes.

Widen singleton types, ByNameTypes, AnnotatedTypes and RefinedTypes.

Attributes

Deprecated
[Since version 0.9.0]

Inherited methods

Attributes

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