Types

object Types
class Object
trait Matchable
class Any

Type members

Classlikes

final
class AndType(val first: Type, val second: Type) extends GroundType with ValueType
Companion
object
object AndType
Companion
class
final
class AnnotatedType(val typ: Type, val annotation: Tree) extends TypeProxy with ValueType

typ @ annot

typ @ annot

final
class AppliedType(val tycon: Type, val args: List[Type]) extends TypeProxy with ValueType

A type application C[T_1, ..., T_n] Typebounds for wildcard application: C[_], C[?]

A type application C[T_1, ..., T_n] Typebounds for wildcard application: C[_], C[?]

sealed
trait Binders

Encapsulates the binders associated with a ParamRef.

Encapsulates the binders associated with a ParamRef.

sealed
trait BoundType extends Type
final
class BoundedType(val bounds: TypeBounds, val alias: Type) extends Type
final
class ClassInfo(val cls: ClassSymbol) extends GroundType
Companion
object
object ClassInfo
Companion
class
final
class ConstantType(val value: Constant) extends TypeProxy with SingletonType

A constant type with single value.

A constant type with single value.

abstract

Superclass for custom transient ground types used by custom algorithms.

Superclass for custom transient ground types used by custom algorithms.

When writing algorithms that manipulate Types, it is sometimes useful to temporarily store custom data in place of Types. This can be done by defining a subclass of CustomTransientGroundType. At the end of the day, all CustomTransientGroundTypes should have been replaced by proper Types.

The methods of tasty-query never expose instances of CustomTransientGroundType, but you may use it for your own purposes.

When permorming an exhaustive match on all possible Types, you should cover CustomTransientGroundType in a case that always throws (unless you are actually using it for some purposes):

val tpe: Type = ...
tpe match
 case tpe: TypeRef => ...
 ...
 case tpe: CustomTransientGroundType =>
   throw AssertionError(s"Unexpected custom transient ground type $tpe")
end match
Companion
object
Companion
class
final
class ExprType(val resultType: Type) extends TypeProxy with MethodicType

A by-name parameter type of the form => T, or the type of a method with no parameter list.

A by-name parameter type of the form => T, or the type of a method with no parameter list.

sealed abstract
class GroundType extends Type

Non-proxy types

Non-proxy types

sealed
trait LambdaType extends Binders with TermType
sealed abstract
class LambdaTypeCompanion[N <: Name, PInfo <: Type | TypeBounds, LT <: LambdaType]
final
class MatchType(val bound: Type, val scrutinee: Type, val cases: List[MatchTypeCase | TypeLambda]) extends TypeProxy with ValueType

selector match { cases }

selector match { cases }

final
class MatchTypeCase(val pattern: Type, val result: Type) extends GroundType

case pattern => result

case pattern => result

final
class MethodType(val paramNames: List[TermName])(@constructorOnly paramTypesExp: MethodType => List[Type], @constructorOnly resultTypeExp: MethodType => Type) extends MethodicType with TermLambdaType
Companion
object
sealed
trait MethodicType extends TermType
sealed abstract
class NamedType extends PathType
Companion
object
object NamedType
Companion
class
final
class NamedTypeBounds(val name: TypeName, val bounds: TypeBounds) extends Type
object NoPrefix extends Type
object NoType extends GroundType
final
class OrType(val first: Type, val second: Type) extends GroundType with ValueType
Companion
object
object OrType
Companion
class
final
class PackageRef(val fullyQualifiedName: FullyQualifiedName) extends Type
sealed
trait ParamRef extends BoundType
sealed
trait PathType extends TypeProxy with ValueType
final
Companion
object
final case
class RealTypeBounds(low: Type, high: Type) extends TypeBounds
final
class RecType extends RefinedOrRecType with Binders
Companion
object
object RecType
Companion
class
sealed abstract
final
class RefinedType(val parent: Type, val refinedName: Name, val refinedInfo: TypeBounds) extends RefinedOrRecType with ValueType

A refined type parent { type refinedName <:> refinedInfo }

A refined type parent { type refinedName <:> refinedInfo }

Value Params
parent

The type being refined

refinedInfo

The info of the refinement declaration

refinedName

The name of the refinement declaration

sealed
trait SingletonType extends TypeProxy with ValueType

A marker trait for types that are guaranteed to contain only a single non-null value (they might contain null in addition).

A marker trait for types that are guaranteed to contain only a single non-null value (they might contain null in addition).

sealed
final
class TermParamRef(val binders: TermLambdaType, val paramNum: Int) extends ParamRef with SingletonType
final
class TermRef extends NamedType with SingletonType

The singleton type for path prefix#myDesignator.

The singleton type for path prefix#myDesignator.

Companion
object
object TermRef
Companion
class
sealed
trait TermType extends Type

A marker trait for types that apply only to term symbols or that represent higher-kinded types.

A marker trait for types that apply only to term symbols or that represent higher-kinded types.

final
class ThisType(val tref: TypeRef) extends PathType with SingletonType
abstract
class Type extends TypeMappable
final case
class TypeAlias(alias: Type) extends TypeBounds
sealed
trait TypeBinders extends Binders
sealed abstract
class TypeBounds(val low: Type, val high: Type) extends TypeMappable
final
class TypeLambda(val paramNames: List[TypeName])(@constructorOnly paramTypeBoundsExp: TypeLambda => List[TypeBounds], @constructorOnly resultTypeExp: TypeLambda => Type) extends TypeProxy with TermType with TypeLambdaType
Companion
object
sealed
sealed
final
class TypeParamRef(val binders: TypeLambdaType, val paramNum: Int) extends TypeProxy with ValueType with ParamRef
sealed abstract
class TypeProxy extends Type

Type proxies. Each implementation is expected to redefine the underlying method.

Type proxies. Each implementation is expected to redefine the underlying method.

final
class TypeRef extends NamedType
Companion
object
object TypeRef
Companion
class
sealed
trait ValueType extends TermType

A marker trait for types that can be types of values or that are higher-kinded

A marker trait for types that can be types of values or that are higher-kinded

final
class WildcardTypeBounds(val bounds: TypeBounds) extends TypeProxy